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

taosdata / TDengine / #4895

23 Dec 2025 01:08PM UTC coverage: 65.513% (-0.2%) from 65.72%
#4895

push

travis-ci

web-flow
fix: mem leak (#34023)

6 of 9 new or added lines in 1 file covered. (66.67%)

7770 existing lines in 123 files now uncovered.

184705 of 281937 relevant lines covered (65.51%)

112009834.14 hits per line

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

65.2
/source/libs/qcom/src/querymsg.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
#include "query.h"
17
#include "queryInt.h"
18
#include "streamMsg.h"
19
#include "systable.h"
20
#include "tmsg.h"
21
#include "trpc.h"
22

23
#pragma GCC diagnostic push
24
#ifdef COMPILER_SUPPORTS_CXX13
25
#pragma GCC diagnostic ignored "-Wformat-truncation"
26
#endif
27

28
int32_t (*queryBuildMsg[TDMT_MAX])(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
29
                                   void *(*mallocFp)(int64_t), void (*freeFp)(void *)) = {0};
30
int32_t (*queryProcessMsgRsp[TDMT_MAX])(void *output, char *msg, int32_t msgSize) = {0};
31

32
int32_t queryBuildUseDbOutput(SUseDbOutput *pOut, SUseDbRsp *usedbRsp) {
26,427,830✔
33
  QUERY_PARAM_CHECK(pOut);
26,427,830✔
34
  QUERY_PARAM_CHECK(usedbRsp);
26,427,830✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
26,427,830✔
36
  pOut->dbId = usedbRsp->uid;
26,428,238✔
37

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
26,427,931✔
39
  if (NULL == pOut->dbVgroup) {
26,428,238✔
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
26,428,238✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
26,428,238✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
26,428,238✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
26,428,238✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
26,427,523✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
26,428,238✔
49

50
  qDebug("db:%s, get %d vgroup, vgVersion:%d, stateTs:%" PRId64, usedbRsp->db, usedbRsp->vgNum, usedbRsp->vgVersion,
26,428,238✔
51
         usedbRsp->stateTs);
52

53
  if (usedbRsp->vgNum <= 0) {
26,428,238✔
54
    return TSDB_CODE_SUCCESS;
4,531,371✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
43,793,734✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
43,601,828✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
21,896,867✔
60
    return terrno;
×
61
  }
62

63
  for (int32_t i = 0; i < usedbRsp->vgNum; ++i) {
76,556,220✔
64
    SVgroupInfo *pVgInfo = taosArrayGet(usedbRsp->pVgroupInfos, i);
54,659,353✔
65
    pOut->dbVgroup->numOfTable += pVgInfo->numOfTable;
54,659,046✔
66
    qDebug("db:%s, vgId:%d, epNum:%d, current ep:%s:%u", usedbRsp->db, pVgInfo->vgId, pVgInfo->epSet.numOfEps,
54,659,046✔
67
           pVgInfo->epSet.eps[pVgInfo->epSet.inUse].fqdn, pVgInfo->epSet.eps[pVgInfo->epSet.inUse].port);
68
    if (0 != taosHashPut(pOut->dbVgroup->vgHash, &pVgInfo->vgId, sizeof(int32_t), pVgInfo, sizeof(SVgroupInfo))) {
54,659,660✔
69
      return terrno;
×
70
    }
71
  }
72

73
  return TSDB_CODE_SUCCESS;
21,896,867✔
74
}
75

76
int32_t queryBuildTableMetaReqMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
52,637,164✔
77
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
78
  QUERY_PARAM_CHECK(input);
52,637,164✔
79
  QUERY_PARAM_CHECK(msg);
52,637,164✔
80
  QUERY_PARAM_CHECK(msgLen);
52,637,164✔
81
  SBuildTableInput *pInput = input;
52,637,164✔
82

83
  STableInfoReq infoReq = {0};
52,637,164✔
84
  infoReq.option = pInput->option;
52,637,390✔
85
  infoReq.header.vgId = pInput->vgId;
52,637,129✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
52,636,643✔
87

88
  if (pInput->dbFName) {
52,637,390✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
52,637,130✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
52,637,650✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
52,637,390✔
94
  void   *pBuf = (*mallcFp)(bufLen);
52,637,052✔
95
  if (NULL == pBuf) {
52,637,377✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
52,637,377✔
99
  if (ret < 0) {
52,637,390✔
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
52,637,390✔
105
  *msgLen = bufLen;
52,637,390✔
106

107
  return TSDB_CODE_SUCCESS;
52,637,164✔
108
}
109

110
int32_t queryBuildUseDbMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
23,703,892✔
111
                           void (*freeFp)(void *)) {
112
  QUERY_PARAM_CHECK(input);
23,703,892✔
113
  QUERY_PARAM_CHECK(msg);
23,703,892✔
114
  QUERY_PARAM_CHECK(msgLen);
23,703,892✔
115
  SBuildUseDBInput *pInput = input;
23,703,892✔
116

117
  SUseDbReq usedbReq = {0};
23,703,892✔
118
  tstrncpy(usedbReq.db, pInput->db, TSDB_DB_FNAME_LEN);
23,703,666✔
119
  usedbReq.db[sizeof(usedbReq.db) - 1] = 0;
23,703,666✔
120
  usedbReq.vgVersion = pInput->vgVersion;
23,703,666✔
121
  usedbReq.dbId = pInput->dbId;
23,704,149✔
122
  usedbReq.numOfTable = pInput->numOfTable;
23,703,666✔
123
  usedbReq.stateTs = pInput->stateTs;
23,703,666✔
124

125
  int32_t bufLen = tSerializeSUseDbReq(NULL, 0, &usedbReq);
23,704,149✔
126
  void   *pBuf = (*mallcFp)(bufLen);
23,704,149✔
127
  if (NULL == pBuf) {
23,704,149✔
128
    return terrno;
×
129
  }
130
  int32_t ret = tSerializeSUseDbReq(pBuf, bufLen, &usedbReq);
23,704,149✔
131
  if (ret < 0) {
23,703,923✔
132
    if (freeFp) (*freeFp)(pBuf);
×
133
    return ret;
×
134
  }
135

136
  *msg = pBuf;
23,703,923✔
137
  *msgLen = bufLen;
23,703,923✔
138

139
  return TSDB_CODE_SUCCESS;
23,704,149✔
140
}
141

142
int32_t queryBuildQnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t), 
158,128✔
143
                               void (*freeFp)(void *)) {
144
  QUERY_PARAM_CHECK(msg);
158,128✔
145
  QUERY_PARAM_CHECK(msgLen);
158,128✔
146

147
  SQnodeListReq qnodeListReq = {0};
158,128✔
148
  qnodeListReq.rowNum = -1;
158,128✔
149

150
  int32_t bufLen = tSerializeSQnodeListReq(NULL, 0, &qnodeListReq);
158,128✔
151
  void   *pBuf = (*mallcFp)(bufLen);
158,128✔
152
  if (NULL == pBuf) {
158,128✔
153
    return terrno;
×
154
  }
155

156
  int32_t ret = tSerializeSQnodeListReq(pBuf, bufLen, &qnodeListReq);
158,128✔
157
  if (ret < 0) {
158,128✔
158
    if (freeFp) (*freeFp)(pBuf);
×
159
    return ret;
×
160
  }
161

162
  *msg = pBuf;
158,128✔
163
  *msgLen = bufLen;
158,128✔
164

165
  return TSDB_CODE_SUCCESS;
158,128✔
166
}
167

168
int32_t queryBuildDnodeListMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
123,346✔
169
                               void (*freeFp)(void *)) {
170
  QUERY_PARAM_CHECK(msg);
123,346✔
171
  QUERY_PARAM_CHECK(msgLen);
123,346✔
172

173
  SDnodeListReq dnodeListReq = {0};
123,346✔
174
  dnodeListReq.rowNum = -1;
123,346✔
175

176
  int32_t bufLen = tSerializeSDnodeListReq(NULL, 0, &dnodeListReq);
123,346✔
177
  void   *pBuf = (*mallcFp)(bufLen);
123,346✔
178
  if (NULL == pBuf) {
123,346✔
179
    return terrno;
×
180
  }
181
  int32_t ret = tSerializeSDnodeListReq(pBuf, bufLen, &dnodeListReq);
123,346✔
182
  if (ret < 0) {
123,346✔
183
    if (freeFp) (*freeFp)(pBuf);
×
184
    return ret;
×
185
  }
186

187
  *msg = pBuf;
123,346✔
188
  *msgLen = bufLen;
123,346✔
189

190
  return TSDB_CODE_SUCCESS;
123,346✔
191
}
192

