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

taosdata / TDengine / #5033

24 Apr 2026 11:25AM UTC coverage: 73.058% (-0.02%) from 73.076%
#5033

push

travis-ci

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

merge: from main to 3.0 branch[manual-only]

1337 of 1975 new or added lines in 48 files covered. (67.7%)

14198 existing lines in 150 files now uncovered.

275895 of 377640 relevant lines covered (73.06%)

132323361.15 hits per line

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

73.88
/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) {
113,971,171✔
24
  pEp->port = 0;
113,971,171✔
25
  memset(pEp->fqdn, 0, TSDB_FQDN_LEN);
113,972,745✔
26
  tstrncpy(pEp->fqdn, ep, TSDB_FQDN_LEN);
113,972,001✔
27

28
  char* temp = strrchr(pEp->fqdn, ':');
113,972,143✔
29
  if (temp) {
113,970,511✔
30
    *temp = 0;
13,333,811✔
31
    pEp->port = taosStr2UInt16(temp + 1, NULL, 10);
13,333,074✔
32
    if (pEp->port < 0) {
33
      return TSDB_CODE_INVALID_PARA;
34
    }
35
  }
36

37
  if (pEp->port == 0) {
113,969,272✔
38
    pEp->port = tsServerPort;
100,640,296✔
39
  }
40

41
  if (pEp->port <= 0) {
113,971,599✔
42
    return TSDB_CODE_INVALID_PARA;
×
43
  }
44
  return 0;
113,972,073✔
45
}
46

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

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

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

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

70
    tstrncpy(pEp->fqdn, ep + 1, ipLen + 1);
210✔
71

72
    if (*(end + 1) == ':' && *(end + 2)) {
210✔
73
      pEp->port = taosStr2UInt16(end + 2, NULL, 10);
105✔
74
    }
75
  } else {
76
    // Compatible with ::1:6030, ::1, IPv4:port, hostname:port, etc.
77
    tstrncpy(buf, ep, sizeof(buf));
630✔
78

79
    char* lastColon = strrchr(buf, ':');
630✔
80
    char* firstColon = strchr(buf, ':');
630✔
81

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

108
  if (pEp->port == 0) {
840✔
109
    pEp->port = tsServerPort;
420✔
110
  }
111

112
  if (pEp->port <= 0) {
840✔
113
    return TSDB_CODE_INVALID_PARA;
×
114
  }
115

116
  return 0;
840✔
117
}
118
int32_t taosGetFqdnPortFromEp(const char* ep, SEp* pEp) {
113,972,063✔
119
  if (tsEnableIpv6) {
113,972,063✔
120
    return taosGetDualIpFromEp(ep, pEp);
840✔
121
  } else {
122
    return taosGetIpv4FromEp(ep, pEp);
113,971,223✔
123
  }
124
}
125

126
int32_t addEpIntoEpSet(SEpSet* pEpSet, const char* fqdn, uint16_t port) {
54,884,536✔
127
  if (pEpSet == NULL || fqdn == NULL || strlen(fqdn) == 0) {
54,884,536✔
128
    return TSDB_CODE_INVALID_PARA;
×
129
  }
130

131
  int32_t index = pEpSet->numOfEps;
54,884,536✔
132
  if (index >= sizeof(pEpSet->eps) / sizeof(pEpSet->eps[0])) {
54,884,536✔
133
    return TSDB_CODE_OUT_OF_RANGE;
×
134
  }
135
  tstrncpy(pEpSet->eps[index].fqdn, fqdn, tListLen(pEpSet->eps[index].fqdn));
54,884,536✔
136
  pEpSet->eps[index].port = port;
54,884,536✔
137
  pEpSet->numOfEps += 1;
54,884,536✔
138
  return 0;
54,884,536✔
139
}
140

