• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

taosdata / TDengine / #4911

04 Jan 2026 09:05AM UTC coverage: 65.028% (-0.8%) from 65.864%
#4911

push

travis-ci

web-flow
merge: from main to 3.0 branch #34156

1206 of 4524 new or added lines in 22 files covered. (26.66%)

1517 existing lines in 134 files now uncovered.

195276 of 300296 relevant lines covered (65.03%)

116931714.52 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

58.89
/source/common/src/tmisce.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#define _DEFAULT_SOURCE
17
#include "tdatablock.h"
18
#include "tglobal.h"
19
#include "tjson.h"
20
#include "tmisce.h"
21
#include "tcompare.h"
22

23
int32_t taosGetIpv4FromEp(const char* ep, SEp* pEp) {
10,669,961✔
24
  pEp->port = 0;
10,669,961✔
25
  memset(pEp->fqdn, 0, TSDB_FQDN_LEN);
10,670,173✔
26
  tstrncpy(pEp->fqdn, ep, TSDB_FQDN_LEN);
10,670,286✔
27

28
  char* temp = strrchr(pEp->fqdn, ':');
10,669,913✔
29
  if (temp) {
10,669,961✔
30
    *temp = 0;
9,933,808✔
31
    pEp->port = taosStr2UInt16(temp + 1, NULL, 10);
9,933,808✔
32
    if (pEp->port < 0) {
33
      return TSDB_CODE_INVALID_PARA;
34
    }
35
  }
36

37
  if (pEp->port == 0) {
10,669,887✔
38
    pEp->port = tsServerPort;
736,471✔
39
  }
40

41
  if (pEp->port <= 0) {
10,669,546✔
42
    return TSDB_CODE_INVALID_PARA;
×
43
  }
44
  return 0;
10,670,056✔
45
}
46

47
static int8_t isValidPort(const char* str) {
×
48
  if (!str || !*str) return 0;
×
49
  for (const char* p = str; *p; ++p) {
×
50
    if (*p < '0' || *p > '9') {
×
51
      return 0;
×
52
    }
53
  }
54
  return 1;
×
55
}
56

57
static int32_t taosGetDualIpFromEp(const char* ep, SEp* pEp) {
×
58
  memset(pEp->fqdn, 0, TSDB_FQDN_LEN);
×
59
  pEp->port = 0;
×
60
  char buf[TSDB_FQDN_LEN] = {0};
×
61

62
  if (ep[0] == '[') {
×
63
    // [IPv6]:port format
64
    const char* end = strchr(ep, ']');
×
65
    if (!end) return TSDB_CODE_INVALID_PARA;
×
66

67
    int ipLen = end - ep - 1;
×
68
    if (ipLen >= TSDB_FQDN_LEN) ipLen = TSDB_FQDN_LEN - 1;
×
69

70
    strncpy(pEp->fqdn, ep + 1, ipLen);
×
71
    pEp->fqdn[ipLen] = '\0';
×
72

73
    if (*(end + 1) == ':' && *(end + 2)) {
×
74
      pEp->port = taosStr2UInt16(end + 2, NULL, 10);
×
75
    }
76
  } else {
77
    // Compatible with ::1:6030, ::1, IPv4:port, hostname:port, etc.
78
    strncpy(buf, ep, TSDB_FQDN_LEN - 1);
×
79
    buf[TSDB_FQDN_LEN - 1] = 0;
×
80

81
    char* lastColon = strrchr(buf, ':');
×
82
    char* firstColon = strchr(buf, ':');
×
83

84
    if (lastColon && firstColon != lastColon) {
×
85
      // Multiple colons, possibly IPv6:port or pure IPv6
86
      char* portStr = lastColon + 1;
×
87
      if (isValidPort(portStr) && lastColon != buf && (*(lastColon - 1) != ':')) {
×
88
        *lastColon = 0;
×
89
        tstrncpy(pEp->fqdn, buf, TSDB_FQDN_LEN);
×
90
        pEp->port = taosStr2UInt16(portStr, NULL, 10);
×
91
      } else {
92
        tstrncpy(pEp->fqdn, ep, TSDB_FQDN_LEN);
×
93
      }
94
    } else if (lastColon) {
×
95
      // Only one colon, IPv4:port or hostname:port
96
      char* portStr = lastColon + 1;
×
97
      if (isValidPort(portStr) && lastColon != buf) {
×
98
        *lastColon = 0;
×
99
        tstrncpy(pEp->fqdn, buf, TSDB_FQDN_LEN);
×
100
        pEp->port = taosStr2UInt16(portStr, NULL, 10);
×
101
      } else {
102
        tstrncpy(pEp->fqdn, ep, TSDB_FQDN_LEN);
×
103
      }
104
    } else {
105
      // No colon, pure hostname or IPv6 without port
106
      tstrncpy(pEp->fqdn, ep, TSDB_FQDN_LEN);
×
107
    }
108
  }
109

110
  if (pEp->port == 0) {
×
111
    pEp->port = tsServerPort;
×
112
  }
113

114
  if (pEp->port <= 0) {
×
115
    return TSDB_CODE_INVALID_PARA;
×
116
  }
117

118
  return 0;
×
119
}
120
int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp) {
10,670,317✔
121
  if (tsEnableIpv6) {
10,670,317✔
122
    return taosGetDualIpFromEp(ep, pEp);
×
123
  } else {
124
    return taosGetIpv4FromEp(ep, pEp);
10,670,317✔
125
  }
126
}
127