193
int32_t queryBuildGetSerVerMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
×
194
                               void (*freeFp)(void *)) {
195
  QUERY_PARAM_CHECK(msg);
×
196
  QUERY_PARAM_CHECK(msgLen);
×
197

198
  SServerVerReq req = {0};
×
199

200
  int32_t bufLen = tSerializeSServerVerReq(NULL, 0, &req);
×
201
  void   *pBuf = (*mallcFp)(bufLen);
×
202
  if (NULL == pBuf) {
×
203
    return terrno;
×
204
  }
205
  int32_t ret = tSerializeSServerVerReq(pBuf, bufLen, &req);
×
206
  if (ret < 0) {
×
207
    if (freeFp) (*freeFp)(pBuf);
×
208
    return ret;
×
209
  }
210

211
  *msg = pBuf;
×
212
  *msgLen = bufLen;
×
213

214
  return TSDB_CODE_SUCCESS;
×
215
}
216

217
int32_t queryBuildGetDBCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t), 
1,761,807✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
1,761,807✔
220
  QUERY_PARAM_CHECK(msg);
1,761,807✔
221
  QUERY_PARAM_CHECK(msgLen);
1,761,807✔
222

223
  SDbCfgReq dbCfgReq = {0};
1,761,807✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
1,761,807✔
225

226
  int32_t bufLen = tSerializeSDbCfgReq(NULL, 0, &dbCfgReq);
1,761,807✔
227
  void   *pBuf = (*mallcFp)(bufLen);
1,761,807✔
228
  if (NULL == pBuf) {
1,761,807✔
229
    return terrno;
×
230
  }
231
  int32_t ret = tSerializeSDbCfgReq(pBuf, bufLen, &dbCfgReq);
1,761,807✔
232
  if (ret < 0) {
1,761,807✔
233
    if (freeFp) (*freeFp)(pBuf);
×
234
    return ret;
×
235
  }
236

237
  *msg = pBuf;
1,761,807✔
238
  *msgLen = bufLen;
1,761,807✔
239

240
  return TSDB_CODE_SUCCESS;
1,761,807✔
241
}
242

243
int32_t queryBuildGetIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t), 
×
244
                              void (*freeFp)(void *)) {
245
  QUERY_PARAM_CHECK(input);
×
246
  QUERY_PARAM_CHECK(msg);
×
247
  QUERY_PARAM_CHECK(msgLen);
×
248

249
  SUserIndexReq indexReq = {0};
×
250
  tstrncpy(indexReq.indexFName, input, TSDB_INDEX_FNAME_LEN);
×
251

252
  int32_t bufLen = tSerializeSUserIndexReq(NULL, 0, &indexReq);
×
253
  void   *pBuf = (*mallcFp)(bufLen);
×
254
  if (NULL == pBuf) {
×
255
    return terrno;
×
256
  }
257
  int32_t ret = tSerializeSUserIndexReq(pBuf, bufLen, &indexReq);
×
258
  if (ret < 0) {
×
259
    if (freeFp) (*freeFp)(pBuf);
×
260
    return ret;
×
261
  }
262

263
  *msg = pBuf;
×
264
  *msgLen = bufLen;
×
265

266
  return TSDB_CODE_SUCCESS;
×
267
}
268

269
int32_t queryBuildRetrieveFuncMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
164,708✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
164,708✔
272
  QUERY_PARAM_CHECK(msg);
164,708✔
273
  QUERY_PARAM_CHECK(msgLen);
164,708✔
274

275
  SRetrieveFuncReq funcReq = {0};
164,708✔
276
  funcReq.numOfFuncs = 1;
164,708✔
277
  funcReq.ignoreCodeComment = true;
164,708✔
278
  funcReq.pFuncNames = taosArrayInit(1, strlen(input) + 1);
164,708✔
279
  if (NULL == funcReq.pFuncNames) {
164,708✔
280
    return terrno;
×
281
  }
282
  if (taosArrayPush(funcReq.pFuncNames, input) == NULL) {
329,416✔
283
    taosArrayDestroy(funcReq.pFuncNames);
×
284
    return terrno;
×
285
  }
286

287
  int32_t bufLen = tSerializeSRetrieveFuncReq(NULL, 0, &funcReq);
164,708✔
288
  void   *pBuf = (*mallcFp)(bufLen);
164,708✔
289
  if (NULL == pBuf) {
164,708✔
290
    taosArrayDestroy(funcReq.pFuncNames);
×
291
    return terrno;
×
292
  }
293
  int32_t ret = tSerializeSRetrieveFuncReq(pBuf, bufLen, &funcReq);
164,708✔
294
  if (ret < 0) {
164,708✔
295
    taosArrayDestroy(funcReq.pFuncNames);
×
296
    if (freeFp) (*freeFp)(pBuf);
×
297
    return ret;
×
298
  }
299

300
  taosArrayDestroy(funcReq.pFuncNames);
164,708✔
301

302
  *msg = pBuf;
164,708✔
303
  *msgLen = bufLen;
164,708✔
304

305
  return TSDB_CODE_SUCCESS;
164,708✔
306
}
307

308
int32_t queryBuildGetUserAuthMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
3,494,465✔
309
                                 void (*freeFp)(void *)) {
310
  QUERY_PARAM_CHECK(input);
3,494,465✔
311
  QUERY_PARAM_CHECK(msg);
3,494,465✔
312
  QUERY_PARAM_CHECK(msgLen);
3,494,465✔
313

314
  SGetUserAuthReq req = {0};
3,494,465✔
315
  tstrncpy(req.user, input, TSDB_USER_LEN);
3,494,696✔
316

317
  int32_t bufLen = tSerializeSGetUserAuthReq(NULL, 0, &req);
3,494,696✔
318
  void   *pBuf = (*mallcFp)(bufLen);
3,494,696✔
319
  if (NULL == pBuf) {
3,494,696✔
320
    return terrno;
×
321
  }
322
  int32_t ret = tSerializeSGetUserAuthReq(pBuf, bufLen, &req);
3,494,696✔
323
  if (ret < 0) {
3,494,696✔
324
    if (freeFp) (*freeFp)(pBuf);
×
325
    return ret;
×
326
  }
327

328
  *msg = pBuf;
3,494,696✔
329
  *msgLen = bufLen;
3,494,696✔
330

331
  return TSDB_CODE_SUCCESS;
3,494,696✔
332
}
333