141
bool isEpsetEqual(const SEpSet* s1, const SEpSet* s2) {
11,691,726✔
142
  if (s1->numOfEps != s2->numOfEps || s1->inUse != s2->inUse) {
11,691,726✔
143
    return false;
1,270,878✔
144
  }
145

146
  for (int32_t i = 0; i < s1->numOfEps; i++) {
22,281,268✔
147
    if (s1->eps[i].port != s2->eps[i].port || strncmp(s1->eps[i].fqdn, s2->eps[i].fqdn, TSDB_FQDN_LEN) != 0)
11,863,459✔
148
      return false;
3,039✔
149
  }
150
  return true;
10,417,809✔
151
}
152

153
void epsetAssign(SEpSet* pDst, const SEpSet* pSrc) {
262,486✔
154
  if (pSrc == NULL || pDst == NULL) {
262,486✔
155
    return;
×
156
  }
157

158
  pDst->inUse = pSrc->inUse;
262,486✔
159
  pDst->numOfEps = pSrc->numOfEps;
262,486✔
160
  for (int32_t i = 0; i < pSrc->numOfEps; ++i) {
1,006,920✔
161
    pDst->eps[i].port = pSrc->eps[i].port;
744,434✔
162
    tstrncpy(pDst->eps[i].fqdn, pSrc->eps[i].fqdn, tListLen(pSrc->eps[i].fqdn));
744,434✔
163
  }
164
}
165

166
void epAssign(SEp* pDst, SEp* pSrc) {
75,140,062✔
167
  if (pSrc == NULL || pDst == NULL) {
75,140,062✔
168
    return;
×
169
  }
170
  memset(pDst->fqdn, 0, tListLen(pSrc->fqdn));
75,140,164✔
171
  tstrncpy(pDst->fqdn, pSrc->fqdn, tListLen(pSrc->fqdn));
75,140,372✔
172
  pDst->port = pSrc->port;
75,141,120✔
173
}
174

175
void epsetSort(SEpSet* pDst) {
90,553,430✔
176
  if (pDst->numOfEps <= 1) {
90,553,430✔
177
    return;
67,991,772✔
178
  }
179
  int validIdx = false;
22,564,621✔
180
  SEp ep = {0};
22,564,621✔
181
  if (pDst->inUse >= 0 && pDst->inUse < pDst->numOfEps) {
22,565,048✔
182
    validIdx = true;
22,564,294✔
183
    epAssign(&ep, &pDst->eps[pDst->inUse]);
22,564,294✔
184
  }
185

186
  for (int i = 0; i < pDst->numOfEps - 1; i++) {
65,139,074✔
187
    for (int j = 0; j < pDst->numOfEps - 1 - i; j++) {
108,371,844✔
188
      SEp* f = &pDst->eps[j];
65,797,290✔
189
      SEp* s = &pDst->eps[j + 1];
65,798,470✔
190
      int  cmp = strncmp(f->fqdn, s->fqdn, sizeof(f->fqdn));
65,798,161✔
191
      if (cmp > 0 || (cmp == 0 && f->port > s->port)) {
65,798,489✔
192
        SEp ep1 = {0};
17,525,472✔
193
        epAssign(&ep1, f);
17,525,368✔
194
        epAssign(f, s);
17,525,368✔
195
        epAssign(s, &ep1);
17,525,368✔
196
      }
197
    }
198
  }
199
  if (validIdx == true)
22,564,858✔
200
    for (int i = 0; i < pDst->numOfEps; i++) {
44,316,836✔
201
      int cmp = strncmp(ep.fqdn, pDst->eps[i].fqdn, sizeof(ep.fqdn));
44,316,210✔
202
      if (cmp == 0 && ep.port == pDst->eps[i].port) {
44,315,575✔
203
        pDst->inUse = i;
22,565,058✔
204
        break;
22,564,748✔
205
      }
206
    }
207
}
208

209
void updateEpSet_s(SCorEpSet* pEpSet, SEpSet* pNewEpSet) {
1,274,333✔
210
  taosCorBeginWrite(&pEpSet->version);
1,274,333✔
211
  pEpSet->epSet = *pNewEpSet;
1,274,333✔
212
  taosCorEndWrite(&pEpSet->version);
1,274,333✔
213
}
1,274,333✔
214

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

221
  return ep;
2,147,483,647✔
222
}
223