128
int32_t addEpIntoEpSet(SEpSet* pEpSet, const char* fqdn, uint16_t port) {
42,620,723✔
129
  if (pEpSet == NULL || fqdn == NULL || strlen(fqdn) == 0) {
42,620,723✔
130
    return TSDB_CODE_INVALID_PARA;
×
131
  }
132

133
  int32_t index = pEpSet->numOfEps;
42,620,723✔
134
  if (index >= sizeof(pEpSet->eps) / sizeof(pEpSet->eps[0])) {
42,620,723✔
135
    return TSDB_CODE_OUT_OF_RANGE;
×
136
  }
137
  tstrncpy(pEpSet->eps[index].fqdn, fqdn, tListLen(pEpSet->eps[index].fqdn));
42,620,723✔
138
  pEpSet->eps[index].port = port;
42,620,723✔
139
  pEpSet->numOfEps += 1;
42,620,723✔
140
  return 0;
42,620,723✔
141
}
142

143
bool isEpsetEqual(const SEpSet* s1, const SEpSet* s2) {
8,286,764✔
144
  if (s1->numOfEps != s2->numOfEps || s1->inUse != s2->inUse) {
8,286,764✔
145
    return false;
932,617✔
146
  }
147

148
  for (int32_t i = 0; i < s1->numOfEps; i++) {
16,065,928✔
149
    if (s1->eps[i].port != s2->eps[i].port || strncmp(s1->eps[i].fqdn, s2->eps[i].fqdn, TSDB_FQDN_LEN) != 0)
8,714,544✔
150
      return false;
2,763✔
151
  }
152
  return true;
7,351,384✔
153
}
154

155
void epsetAssign(SEpSet* pDst, const SEpSet* pSrc) {
274,006✔
156
  if (pSrc == NULL || pDst == NULL) {
274,006✔
157
    return;
×
158
  }
159

160
  pDst->inUse = pSrc->inUse;
274,006✔
161
  pDst->numOfEps = pSrc->numOfEps;
274,006✔
162
  for (int32_t i = 0; i < pSrc->numOfEps; ++i) {
1,060,990✔
163
    pDst->eps[i].port = pSrc->eps[i].port;
786,984✔
164
    tstrncpy(pDst->eps[i].fqdn, pSrc->eps[i].fqdn, tListLen(pSrc->eps[i].fqdn));
786,984✔
165
  }
166
}
167

168
void epAssign(SEp* pDst, SEp* pSrc) {
73,623,603✔
169
  if (pSrc == NULL || pDst == NULL) {
73,623,603✔
170
    return;
238✔
171
  }
172
  memset(pDst->fqdn, 0, tListLen(pSrc->fqdn));
73,623,365✔
173
  tstrncpy(pDst->fqdn, pSrc->fqdn, tListLen(pSrc->fqdn));
73,623,446✔
174
  pDst->port = pSrc->port;
73,624,247✔
175
}
176