334
int32_t queryBuildGetTbIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
×
335
                                void (*freeFp)(void *)) {
336
  QUERY_PARAM_CHECK(input);
×
337
  QUERY_PARAM_CHECK(msg);
×
338
  QUERY_PARAM_CHECK(msgLen);
×
339

340
  STableIndexReq indexReq = {0};
×
341
  tstrncpy(indexReq.tbFName, input, TSDB_TABLE_FNAME_LEN);
×
342

343
  int32_t bufLen = tSerializeSTableIndexReq(NULL, 0, &indexReq);
×
344
  void   *pBuf = (*mallcFp)(bufLen);
×
345
  if (NULL == pBuf) {
×
346
    return terrno;
×
347
  }
348
  int32_t ret = tSerializeSTableIndexReq(pBuf, bufLen, &indexReq);
×
349
  if (ret < 0) {
×
350
    if (freeFp) (*freeFp)(pBuf);
×
351
    return ret;
×
352
  }
353

354
  *msg = pBuf;
×
355
  *msgLen = bufLen;
×
356

357
  return TSDB_CODE_SUCCESS;
×
358
}
359

360
int32_t queryBuildGetTbCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
127,492✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
127,492✔
363
  QUERY_PARAM_CHECK(msg);
127,492✔
364
  QUERY_PARAM_CHECK(msgLen);
127,492✔
365

366
  SBuildTableInput *pInput = input;
127,492✔
367
  STableCfgReq      cfgReq = {0};
127,492✔
368
  cfgReq.header.vgId = pInput->vgId;
127,492✔
369
  tstrncpy(cfgReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
127,492✔
370
  tstrncpy(cfgReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
127,492✔
371

372
  int32_t bufLen = tSerializeSTableCfgReq(NULL, 0, &cfgReq);
127,492✔
373
  void   *pBuf = (*mallcFp)(bufLen);
127,492✔
374
  if (NULL == pBuf) {
127,492✔
375
    return terrno;
×
376
  }
377
  int32_t ret = tSerializeSTableCfgReq(pBuf, bufLen, &cfgReq);
127,492✔
378
  if (ret < 0) {
127,492✔
379
    if (freeFp) (*freeFp)(pBuf);
×
380
    return ret;
×
381
  }
382

383
  *msg = pBuf;
127,492✔
384
  *msgLen = bufLen;
127,492✔
385

386
  return TSDB_CODE_SUCCESS;
127,492✔
387
}
388

389
int32_t queryBuildGetViewMetaMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
18,926,694✔
390
                                 void (*freeFp)(void *)) {
391
  QUERY_PARAM_CHECK(input);
18,926,694✔
392
  QUERY_PARAM_CHECK(msg);
18,926,694✔
393
  QUERY_PARAM_CHECK(msgLen);
18,926,694✔
394

395
  SViewMetaReq req = {0};
18,926,694✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
18,926,694✔
397

398
  int32_t bufLen = tSerializeSViewMetaReq(NULL, 0, &req);
18,926,694✔
399
  void   *pBuf = (*mallcFp)(bufLen);
18,926,694✔
400
  if (NULL == pBuf) {
18,926,437✔
401
    return terrno;
×
402
  }
403
  int32_t ret = tSerializeSViewMetaReq(pBuf, bufLen, &req);
18,926,437✔
404
  if (ret < 0) {
18,926,694✔
405
    if (freeFp) (*freeFp)(pBuf);
×
406
    return ret;
×
407
  }
408

409
  *msg = pBuf;
18,926,694✔
410
  *msgLen = bufLen;
18,926,694✔
411

412
  return TSDB_CODE_SUCCESS;
18,926,694✔
413
}
414

415
int32_t queryBuildGetTableTSMAMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
219,876✔
416
                                  void (*freeFp)(void *)) {
417
  QUERY_PARAM_CHECK(input);
219,876✔
418
  QUERY_PARAM_CHECK(msg);
219,876✔
419
  QUERY_PARAM_CHECK(msgLen);
219,876✔
420

421
  STableTSMAInfoReq req = {0};
219,876✔
422
  tstrncpy(req.name, input, TSDB_TABLE_FNAME_LEN);
219,876✔
423

424
  int32_t bufLen = tSerializeTableTSMAInfoReq(NULL, 0, &req);
219,876✔
425
  void *  pBuf = (*mallcFp)(bufLen);
219,876✔
426
  if (NULL == pBuf) {
219,876✔
427
    return terrno;
×
428
  }
429
  int32_t ret = tSerializeTableTSMAInfoReq(pBuf, bufLen, &req);
219,876✔
430
  if (ret < 0) {
219,876✔
431
    if (freeFp) (*freeFp)(pBuf);
×
432
    return ret;
×
433
  }
434

435
  *msg = pBuf;
219,876✔
436
  *msgLen = bufLen;
219,876✔
437
  return TSDB_CODE_SUCCESS;
219,876✔
438
}
439

440
int32_t queryBuildGetTSMAMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
×
441
                             void (*freeFp)(void *)) {
442
  QUERY_PARAM_CHECK(input);
×
443
  QUERY_PARAM_CHECK(msg);
×
444
  QUERY_PARAM_CHECK(msgLen);
×
445

446
  STableTSMAInfoReq req = {0};
×
447
  req.fetchingWithTsmaName = true;
×
448
  tstrncpy(req.name, input, TSDB_TABLE_FNAME_LEN);
×
449

450
  int32_t bufLen = tSerializeTableTSMAInfoReq(NULL, 0, &req);
×
451
  void   *pBuf = (*mallcFp)(bufLen);
×
452
  if (pBuf == NULL) {
×
453
    return terrno;
×
454
  }
455
  int32_t ret = tSerializeTableTSMAInfoReq(pBuf, bufLen, &req);
×
456
  if (ret < 0) {
×
457
    if (freeFp) (*freeFp)(pBuf);
×
458
    return ret;
×
459
  }
460

461
  *msg = pBuf;
×
462
  *msgLen = bufLen;
×
463
  return TSDB_CODE_SUCCESS;
×
464
}
465

466
static int32_t queryBuildGetRsmaMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
24,360✔
467
                                    void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
468
  QUERY_PARAM_CHECK(input);
24,360✔
469
  QUERY_PARAM_CHECK(msg);
24,360✔
470
  QUERY_PARAM_CHECK(msgLen);
24,360✔
471

472
  SRsmaInfoReq req = {.withColName = 1};
24,360✔
473
  (void)snprintf(req.name, sizeof(req.name), "%s", (const char *)input);
24,360✔
474

475
  int32_t bufLen = tSerializeRsmaInfoReq(NULL, 0, &req);
24,360✔
476
  void   *pBuf = (*mallcFp)(bufLen);
24,360✔
477
  if (pBuf == NULL) {
24,360✔
478
    return terrno;
×
479
  }
480
  int32_t ret = tSerializeRsmaInfoReq(pBuf, bufLen, &req);
24,360✔
481
  if (ret < 0) {
24,360✔
482
    if (freeFp) (*freeFp)(pBuf);
×
483
    return ret;
×
484
  }
485

486
  *msg = pBuf;
24,360✔
487
  *msgLen = bufLen;
24,360✔
488
  return TSDB_CODE_SUCCESS;
24,360✔
489
}
490

491
int32_t queryBuildGetStreamProgressMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
219,123✔
492
                                       void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
493
  QUERY_PARAM_CHECK(input);
219,123✔
494
  QUERY_PARAM_CHECK(msg);
219,123✔
495
  QUERY_PARAM_CHECK(msgLen);
219,123✔
496

497
  int32_t len = tSerializeStreamProgressReq(NULL, 0, input);
219,123✔
498
  void* pBuf = (*mallcFp)(len);
219,123✔
499
  if (NULL == pBuf) {
219,123✔
500
    return terrno;
×
501
  }
502

503
  int32_t ret = tSerializeStreamProgressReq(pBuf, len, input);
219,123✔
504
  if (ret < 0) {
219,123✔
505
    if (freeFp) (*freeFp)(pBuf);
×
506
    return ret;
×
507
  }
508

509
  *msg = pBuf;
219,123✔
510
  *msgLen = len;
219,123✔
511
  return TSDB_CODE_SUCCESS;
219,123✔
512
}
513