224
int32_t epsetToStr(const SEpSet* pEpSet, char* pBuf, int32_t cap) {
1,315,178,079✔
225
  int32_t ret = 0;
1,315,178,079✔
226
  int32_t nwrite = 0;
1,315,178,079✔
227

228
  nwrite = snprintf(pBuf + nwrite, cap, "epset:{");
1,315,178,079✔
229
  if (nwrite <= 0 || nwrite >= cap) {
1,315,250,064✔
230
    return TSDB_CODE_OUT_OF_BUFFER;
47,082✔
231
  }
232
  cap -= nwrite;
1,315,204,410✔
233

234
  for (int _i = 0; (_i < pEpSet->numOfEps) && (cap > 0); _i++) {
2,147,483,647✔
235
    if (_i == pEpSet->numOfEps - 1) {
1,646,616,841✔
236
      ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port);
1,315,185,044✔
237
    } else {
238
      ret = snprintf(pBuf + nwrite, cap, "%d. %s:%d, ", _i, pEpSet->eps[_i].fqdn, pEpSet->eps[_i].port);
331,406,061✔
239
    }
240

241
    if (ret <= 0 || ret >= cap) {
1,646,569,203✔
242
      return TSDB_CODE_OUT_OF_BUFFER;
12,324✔
243
    }
244

245
    nwrite += ret;
1,646,556,879✔
246
    cap -= ret;
1,646,556,879✔
247
  }
248

249
  if (cap <= 0) {
1,315,184,142✔
250
    return TSDB_CODE_OUT_OF_BUFFER;
×
251
  }
252

253
  ret = snprintf(pBuf + nwrite, cap, "}, inUse:%d", pEpSet->inUse);
1,315,184,142✔
254
  if (ret <= 0 || ret >= cap) {
1,315,178,284✔
UNCOV
255
    return TSDB_CODE_OUT_OF_BUFFER;
×
256
  } else {
257
    return TSDB_CODE_SUCCESS;
1,315,193,752✔
258
  }
259
}
260

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

266
  char tmp[4096] = {0};
×
267

268
  TAOS_CHECK_GOTO(tjsonAddDoubleToObject(pJson, "reportVersion", 1), NULL, _exit);
×
269

270
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "clusterId", clusterId), NULL, _exit);
×
271
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "startTime", startTime), NULL, _exit);
×
272

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

278
  TAOS_CHECK_GOTO(tjsonAddIntegerToObject(pJson, "pid", taosGetPId()), NULL, _exit);
×
279

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

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

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

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

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

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

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

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

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

339
int32_t dumpConfToDataBlock(SSDataBlock* pBlock, int32_t startCol, char* likePattern) {
45,728✔
340
  int32_t  code = 0;
45,728✔
341
  SConfig* pConf = taosGetCfg();
45,728✔
342
  if (pConf == NULL) {
45,728✔
343
    return TSDB_CODE_INVALID_CFG;
×
344
  }
345

346
  int32_t      numOfRows = 0;
45,728✔
347
  int32_t      col = startCol;
45,728✔
348
  SConfigItem* pItem = NULL;
45,728✔
349
  SConfigIter* pIter = NULL;
45,728✔
350

351
  int8_t locked = 0;
45,728✔
352

353
  size_t       exSize = 0;
45,728✔
354
  size_t       index = 0;
45,728✔
355
  SConfigItem* pDataDirItem = cfgGetItem(pConf, "dataDir");
45,728✔
356
  if (pDataDirItem) {
45,728✔
357
    exSize = TMAX(taosArrayGetSize(pDataDirItem->array), 1) - 1;
29,847✔
358
  }
359

360
  TAOS_CHECK_GOTO(blockDataEnsureCapacity(pBlock, cfgGetSize(pConf) + exSize), NULL, _exit);
45,728✔
361

362
  TAOS_CHECK_GOTO(cfgCreateIter(pConf, &pIter), NULL, _exit);
45,728✔
363

364
  cfgLock(pConf);
45,728✔
365
  locked = 1;
45,728✔
366

367
  while ((pItem = cfgNextIter(pIter)) != NULL) {
10,034,240✔
368
  _start:
9,988,512✔
369
    col = startCol;
9,988,512✔
370

371
    // GRANT_CFG_SKIP;
372
    char name[TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE] = {0};
9,988,512✔
373
    if (likePattern && rawStrPatternMatch(pItem->name, likePattern) != TSDB_PATTERN_MATCH) {
9,988,512✔
374
      continue;
348,443✔
375
    }
376
    STR_WITH_MAXSIZE_TO_VARSTR(name, pItem->name, TSDB_CONFIG_OPTION_LEN + VARSTR_HEADER_SIZE);
9,640,069✔
377

378
    SColumnInfoData* pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
9,640,069✔
379
    if (pColInfo == NULL) {
9,640,069✔
380
      code = terrno;
×
381
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
382
    }
383

384
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, name, false), NULL, _exit);
9,640,069✔
385

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