177
void epsetSort(SEpSet* pDst) {
70,324,219✔
178
  if (pDst->numOfEps <= 1) {
70,324,219✔
179
    return;
49,840,655✔
180
  }
181
  int validIdx = false;
20,484,050✔
182
  SEp ep = {0};
20,484,050✔
183
  if (pDst->inUse >= 0 && pDst->inUse < pDst->numOfEps) {
20,484,230✔
184
    validIdx = true;
20,484,157✔
185
    epAssign(&ep, &pDst->eps[pDst->inUse]);
20,484,157✔
186
  }
187

188
  for (int i = 0; i < pDst->numOfEps - 1; i++) {
59,384,545✔
189
    for (int j = 0; j < pDst->numOfEps - 1 - i; j++) {
99,089,520✔
190
      SEp* f = &pDst->eps[j];
60,188,200✔
191
      SEp* s = &pDst->eps[j + 1];
60,190,599✔
192
      int  cmp = strncmp(f->fqdn, s->fqdn, sizeof(f->fqdn));
60,190,191✔
193
      if (cmp > 0 || (cmp == 0 && f->port > s->port)) {
60,190,253✔
194
        SEp ep1 = {0};
17,713,875✔
195
        epAssign(&ep1, f);
17,713,273✔
196
        epAssign(f, s);
17,713,273✔
197
        epAssign(s, &ep1);
17,713,273✔
198
      }
199
    }
200
  }
201
  if (validIdx == true)
20,484,478✔
202
    for (int i = 0; i < pDst->numOfEps; i++) {
38,331,420✔
203
      int cmp = strncmp(ep.fqdn, pDst->eps[i].fqdn, sizeof(ep.fqdn));
38,330,351✔
204
      if (cmp == 0 && ep.port == pDst->eps[i].port) {
38,329,639✔
205
        pDst->inUse = i;
20,482,621✔
206
        break;
20,482,626✔
207
      }
208
    }
209
}
210

211
void updateEpSet_s(SCorEpSet* pEpSet, SEpSet* pNewEpSet) {
936,578✔
212
  taosCorBeginWrite(&pEpSet->version);
936,578✔
213
  pEpSet->epSet = *pNewEpSet;
936,578✔
214
  taosCorEndWrite(&pEpSet->version);
936,578✔
215
}
936,578✔
216

217
SEpSet getEpSet_s(SCorEpSet* pEpSet) {
2,147,483,647✔
218
  SEpSet ep = {0};
2,147,483,647✔
219
  taosCorBeginRead(&pEpSet->version);
2,147,483,647✔
220
  ep = pEpSet->epSet;
2,147,483,647✔
221
  taosCorEndRead(&pEpSet->version);
2,147,483,647✔
222

223
  return ep;
2,147,483,647✔
224
}
225

226
int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) {
939,548,027✔
227
  int32_t ret = 0;
939,548,027✔
228
  int32_t nwrite = 0;
939,548,027✔
229

230
  nwrite = snprintf(pBuf + nwrite, cap, "epset:{");
939,548,027✔
231
  if (nwrite <= 0 || nwrite >= cap) {
939,578,628✔
232
    return TSDB_CODE_OUT_OF_BUFFER;
30,529✔
233
  }
234
  cap -= nwrite;
939,548,131✔
235

236
  for (int _i = 0; (_i < pEpSet->numOfEps) && (cap > 0); _i++) {
1,982,310,439✔
237
    if (_i == pEpSet->numOfEps - 1) {
1,042,786,735✔
238
      ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port);
939,555,105✔
239
    } else {
240
      ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d, ", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port);
103,216,355✔
241
    }
242

243
    if (ret <= 0 || ret >= cap) {
1,042,762,248✔
244
      return TSDB_CODE_OUT_OF_BUFFER;
×
245
    }
246

247
    nwrite += ret;
1,042,762,308✔
248
    cap -= ret;
1,042,762,308✔
249
  }
250

251
  if (cap <= 0) {
939,566,357✔
252
    return TSDB_CODE_OUT_OF_BUFFER;
×
253
  }
254

255
  ret = snprintf(pBuf + nwrite, cap, "}, inUse:%d", pEpSet->inUse);
939,566,357✔
256
  if (ret <= 0 || ret >= cap) {
939,556,369✔
UNCOV
257
    return TSDB_CODE_OUT_OF_BUFFER;
×
258
  } else {
259
    return TSDB_CODE_SUCCESS;
939,556,425✔
260
  }
261
}
262

263
int32_t taosGenCrashJsonMsg(int signum, char** pMsg, int64_t clusterId, int64_t startTime) {
×
264
  int32_t code = 0;
×
265
  SJson*  pJson = tjsonCreateObject();
×
266
  if (pJson == NULL) return terrno;
×
267

268
  char tmp[4096] = {0};
×
269

270
  TAOS_CHECK_GOTO(tjsonAddDoubleToObject(pJson, "reportVersion", 1), NULL, _exit);
×
271

272
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "clusterId", clusterId), NULL, _exit);
×
273
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "startTime", startTime), NULL, _exit);
×
274

275
  // Do NOT invoke the taosGetFqdn here.
276
  // this function may be invoked when memory exception occurs,so we should assume that it is running in a memory locked
277
  // environment. The lock operation by taosGetFqdn may cause this program deadlock.
278
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "fqdn", tsLocalFqdn), NULL, _exit);
×
279

280
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "pid", taosGetPId()), NULL, _exit);
×
281