514
int32_t queryBuildVSubTablesMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
×
515
                                void (*freeFp)(void *)) {
516
  QUERY_PARAM_CHECK(input);
×
517
  QUERY_PARAM_CHECK(msg);
×
518
  QUERY_PARAM_CHECK(msgLen);
×
519

520
  SVSubTablesReq req = {0};
×
521
  req.suid = *(int64_t*)input;
×
522

523
  int32_t bufLen = tSerializeSVSubTablesReq(NULL, 0, &req);
×
524
  void   *pBuf = (*mallcFp)(bufLen);
×
525
  if (NULL == pBuf) {
×
526
    return terrno;
×
527
  }
528
  if (tSerializeSVSubTablesReq(pBuf, bufLen, &req) < 0) {
×
529
    if (freeFp) (*freeFp)(pBuf);
×
530
    return TSDB_CODE_TSC_INVALID_INPUT;
×
531
  }
532

533
  *msg = pBuf;
×
534
  *msgLen = bufLen;
×
535

536
  return TSDB_CODE_SUCCESS;
×
537
}
538

539
int32_t queryBuildVStbRefDBsMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
993,199✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
993,199✔
542
  QUERY_PARAM_CHECK(msg);
993,199✔
543
  QUERY_PARAM_CHECK(msgLen);
993,199✔
544

545
  SVStbRefDbsReq req = {0};
993,199✔
546
  req.suid = *(int64_t*)input;
993,199✔
547

548
  int32_t bufLen = tSerializeSVStbRefDbsReq(NULL, 0, &req);
993,199✔
549
  void   *pBuf = (*mallcFp)(bufLen);
993,199✔
550
  if (NULL == pBuf) {
993,199✔
551
    return terrno;
×
552
  }
553
  if (tSerializeSVStbRefDbsReq(pBuf, bufLen, &req) < 0) {
993,199✔
554
    if (freeFp) (*freeFp)(pBuf);
×
555
    return TSDB_CODE_TSC_INVALID_INPUT;
×
556
  }
557

558
  *msg = pBuf;
993,199✔
559
  *msgLen = bufLen;
993,199✔
560

561
  return TSDB_CODE_SUCCESS;
993,199✔
562
}
563

564
int32_t queryProcessUseDBRsp(void *output, char *msg, int32_t msgSize) {
23,540,445✔
565
  SUseDbOutput *pOut = output;
23,540,445✔
566
  SUseDbRsp     usedbRsp = {0};
23,540,445✔
567
  int32_t       code = -1;
23,540,445✔
568

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
23,540,445✔
570
    code = TSDB_CODE_TSC_INVALID_INPUT;
27✔
571
    qError("invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
27✔
572
    goto PROCESS_USEDB_OVER;
×
573
  }
574

575
  if (tDeserializeSUseDbRsp(msg, msgSize, &usedbRsp) != 0) {
23,540,418✔
576
    qError("invalid use db rsp msg, msgSize:%d", msgSize);
×
577
    code = TSDB_CODE_INVALID_MSG;
×
578
    goto PROCESS_USEDB_OVER;
×
579
  }
580

581
  if (usedbRsp.vgNum < 0) {
23,540,445✔
582
    qError("invalid db[%s] vgroup number[%d]", usedbRsp.db, usedbRsp.vgNum);
×
583
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
584
    goto PROCESS_USEDB_OVER;
×
585
  }
586

587
  qTrace("db:%s, usedbRsp received, numOfVgroups:%d", usedbRsp.db, usedbRsp.vgNum);
23,540,445✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
75,211,296✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
51,670,851✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
51,670,851✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
105,847,567✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
54,176,716✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
23,540,445✔
597

598
PROCESS_USEDB_OVER:
23,540,445✔
599

600
  if (code != 0) {
23,540,445✔
601
    if (pOut) {
×
602
      if (pOut->dbVgroup) taosHashCleanup(pOut->dbVgroup->vgHash);
×
603
      taosMemoryFreeClear(pOut->dbVgroup);
×
604
    }
605
    qError("failed to process usedb rsp since %s", terrstr());
×
606
  }
607

608
  tFreeSUsedbRsp(&usedbRsp);
23,540,445✔
609
  return code;
23,540,445✔
610
}
611

612
static int32_t queryConvertTableMetaMsg(STableMetaRsp *pMetaMsg) {
39,181,223✔
613
  QUERY_PARAM_CHECK(pMetaMsg);
39,181,223✔
614
  if (pMetaMsg->numOfTags < 0 || pMetaMsg->numOfTags > TSDB_MAX_TAGS) {
39,181,223✔
UNCOV
615
    qError("invalid numOfTags[%d] in table meta rsp msg", pMetaMsg->numOfTags);
×
616
    return TSDB_CODE_TSC_INVALID_VALUE;
×
617
  }
618

619
  if (pMetaMsg->numOfColumns > TSDB_MAX_COLUMNS || pMetaMsg->numOfColumns <= 0) {
39,181,223✔
620
    qError("invalid numOfColumns[%d] in table meta rsp msg", pMetaMsg->numOfColumns);
×
621
    return TSDB_CODE_TSC_INVALID_VALUE;
×
622
  }
623

624
  if (pMetaMsg->tableType != TSDB_SUPER_TABLE && pMetaMsg->tableType != TSDB_CHILD_TABLE &&
39,181,223✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
5,728,827✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
223,029✔
627
    qError("invalid tableType[%d] in table meta rsp msg", pMetaMsg->tableType);
×
628
    return TSDB_CODE_TSC_INVALID_VALUE;
×
629
  }
630

631
  if (pMetaMsg->sversion < 0) {
39,181,223✔
632
    qError("invalid sversion[%d] in table meta rsp msg", pMetaMsg->sversion);
×
633
    return TSDB_CODE_TSC_INVALID_VALUE;
×
634
  }
635

636
  if (pMetaMsg->tversion < 0) {
39,181,223✔
637
    qError("invalid tversion[%d] in table meta rsp msg", pMetaMsg->tversion);
×
638
    return TSDB_CODE_TSC_INVALID_VALUE;
×
639
  }
640

641
  if (pMetaMsg->rversion < 0) {
39,181,223✔
642
    qError("invalid rversion[%d] in table meta rsp msg", pMetaMsg->rversion);
×
643
    return TSDB_CODE_TSC_INVALID_VALUE;
×
644
  }
645

646
  if (pMetaMsg->pSchemas[0].colId != PRIMARYKEY_TIMESTAMP_COL_ID) {
39,181,223✔
647
    qError("invalid colId[%" PRIi16 "] for the first column in table meta rsp msg", pMetaMsg->pSchemas[0].colId);
×
648
    return TSDB_CODE_TSC_INVALID_VALUE;
×
649
  }
650

651
  return TSDB_CODE_SUCCESS;
39,181,223✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
51,239,891✔
655
  QUERY_PARAM_CHECK(msg);
51,239,891✔
656
  QUERY_PARAM_CHECK(pMeta);
51,239,891✔
657
  pMeta->vgId = msg->vgId;
51,239,891✔
658
  pMeta->tableType = msg->tableType;
51,235,350✔
659
  pMeta->uid = msg->tuid;
51,235,692✔
660
  pMeta->suid = msg->suid;
51,223,940✔
661

662
  qDebug("ctb:%s, uid:0x%" PRIx64 " meta returned, type:%d vgId:%d db:%s suid:%" PRIx64, msg->tbName, pMeta->uid,
51,238,380✔
663
         pMeta->tableType, pMeta->vgId, msg->dbFName, pMeta->suid);
664

665
  return TSDB_CODE_SUCCESS;
51,239,855✔
666
}
667

668
int32_t queryCreateVCTableMetaFromMsg(STableMetaRsp *msg, SVCTableMeta **pMeta) {
390,098✔
669
  QUERY_PARAM_CHECK(msg);
390,098✔
670
  QUERY_PARAM_CHECK(pMeta);
390,098✔
671
  QUERY_PARAM_CHECK(msg->pColRefs);
390,098✔
672

673
  int32_t pColRefSize = sizeof(SColRef) * msg->numOfColRefs;
390,098✔
674

675
  SVCTableMeta *pTableMeta = taosMemoryCalloc(1, sizeof(SVCTableMeta) + pColRefSize);
390,098✔
676
  if (NULL == pTableMeta) {
390,098✔
677
    qError("calloc size[%d] failed", (int32_t)sizeof(SVCTableMeta) + pColRefSize);
×
678
    return terrno;
×
679
  }
680

681
  pTableMeta->vgId = msg->vgId;
390,098✔
682
  pTableMeta->tableType = msg->tableType;
390,098✔
683
  pTableMeta->uid = msg->tuid;
390,098✔
684
  pTableMeta->suid = msg->suid;
390,098✔
685
  pTableMeta->numOfColRefs = msg->numOfColRefs;
390,098✔
686
  pTableMeta->rversion = msg->rversion;
390,098✔
687

688
  pTableMeta->colRef = (SColRef *)((char *)pTableMeta + sizeof(SVCTableMeta));
390,098✔
689
  memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
390,098✔
690

691
  qDebug("ctable %s uid %" PRIx64 " meta returned, type %d vgId:%d db %s suid %" PRIx64, msg->tbName, (pTableMeta)->uid,
390,098✔
692
         (pTableMeta)->tableType, (pTableMeta)->vgId, msg->dbFName, (pTableMeta)->suid);
693

694
  *pMeta = pTableMeta;
390,098✔
695
  return TSDB_CODE_SUCCESS;
390,098✔
696
}
697

698
int32_t queryCreateTableMetaFromMsg(STableMetaRsp *msg, bool isStb, STableMeta **pMeta) {
65,975,852✔
699
  QUERY_PARAM_CHECK(msg);
65,975,852✔
700
  QUERY_PARAM_CHECK(pMeta);
65,975,852✔
701
  int32_t total = msg->numOfColumns + msg->numOfTags;
65,975,852✔
702
  int32_t metaSize = sizeof(STableMeta) + sizeof(SSchema) * total;
65,975,852✔
703
  int32_t schemaExtSize = (withExtSchema(msg->tableType) && msg->pSchemaExt) ? sizeof(SSchemaExt) * msg->numOfColumns : 0;
65,975,852✔
704
  int32_t pColRefSize = (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) ? sizeof(SColRef) * msg->numOfColRefs : 0;
65,975,376✔
705

706
  STableMeta *pTableMeta = taosMemoryCalloc(1, metaSize + schemaExtSize + pColRefSize);
65,975,852✔
707
  if (NULL == pTableMeta) {
65,975,376✔
708
    qError("calloc size[%d] failed", metaSize);
×
709
    return terrno;
×
710
  }
711
  SSchemaExt *pSchemaExt = (SSchemaExt *)((char *)pTableMeta + metaSize);
65,975,376✔
712
  SColRef    *pColRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
65,975,852✔
713

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
65,975,852✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
65,975,852✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
65,975,852✔
717
  pTableMeta->suid = msg->suid;
65,975,376✔
718
  pTableMeta->sversion = msg->sversion;
65,975,852✔
719
  pTableMeta->tversion = msg->tversion;
65,975,852✔
720
  pTableMeta->rversion = msg->rversion;
65,975,852✔
721
  if (msg->virtualStb) {
65,975,852✔
722
    pTableMeta->virtualStb = 1;
352,337✔
723
    pTableMeta->numOfColRefs = 0;
352,337✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
65,623,039✔
726
      pTableMeta->virtualStb = 1;
148,857✔
727
      pTableMeta->numOfColRefs = 0;
148,857✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
65,474,658✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
65,474,658✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
65,975,852✔
735
  pTableMeta->tableInfo.precision = msg->precision;
65,975,376✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
65,975,852✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
65,975,852✔
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
65,975,376✔
740
    pTableMeta->schemaExt = pSchemaExt;
62,998,177✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
62,998,177✔
742
  } else {
743
    pTableMeta->schemaExt = NULL;
2,977,675✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
65,975,852✔
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
491,591✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
491,591✔
749
  } else {
750
    pTableMeta->colRef = NULL;
65,484,261✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
65,975,852✔
754
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
2,147,483,647✔
755
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,147,483,647✔
756
    if (hasPK && (i > 0)) {
2,147,483,647✔
757
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
568,003✔
758
        ++pTableMeta->tableInfo.numOfPKs;
286,029✔
759
      } else {
760
        hasPK = false;
281,974✔
761
      }
762
    }
763
  }
764

765
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
65,975,852✔
766
         " sver:%d tver:%d"
767
         " tagNum:%d colNum:%d precision:%d rowSize:%d",
768
         msg->tbName, pTableMeta->uid, pTableMeta->tableType, pTableMeta->vgId, msg->dbFName, msg->stbName,
769
         pTableMeta->suid, pTableMeta->sversion, pTableMeta->tversion, pTableMeta->tableInfo.numOfTags,
770
         pTableMeta->tableInfo.numOfColumns, pTableMeta->tableInfo.precision, pTableMeta->tableInfo.rowSize);
771

772
  *pMeta = pTableMeta;
65,975,852✔
773
  return TSDB_CODE_SUCCESS;
65,975,852✔
774
}
775

776
int32_t queryCreateTableMetaExFromMsg(STableMetaRsp *msg, bool isStb, STableMeta **pMeta) {
344,690✔
777
  QUERY_PARAM_CHECK(msg);
344,690✔
778
  QUERY_PARAM_CHECK(pMeta);
344,690✔
779
  int32_t total = msg->numOfColumns + msg->numOfTags;
344,690✔
780
  int32_t metaSize = sizeof(STableMeta) + sizeof(SSchema) * total;
344,690✔
781
  int32_t schemaExtSize = (withExtSchema(msg->tableType) && msg->pSchemaExt) ? sizeof(SSchemaExt) * msg->numOfColumns : 0;
344,690✔
782
  int32_t pColRefSize = (hasRefCol(msg->tableType) && msg->pColRefs) ? sizeof(SColRef) * msg->numOfColRefs : 0;
344,690✔
783
  int32_t tbNameSize = strlen(msg->tbName) + 1;
344,690✔
784

785
  STableMeta *pTableMeta = taosMemoryCalloc(1, metaSize + schemaExtSize + pColRefSize + tbNameSize);
344,690✔
786
  if (NULL == pTableMeta) {
344,690✔
787
    qError("calloc size[%d] failed", metaSize);
×
788
    return terrno;
×
789
  }
790
  SSchemaExt *pSchemaExt = (SSchemaExt *)((char *)pTableMeta + metaSize);
344,690✔
791
  SColRef    *pColRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
344,690✔
792

793
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
344,690✔
794
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
344,690✔
795
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
344,690✔
796
  pTableMeta->suid = msg->suid;
344,690✔
797
  pTableMeta->sversion = msg->sversion;
344,690✔
798
  pTableMeta->tversion = msg->tversion;
344,690✔
799
  pTableMeta->rversion = msg->rversion;
344,690✔
800
  pTableMeta->virtualStb = msg->virtualStb;
344,690✔
801
  pTableMeta->numOfColRefs = msg->numOfColRefs;
344,690✔
802

803
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
344,690✔
804
  pTableMeta->tableInfo.precision = msg->precision;
344,690✔
805
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
344,690✔
806

807
  TAOS_MEMCPY(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
344,690✔
808
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
344,690✔
809
    pTableMeta->schemaExt = pSchemaExt;
344,690✔
810
    TAOS_MEMCPY(pSchemaExt, msg->pSchemaExt, schemaExtSize);
344,690✔
811
  } else {
812
    pTableMeta->schemaExt = NULL;
×
813
  }
814

815
  if (hasRefCol(msg->tableType) && msg->pColRefs) {
344,690✔
816
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
×
817
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
×
818
  } else {
819
    pTableMeta->colRef = NULL;
344,690✔
820
  }
821

822
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
344,690✔
823
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
1,134,002✔
824
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
789,312✔
825
    if (hasPK && (i > 0)) {
789,312✔
826
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
×
827
        ++pTableMeta->tableInfo.numOfPKs;
×
828
      } else {
829
        hasPK = false;
×
830
      }
831
    }