400
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
9,640,069✔
401
    if (pColInfo == NULL) {
9,640,069✔
402
      code = terrno;
×
403
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
404
    }
405

406
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, value, false), NULL, _exit);
9,640,069✔
407

408
    char scope[TSDB_CONFIG_SCOPE_LEN + VARSTR_HEADER_SIZE] = {0};
9,640,069✔
409
    TAOS_CHECK_GOTO(cfgDumpItemScope(pItem, &scope[VARSTR_HEADER_SIZE], TSDB_CONFIG_SCOPE_LEN, &valueLen), NULL, _exit);
9,640,069✔
410
    varDataSetLen(scope, valueLen);
9,640,069✔
411

412
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
9,640,069✔
413
    if (pColInfo == NULL) {
9,640,069✔
414
      code = terrno;
×
415
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
416
    }
417
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, scope, false), NULL, _exit);
9,640,069✔
418

419
    char category[TSDB_CONFIG_CATEGORY_LEN + VARSTR_HEADER_SIZE] = {0};
9,640,069✔
420
    TAOS_CHECK_GOTO(cfgDumpItemCategory(pItem, &category[VARSTR_HEADER_SIZE], TSDB_CONFIG_CATEGORY_LEN, &valueLen),
9,640,069✔
421
                    NULL, _exit);
422
    varDataSetLen(category, valueLen);
9,640,069✔
423

424
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
9,640,069✔
425
    if (pColInfo == NULL) {
9,640,069✔
426
      code = terrno;
×
427
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
428
    }
429
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, category, false), NULL, _exit);
9,640,069✔
430

431
    char info[TSDB_CONFIG_INFO_LEN + VARSTR_HEADER_SIZE] = {0};
9,640,069✔
432
    if (strcasecmp(pItem->name, "dataDir") == 0 && pDiskCfg) {
9,640,069✔
433
      char* buf = &info[VARSTR_HEADER_SIZE];
×
434
      valueLen = snprintf(buf, TSDB_CONFIG_INFO_LEN, "level %d primary %d disabled %" PRIi8, pDiskCfg->level,
×
435
                          pDiskCfg->primary, pDiskCfg->disable);
×
436
    } else {
437
      valueLen = 0;
9,640,069✔
438
    }
439
    varDataSetLen(info, valueLen);
9,640,069✔
440

441
    pColInfo = taosArrayGet(pBlock->pDataBlock, col++);
9,640,069✔
442
    if (pColInfo == NULL) {
9,640,069✔
443
      code = terrno;
×
444
      TAOS_CHECK_GOTO(code, NULL, _exit);
×
445
    }
446
    TAOS_CHECK_GOTO(colDataSetVal(pColInfo, numOfRows, info, false), NULL, _exit);
9,640,069✔
447

448
    numOfRows++;
9,640,069✔
449
    if (index > 0 && index <= exSize) {
9,640,069✔
450
      goto _start;
×
451
    }
452
  }
453
  pBlock->info.rows = numOfRows;
45,728✔
454
_exit:
45,728✔
455
  if (locked) cfgUnLock(pConf);
45,728✔
456
  cfgDestroyIter(pIter);
45,728✔
457
  TAOS_RETURN(code);
45,728✔
458
}
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