282
  code = taosGetAppName(tmp, NULL);
×
283
  if (code != 0) {
×
284
    TAOS_CHECK_GOTO(code, NULL, _exit);
×
285
  }
286
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "appName", tmp), NULL, _exit);
×
287

288
  if (taosGetOsReleaseName(tmp, NULL, NULL, sizeof(tmp)) == 0) {
×
289
    TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "os", tmp), NULL, _exit);
×
290
  } else {
291
    // do nothing
292
  }
293

294
  float numOfCores = 0;
×
295
  if (taosGetCpuInfo(tmp, sizeof(tmp), &numOfCores) == 0) {
×
296
    TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "cpuModel", tmp), NULL, _exit);
×
297
    TAOS_CHECK_GOTO(tjsonAddDoubleToObject(pJson, "numOfCpu", numOfCores), NULL, _exit);
×
298
  } else {
299
    TAOS_CHECK_GOTO(tjsonAddDoubleToObject(pJson, "numOfCpu", tsNumOfCores), NULL, _exit);
×
300
  }
301

302
  int32_t nBytes = snprintf(tmp, sizeof(tmp), "%" PRId64 " kB", tsTotalMemoryKB);
×
303
  if (nBytes <= 9 || nBytes >= sizeof(tmp)) {
×
304
    TAOS_CHECK_GOTO(TSDB_CODE_OUT_OF_RANGE, NULL, _exit);
×
305
  }
306
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "memory", tmp), NULL, _exit);
×
307

308
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "version", td_version), NULL, _exit);
×
309
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "buildInfo", td_buildinfo), NULL, _exit);
×
310
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "gitInfo", td_gitinfo), NULL, _exit);
×
311

312
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "crashSig", signum), NULL, _exit);
×
313
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "crashTs", taosGetTimestampUs()), NULL, _exit);
×
314

315
#if 0
316
#ifdef _TD_DARWIN_64
317
  taosLogTraceToBuf(tmp, sizeof(tmp), 4);
318
#elif !defined(WINDOWS)
319
  taosLogTraceToBuf(tmp, sizeof(tmp), 3);
320
#else
321
  taosLogTraceToBuf(tmp, sizeof(tmp), 8);
322
#endif
323

324
  TAOS_CHECK_GOTO(tjsonAddStringToObject(pJson, "stackInfo", tmp), NULL, _exit);
325
#endif
326
  char* pCont = tjsonToString(pJson);
×
327
  if (pCont == NULL) {
×
328
    code = terrno;
×
329
    TAOS_CHECK_GOTO(code, NULL, _exit);
×
330
    goto _exit;
×
331
  }
332

333
  tjsonDelete(pJson);
×
334
  *pMsg = pCont;
×
335
  pJson = NULL;
×
336
_exit:
×
337
  tjsonDelete(pJson);
×
338
  TAOS_RETURN(code);
×
339
}
340

341
int32_t dumpConfToDataBlock(SSDataBlock* pBlock, int32_t startCol, char* likePattern) {
39,979✔
342
  int32_t  code = 0;
39,979✔
343
  SConfig* pConf = taosGetCfg();
39,979✔
344
  if (pConf == NULL) {
39,979✔
345
    return TSDB_CODE_INVALID_CFG;
×
346
  }
347

348
  int32_t      numOfRows = 0;
39,979✔
349
  int32_t      col = startCol;
39,979✔
350
  SConfigItem* pItem = NULL;
39,979✔
351
  SConfigIter* pIter = NULL;
39,979✔
352

353
  int8_t locked = 0;
39,979✔
354

355
  size_t       exSize = 0;
39,979✔
356
  size_t       index = 0;
39,979✔
357
  SConfigItem* pDataDirItem = cfgGetItem(pConf, "dataDir");
39,979✔
358
  if (pDataDirItem) {
39,979✔
359
    exSize = TMAX(taosArrayGetSize(pDataDirItem->array), 1) - 1;
28,460✔
360
  }
361

362
  TAOS_CHECK_GOTO(blockDataEnsureCapacity(pBlock, cfgGetSize(pConf) + exSize), NULL, _exit);
39,979✔
363

364
  TAOS_CHECK_GOTO(cfgCreateIter(pConf, &pIter), NULL, _exit);
39,979✔
365

366
  cfgLock(pConf);
39,979✔
367
  locked = 1;
39,979✔
368

369
  while ((pItem = cfgNextIter(pIter)) != NULL) {
8,626,036✔
370
  _start:
8,586,057✔
371
    col = startCol;
8,586,057✔
372

373
    // GRANT_CFG_SKIP;
374
    char name[TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE] = {0};
8,586,057✔
375
    if (likePattern && rawStrPatternMatch(pItem->name, likePattern) != TSDB_PATTERN_MATCH) {
8,586,057✔
376
      continue;
169,113✔
377
    }
378
    STR_WITH_MAXSIZE_TO_VARSTR(name, pItem->name, TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE);
8,416,944✔
379

380
    SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
8,416,944✔
381
    if (pColInfo == NULL) {
8,416,944✔
382
      code = terrno;
×
383
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
384
    }
385

386
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, name, false), NULL, _exit);
8,416,944✔
387