832
  }
833

834
  char *pTbName = (char *)pTableMeta + metaSize + schemaExtSize + pColRefSize;
344,690✔
835
  tstrncpy(pTbName, msg->tbName, tbNameSize);
344,690✔
836

837
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
344,690✔
838
         " sver:%d tver:%d"
839
         " tagNum:%d colNum:%d precision:%d rowSize:%d",
840
         msg->tbName, pTableMeta->uid, pTableMeta->tableType, pTableMeta->vgId, msg->dbFName, msg->stbName,
841
         pTableMeta->suid, pTableMeta->sversion, pTableMeta->tversion, pTableMeta->tableInfo.numOfTags,
842
         pTableMeta->tableInfo.numOfColumns, pTableMeta->tableInfo.precision, pTableMeta->tableInfo.rowSize);
843

844
  *pMeta = pTableMeta;
344,690✔
845
  return TSDB_CODE_SUCCESS;
344,690✔
846
}
847

848
int32_t queryProcessTableMetaRsp(void *output, char *msg, int32_t msgSize) {
38,836,533✔
849
  int32_t       code = 0;
38,836,533✔
850
  STableMetaRsp metaRsp = {0};
38,836,533✔
851

852
  if (NULL == output || NULL == msg || msgSize <= 0) {
38,836,533✔
853
    qError("queryProcessTableMetaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
854
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
855
    goto PROCESS_META_OVER;
×
856
  }
857

858
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
38,836,533✔
859
    code = TSDB_CODE_INVALID_MSG;
×
860
    goto PROCESS_META_OVER;
×
861
  }
862

863
  code = queryConvertTableMetaMsg(&metaRsp);
38,836,533✔
864
  if (code != TSDB_CODE_SUCCESS) {
38,836,533✔
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
116,435,427✔
869
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
77,450,037✔
870
                    metaRsp.virtualStb);
38,613,504✔
871
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
38,836,533✔
872
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
36,499,306✔
873
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
874
    goto PROCESS_META_OVER;
×
875
  }
876

877
  STableMetaOutput *pOut = output;
38,836,533✔
878
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
38,836,533✔
879
  pOut->dbId = metaRsp.dbId;
38,836,533✔
880

881
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
38,836,057✔
882
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
13,620,347✔
883

884
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
13,620,347✔
885
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
13,620,823✔
886

887
    pOut->ctbMeta.vgId = metaRsp.vgId;
13,620,347✔
888
    pOut->ctbMeta.tableType = metaRsp.tableType;
13,620,823✔
889
    pOut->ctbMeta.uid = metaRsp.tuid;
13,620,347✔
890
    pOut->ctbMeta.suid = metaRsp.suid;
13,620,823✔
891

892
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
13,620,823✔
893
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
25,215,710✔
894
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
148,857✔
895

896
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
148,857✔
897
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
148,857✔
898

899
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
148,857✔
900
    if (TSDB_CODE_SUCCESS != code) {
148,857✔
901
      goto PROCESS_META_OVER;
×
902
    }
903
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
148,857✔
904
  } else {
905
    SET_META_TYPE_TABLE(pOut->metaType);
25,066,853✔
906
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
25,066,853✔
907
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
25,066,853✔
908
  }
909

910
PROCESS_META_OVER:
38,836,533✔
911
  if (code != 0) {
38,836,533✔
912
    qError("failed to process table meta rsp since %s", tstrerror(code));
×
913
  }
914

915
  tFreeSTableMetaRsp(&metaRsp);
38,836,533✔
916
  return code;
38,836,533✔
917
}
918

919
static int32_t queryProcessTableNameRsp(void *output, char *msg, int32_t msgSize) {
344,690✔
920
  int32_t       code = 0;
344,690✔
921
  STableMetaRsp metaRsp = {0};
344,690✔
922

923
  if (NULL == output || NULL == msg || msgSize <= 0) {
344,690✔
924
    qError("queryProcessTableNameRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
925
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
926
    goto PROCESS_NAME_OVER;
×
927
  }
928

929
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
344,690✔
930
    code = TSDB_CODE_INVALID_MSG;
×
931
    goto PROCESS_NAME_OVER;
×
932
  }
933

934
  code = queryConvertTableMetaMsg(&metaRsp);
344,690✔
935
  if (code != TSDB_CODE_SUCCESS) {
344,690✔
936
    goto PROCESS_NAME_OVER;
×
937
  }
938

939
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
1,034,070✔
940
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
689,380✔
941
                    metaRsp.virtualStb);
344,690✔
942

943
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
344,690✔
944
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
344,690✔
945
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
946
    goto PROCESS_NAME_OVER;
×
947
  }
948

949
  STableMetaOutput *pOut = output;
344,690✔
950
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
344,690✔
951
  pOut->dbId = metaRsp.dbId;
344,690✔
952

953
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
344,690✔
954
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
105,217✔
955

956
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
105,217✔
957
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
105,217✔
958

959
    pOut->ctbMeta.vgId = metaRsp.vgId;
105,217✔
960
    pOut->ctbMeta.tableType = metaRsp.tableType;
105,217✔
961
    pOut->ctbMeta.uid = metaRsp.tuid;
105,217✔
962
    pOut->ctbMeta.suid = metaRsp.suid;
105,217✔
963

964
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
105,217✔
965
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
239,473✔
966
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
967

968
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
×
969
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
×
970

971
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
×
972
    if (TSDB_CODE_SUCCESS != code) {
×
973
      goto PROCESS_NAME_OVER;
×
974
    }
975

976
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
×
977
  } else {
978
    SET_META_TYPE_TABLE(pOut->metaType);
239,473✔
979
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
239,473✔
980
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
239,473✔
981
  }
982

983
PROCESS_NAME_OVER:
344,690✔
984
  if (code != 0) {
344,690✔
985
    qError("failed to process table name rsp since %s", tstrerror(code));
×
986
  }
987

988
  tFreeSTableMetaRsp(&metaRsp);
344,690✔
989
  return code;
344,690✔
990
}
991

992
int32_t queryProcessQnodeListRsp(void *output, char *msg, int32_t msgSize) {
158,128✔
993
  SQnodeListRsp out = {0};
158,128✔
994
  int32_t       code = 0;
158,128✔
995

996
  if (NULL == output || NULL == msg || msgSize <= 0) {
158,128✔
997
    qError("queryProcessQnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
998
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
999
    return code;
×
1000
  }
1001

1002
  out.qnodeList = (SArray *)output;
158,128✔
1003
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
158,128✔
1004
    qError("invalid qnode list rsp msg, msgSize:%d", msgSize);
×
1005
    code = TSDB_CODE_INVALID_MSG;
×
1006
    return code;
×
1007
  }
1008

1009
  return code;
158,128✔
1010
}
1011

1012
int32_t queryProcessDnodeListRsp(void *output, char *msg, int32_t msgSize) {
123,346✔
1013
  SDnodeListRsp out = {0};
123,346✔
1014
  int32_t       code = 0;
123,346✔
1015

1016
  if (NULL == output || NULL == msg || msgSize <= 0) {
123,346✔
1017
    qError("queryProcessDnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1018
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1019
    return code;
×
1020
  }
1021

1022
  if (tDeserializeSDnodeListRsp(msg, msgSize, &out) != 0) {
123,346✔
1023
    qError("invalid dnode list rsp msg, msgSize:%d", msgSize);
×
1024
    code = TSDB_CODE_INVALID_MSG;
×
1025
    return code;
×
1026
  }
1027

1028
  *(SArray **)output = out.dnodeList;
123,346✔
1029

1030
  return code;
123,346✔
1031
}
1032

1033
int32_t queryProcessGetSerVerRsp(void *output, char *msg, int32_t msgSize) {
×
1034
  SServerVerRsp out = {0};
×
1035
  int32_t       code = 0;
×
1036

1037
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1038
    qError("queryProcessGetSerVerRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1039
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1040
    return code;
×
1041
  }
1042

1043
  if (tDeserializeSServerVerRsp(msg, msgSize, &out) != 0) {
×
1044
    qError("invalid svr ver rsp msg, msgSize:%d", msgSize);
×
1045
    code = TSDB_CODE_INVALID_MSG;
×
1046
    return code;
×
1047
  }
1048

1049
  *(char **)output = taosStrdup(out.ver);
×
1050
  if (NULL == *(char **)output) {
×
1051
    return terrno;
×
1052
  }
1053

1054
  return code;
×
1055
}
1056

1057
int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) {
1,461,317✔
1058
  SDbCfgRsp out = {0};
1,461,317✔
1059

1060
  if (NULL == output || NULL == msg || msgSize <= 0) {
1,461,577✔
1061
    qError("queryProcessGetDbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1062
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1063
  }
1064

1065
  if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) {
1,461,577✔
1066
    qError("tDeserializeSDbCfgRsp failed, msgSize:%d, dbCfgRsp:%lu", msgSize, sizeof(out));
×
1067
    return TSDB_CODE_INVALID_MSG;
×
1068
  }
1069

1070
  memcpy(output, &out, sizeof(out));
1,461,577✔
1071

1072
  return TSDB_CODE_SUCCESS;
1,461,577✔
1073
}
1074

1075
int32_t queryProcessGetIndexRsp(void *output, char *msg, int32_t msgSize) {
×
1076
  SUserIndexRsp out = {0};
×
1077

1078
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1079
    qError("queryProcessGetIndexRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1080
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1081
  }
1082

1083
  if (tDeserializeSUserIndexRsp(msg, msgSize, &out) != 0) {
×
1084
    qError("tDeserializeSUserIndexRsp failed, msgSize:%d", msgSize);
×
1085
    return TSDB_CODE_INVALID_MSG;
×
1086
  }
1087

1088
  memcpy(output, &out, sizeof(out));
×
1089

1090
  return TSDB_CODE_SUCCESS;
×
1091
}
1092

1093
int32_t queryProcessRetrieveFuncRsp(void *output, char *msg, int32_t msgSize) {
160,279✔
1094
  SRetrieveFuncRsp out = {0};
160,279✔
1095

1096
  if (NULL == output || NULL == msg || msgSize <= 0) {
160,279✔
1097
    qError("queryProcessRetrieveFuncRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1098
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1099
  }
1100

1101
  if (tDeserializeSRetrieveFuncRsp(msg, msgSize, &out) != 0) {
160,279✔
1102
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1103
    return TSDB_CODE_INVALID_MSG;
×
1104
  }
1105

1106
  if (1 != out.numOfFuncs) {
160,279✔
1107
    qError("invalid func num returned, numOfFuncs:%d", out.numOfFuncs);
×
1108
    return TSDB_CODE_INVALID_MSG;
×
1109
  }
1110

1111
  SFuncInfo *funcInfo = taosArrayGet(out.pFuncInfos, 0);
160,279✔
1112

1113
  memcpy(output, funcInfo, sizeof(*funcInfo));
160,279✔
1114
  taosArrayDestroy(out.pFuncInfos);
160,279✔
1115
  taosArrayDestroy(out.pFuncExtraInfos);
160,279✔
1116

1117
  return TSDB_CODE_SUCCESS;
160,279✔
1118
}
1119

1120
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
3,493,289✔
1121
  if (NULL == output || NULL == msg || msgSize <= 0) {
3,493,289✔
1122
    qError("queryProcessGetUserAuthRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1123
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1124
  }
1125

1126
  if (tDeserializeSGetUserAuthRsp(msg, msgSize, (SGetUserAuthRsp *)output) != 0) {
3,493,289✔
1127
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1128
    return TSDB_CODE_INVALID_MSG;
×
1129
  }
1130

1131
  return TSDB_CODE_SUCCESS;
3,493,289✔
1132
}
1133

1134
int32_t queryProcessGetTbIndexRsp(void *output, char *msg, int32_t msgSize) {
×
1135
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1136
    qError("queryProcessGetTbIndexRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1137
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1138
  }
1139

1140
  STableIndexRsp *out = (STableIndexRsp *)output;
×
1141
  if (tDeserializeSTableIndexRsp(msg, msgSize, out) != 0) {
×
1142
    qError("tDeserializeSTableIndexRsp failed, msgSize:%d", msgSize);
×
1143
    return TSDB_CODE_INVALID_MSG;
×
1144
  }
1145

1146
  return TSDB_CODE_SUCCESS;
×
1147
}
1148

1149
int32_t queryProcessGetTbCfgRsp(void *output, char *msg, int32_t msgSize) {
127,492✔
1150
  if (NULL == output || NULL == msg || msgSize <= 0) {
127,492✔
1151
    qError("queryProcessGetTbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1152
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1153
  }
1154

1155
  STableCfgRsp *out = taosMemoryCalloc(1, sizeof(STableCfgRsp));
127,492✔
1156
  if(out == NULL) {
127,492✔
1157
    return terrno;
×
1158
  }
1159
  if (tDeserializeSTableCfgRsp(msg, msgSize, out) != 0) {
127,492✔
1160
    qError("tDeserializeSTableCfgRsp failed, msgSize:%d", msgSize);
×
1161
    tFreeSTableCfgRsp(out);
×
1162
    taosMemoryFree(out);
×
1163
    return TSDB_CODE_INVALID_MSG;
×
1164
  }
1165

1166
  *(STableCfgRsp **)output = out;
127,492✔
1167

1168
  return TSDB_CODE_SUCCESS;
127,492✔
1169
}
1170

1171
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
158,873✔
1172
  if (NULL == output || NULL == msg || msgSize <= 0) {
158,873✔
1173
    qError("queryProcessGetViewMetaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1174
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1175
  }
1176

1177
  SViewMetaRsp *out = taosMemoryCalloc(1, sizeof(SViewMetaRsp));
158,873✔
1178
  if (out == NULL) {
158,873✔
1179
    return terrno;
×
1180
  }
1181
  if (tDeserializeSViewMetaRsp(msg, msgSize, out) != 0) {
158,873✔
1182
    qError("tDeserializeSViewMetaRsp failed, msgSize:%d", msgSize);
×
1183
    tFreeSViewMetaRsp(out);
×
1184
    taosMemoryFree(out);
×
1185
    return TSDB_CODE_INVALID_MSG;
×
1186
  }
1187

1188
  qDebugL("view meta recved, dbFName:%s, view:%s, querySQL:%s", out->dbFName, out->name, out->querySql);
158,873✔
1189

1190
  *(SViewMetaRsp **)output = out;
158,873✔
1191

1192
  return TSDB_CODE_SUCCESS;
158,873✔
1193
}
1194

1195
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
219,123✔
1196
  if (NULL == output || NULL == msg || msgSize <= 0) {
219,123✔
1197
    qError("queryProcessGetTbTSMARsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1198
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1199
  }
1200

1201
  if (tDeserializeTableTSMAInfoRsp(msg, msgSize, output) != 0) {
219,123✔
1202
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1203
    return TSDB_CODE_INVALID_MSG;
×
1204
  }
1205

1206
  return TSDB_CODE_SUCCESS;
219,123✔
1207
}
1208

1209
static int32_t queryProcessGetRsmaRsp(void* output, char* msg, int32_t msgSize) {
18,676✔
1210
  if (NULL == output || NULL == msg || msgSize <= 0) {
18,676✔
1211
    qError("queryProcessGetRsmaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1212
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1213
  }
1214

1215
  if (tDeserializeRsmaInfoRsp(msg, msgSize, output) != 0) {
18,676✔
1216
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1217
    return TSDB_CODE_INVALID_MSG;
×
1218
  }
1219

1220
  return TSDB_CODE_SUCCESS;
18,676✔
1221
}
1222

1223
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
219,123✔
1224
  if (!output || !msg || msgSize <= 0) {
219,123✔
1225
    qError("queryProcessStreamProgressRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1226
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1227
  }
1228

1229
  if (tDeserializeSStreamProgressRsp(msg, msgSize, output) != 0) {
219,123✔
1230
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1231
    return TSDB_CODE_INVALID_MSG;
×
1232
  }
1233
  return TSDB_CODE_SUCCESS;
219,123✔
1234
}
1235

1236
int32_t queryProcessVSubTablesRsp(void* output, char* msg, int32_t msgSize) {
×
1237
  if (!output || !msg || msgSize <= 0) {
×
1238
    qError("queryProcessVSubTablesRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1239
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1240
  }
1241

1242
  SVSubTablesRsp* pRsp = (SVSubTablesRsp*)output;
×
1243
  int32_t code = tDeserializeSVSubTablesRsp(msg, msgSize, pRsp);
×
1244
  if (code != 0) {
×
1245
    qError("tDeserializeSVSubTablesRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1246
    return code;
×
1247
  }
1248
  
1249
  return TSDB_CODE_SUCCESS;
×
1250
}
1251

1252
int32_t queryProcessVStbRefDbsRsp(void* output, char* msg, int32_t msgSize) {
993,199✔
1253
  if (!output || !msg || msgSize <= 0) {
993,199✔
1254
    qError("queryProcessVStbRefDbsRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1255
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1256
  }
1257

1258
  SVStbRefDbsRsp * pRsp = (SVStbRefDbsRsp*)output;
993,199✔
1259
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
993,199✔
1260
  if (code != 0) {
992,538✔
UNCOV
1261
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1262
    return code;
×
1263
  }
1264

1265
  return TSDB_CODE_SUCCESS;
992,538✔
1266
}
1267

1268
void initQueryModuleMsgHandle() {
1,254,067✔
1269
  queryBuildMsg[TMSG_INDEX(TDMT_VND_TABLE_META)] = queryBuildTableMetaReqMsg;
1,254,067✔
1270
  queryBuildMsg[TMSG_INDEX(TDMT_VND_TABLE_NAME)] = queryBuildTableMetaReqMsg;
1,254,067✔
1271
  queryBuildMsg[TMSG_INDEX(TDMT_MND_TABLE_META)] = queryBuildTableMetaReqMsg;
1,254,067✔
1272
  queryBuildMsg[TMSG_INDEX(TDMT_MND_USE_DB)] = queryBuildUseDbMsg;
1,254,067✔
1273
  queryBuildMsg[TMSG_INDEX(TDMT_MND_QNODE_LIST)] = queryBuildQnodeListMsg;
1,254,067✔
1274
  queryBuildMsg[TMSG_INDEX(TDMT_MND_DNODE_LIST)] = queryBuildDnodeListMsg;
1,254,067✔
1275
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_DB_CFG)] = queryBuildGetDBCfgMsg;
1,254,067✔
1276
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_INDEX)] = queryBuildGetIndexMsg;
1,254,067✔
1277
  queryBuildMsg[TMSG_INDEX(TDMT_MND_RETRIEVE_FUNC)] = queryBuildRetrieveFuncMsg;
1,254,067✔
1278
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_USER_AUTH)] = queryBuildGetUserAuthMsg;
1,254,067✔
1279
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_TABLE_INDEX)] = queryBuildGetTbIndexMsg;
1,254,067✔
1280
  queryBuildMsg[TMSG_INDEX(TDMT_VND_TABLE_CFG)] = queryBuildGetTbCfgMsg;
1,254,067✔
1281
  queryBuildMsg[TMSG_INDEX(TDMT_MND_TABLE_CFG)] = queryBuildGetTbCfgMsg;
1,254,067✔
1282
  queryBuildMsg[TMSG_INDEX(TDMT_MND_SERVER_VERSION)] = queryBuildGetSerVerMsg;
1,254,067✔
1283
  queryBuildMsg[TMSG_INDEX(TDMT_MND_VIEW_META)] = queryBuildGetViewMetaMsg;
1,254,067✔
1284
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_TABLE_TSMA)] = queryBuildGetTableTSMAMsg;
1,254,067✔
1285
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_TSMA)] = queryBuildGetTSMAMsg;
1,254,067✔
1286
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_RSMA)] = queryBuildGetRsmaMsg;
1,254,067✔
1287
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_STREAM_PROGRESS)] = queryBuildGetStreamProgressMsg;
1,254,067✔
1288
  queryBuildMsg[TMSG_INDEX(TDMT_VND_VSUBTABLES_META)] = queryBuildVSubTablesMsg;
1,254,067✔
1289
  queryBuildMsg[TMSG_INDEX(TDMT_VND_VSTB_REF_DBS)] = queryBuildVStbRefDBsMsg;
1,254,067✔
1290

1291
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_TABLE_META)] = queryProcessTableMetaRsp;
1,254,067✔
1292
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_TABLE_NAME)] = queryProcessTableNameRsp;
1,254,067✔
1293
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_TABLE_META)] = queryProcessTableMetaRsp;
1,254,067✔
1294
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_USE_DB)] = queryProcessUseDBRsp;
1,254,067✔
1295
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_QNODE_LIST)] = queryProcessQnodeListRsp;
1,254,067✔
1296
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_DNODE_LIST)] = queryProcessDnodeListRsp;
1,254,067✔
1297
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_DB_CFG)] = queryProcessGetDbCfgRsp;
1,254,067✔
1298
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_INDEX)] = queryProcessGetIndexRsp;
1,254,067✔
1299
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_RETRIEVE_FUNC)] = queryProcessRetrieveFuncRsp;
1,254,067✔
1300
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_USER_AUTH)] = queryProcessGetUserAuthRsp;
1,254,067✔
1301
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_TABLE_INDEX)] = queryProcessGetTbIndexRsp;
1,254,067✔
1302
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_TABLE_CFG)] = queryProcessGetTbCfgRsp;
1,254,067✔
1303
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_TABLE_CFG)] = queryProcessGetTbCfgRsp;
1,254,067✔
1304
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_SERVER_VERSION)] = queryProcessGetSerVerRsp;
1,254,067✔
1305
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_VIEW_META)] = queryProcessGetViewMetaRsp;
1,254,067✔
1306
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_TABLE_TSMA)] = queryProcessGetTbTSMARsp;
1,254,067✔
1307
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_TSMA)] = queryProcessGetTbTSMARsp;
1,254,067✔
1308
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_RSMA)] = queryProcessGetRsmaRsp;
1,254,067✔
1309
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_STREAM_PROGRESS)] = queryProcessStreamProgressRsp;
1,254,067✔
1310
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_VSUBTABLES_META)] = queryProcessVSubTablesRsp;
1,254,067✔
1311
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_VSTB_REF_DBS)] = queryProcessVStbRefDbsRsp;
1,254,067✔
1312
}
1,254,067✔
1313

1314
#pragma GCC diagnostic pop
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