388
    char      value[TSDB_CONFIG_PATH_LEN + VARSTR_HEADER_SIZE] = {0};
8,416,944✔
389
    int32_t   valueLen = 0;
8,416,944✔
390
    SDiskCfg* pDiskCfg = NULL;
8,416,944✔
391
    if (strcasecmp(pItem->name, "dataDir") == 0 && exSize > 0) {
8,416,944✔
392
      char* buf = &value[VARSTR_HEADER_SIZE];
×
393
      pDiskCfg = taosArrayGet(pItem->array, index);
×
394
      valueLen = tsnprintf(buf, TSDB_CONFIG_PATH_LEN, "%s", pDiskCfg->dir);
×
395
      index++;
×
396
    } else {
397
      TAOS_CHECK_GOTO(cfgDumpItemValue(pItem, &value[VARSTR_HEADER_SIZE], TSDB_CONFIG_PATH_LEN, &valueLen), NULL,
8,416,944✔
398
                      _exit);
399
    }
400
    varDataSetLen(value, valueLen);
8,416,944✔
401

402
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
8,416,944✔
403
    if (pColInfo == NULL) {
8,416,944✔
404
      code = terrno;
×
405
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
406
    }
407

408
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, value, false), NULL, _exit);
8,416,944✔
409

410
    char scope[TSDB_CONFIG_SCOPE_LEN + VARSTR_HEADER_SIZE] = {0};
8,416,944✔
411
    TAOS_CHECK_GOTO(cfgDumpItemScope(pItem, &scope[VARSTR_HEADER_SIZE], TSDB_CONFIG_SCOPE_LEN, &valueLen), NULL, _exit);
8,416,944✔
412
    varDataSetLen(scope, valueLen);
8,416,944✔
413

414
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
8,416,944✔
415
    if (pColInfo == NULL) {
8,416,944✔
416
      code = terrno;
×
417
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
418
    }
419
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, scope, false), NULL, _exit);
8,416,944✔
420

421
    char category[TSDB_CONFIG_CATEGORY_LEN + VARSTR_HEADER_SIZE] = {0};
8,416,944✔
422
    TAOS_CHECK_GOTO(cfgDumpItemCategory(pItem, &category[VARSTR_HEADER_SIZE], TSDB_CONFIG_CATEGORY_LEN, &valueLen),
8,416,944✔
423
                    NULL, _exit);
424
    varDataSetLen(category, valueLen);
8,416,944✔
425

426
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
8,416,944✔
427
    if (pColInfo == NULL) {
8,416,944✔
428
      code = terrno;
×
429
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
430
    }
431
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, category, false), NULL, _exit);
8,416,944✔
432

433
    char info[TSDB_CONFIG_INFO_LEN + VARSTR_HEADER_SIZE] = {0};
8,416,944✔
434
    if (strcasecmp(pItem->name, "dataDir") == 0 && pDiskCfg) {
8,416,944✔
435
      char* buf = &info[VARSTR_HEADER_SIZE];
×
436
      valueLen = tsnprintf(buf, TSDB_CONFIG_INFO_LEN, "level %d primary %d disabled %" PRIi8, pDiskCfg->level,
×
437
                           pDiskCfg->primary, pDiskCfg->disable);
×
438
    } else {
439
      valueLen = 0;
8,416,944✔
440
    }
441
    varDataSetLen(info, valueLen);
8,416,944✔
442

443
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
8,416,944✔
444
    if (pColInfo == NULL) {
8,416,944✔
445
      code = terrno;
×
446
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
447
    }
448
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, info, false), NULL, _exit);
8,416,944✔
449

450
    numOfRows++;
8,416,944✔
451
    if (index > 0 && index <= exSize) {
8,416,944✔
452
      goto _start;
×
453
    }
454
  }
455
  pBlock->info.rows = numOfRows;
39,979✔
456
_exit:
39,979✔
457
  if (locked) cfgUnLock(pConf);
39,979✔
458
  cfgDestroyIter(pIter);
39,979✔
459
  TAOS_RETURN(code);
39,979✔
460
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc