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

taosdata / TDengine / #4968

09 Feb 2026 01:16AM UTC coverage: 66.902% (+0.04%) from 66.86%
#4968

push

travis-ci

web-flow
docs: add support for recording STMT to CSV files (#34276)

* docs: add support for recording STMT to CSV files

* docs: update version for STMT recording feature in CSV files

205856 of 307696 relevant lines covered (66.9%)

127137355.42 hits per line

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

61.42
/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) {
28,472,205✔
33
  QUERY_PARAM_CHECK(pOut);
28,472,205✔
34
  QUERY_PARAM_CHECK(usedbRsp);
28,472,205✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
28,472,205✔
36
  pOut->dbId = usedbRsp->uid;
28,472,167✔
37

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
28,472,205✔
39
  if (NULL == pOut->dbVgroup) {
28,472,205✔
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
28,472,205✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
28,472,205✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
28,472,205✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
28,472,212✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
28,472,122✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
28,472,162✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
28,472,212✔
54
    return TSDB_CODE_SUCCESS;
3,250,169✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
50,444,067✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
49,519,418✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
25,222,036✔
60
    return terrno;
×
61
  }
62

63
  for (int32_t i = 0; i < usedbRsp->vgNum; ++i) {
87,833,973✔
64
    SVgroupInfo *pVgInfo = taosArrayGet(usedbRsp->pVgroupInfos, i);
62,611,937✔
65
    pOut->dbVgroup->numOfTable += pVgInfo->numOfTable;
62,611,795✔
66
    qDebug("db:%s, vgId:%d, epNum:%d, current ep:%s:%u", usedbRsp->db, pVgInfo->vgId, pVgInfo->epSet.numOfEps,
62,611,839✔
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))) {
62,611,839✔
69
      return terrno;
×
70
    }
71
  }
72

73
  return TSDB_CODE_SUCCESS;
25,222,036✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
47,159,592✔
84
  infoReq.option = pInput->option;
47,159,699✔
85
  infoReq.header.vgId = pInput->vgId;
47,159,593✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
47,159,626✔
87

88
  if (pInput->dbFName) {
47,159,523✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
47,159,552✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
47,159,691✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
47,159,761✔
94
  void   *pBuf = (*mallcFp)(bufLen);
47,159,435✔
95
  if (NULL == pBuf) {
47,159,748✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
47,159,748✔
99
  if (ret < 0) {
47,159,625✔
100
    if (freeFp) (*freeFp)(pBuf);
13✔
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
47,159,612✔
105
  *msgLen = bufLen;
47,159,612✔
106

107
  return TSDB_CODE_SUCCESS;
47,159,680✔
108
}
109

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

117
  SUseDbReq usedbReq = {0};
24,078,399✔
118
  tstrncpy(usedbReq.db, pInput->db, TSDB_DB_FNAME_LEN);
24,078,399✔
119
  usedbReq.db[sizeof(usedbReq.db) - 1] = 0;
24,078,399✔
120
  usedbReq.vgVersion = pInput->vgVersion;
24,078,399✔
121
  usedbReq.dbId = pInput->dbId;
24,078,399✔
122
  usedbReq.numOfTable = pInput->numOfTable;
24,078,399✔
123
  usedbReq.stateTs = pInput->stateTs;
24,078,399✔
124

125
  int32_t bufLen = tSerializeSUseDbReq(NULL, 0, &usedbReq);
24,078,399✔
126
  void   *pBuf = (*mallcFp)(bufLen);
24,078,363✔
127
  if (NULL == pBuf) {
24,077,615✔
128
    return terrno;
×
129
  }
130
  int32_t ret = tSerializeSUseDbReq(pBuf, bufLen, &usedbReq);
24,077,615✔
131
  if (ret < 0) {
24,078,399✔
132
    if (freeFp) (*freeFp)(pBuf);
×
133
    return ret;
×
134
  }
135

136
  *msg = pBuf;
24,078,399✔
137
  *msgLen = bufLen;
24,078,399✔
138

139
  return TSDB_CODE_SUCCESS;
24,077,651✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
48,170✔
163
  *msgLen = bufLen;
48,170✔
164

165
  return TSDB_CODE_SUCCESS;
48,170✔
166
}
167

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

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

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

187
  *msg = pBuf;
42,642✔
188
  *msgLen = bufLen;
42,642✔
189

190
  return TSDB_CODE_SUCCESS;
42,642✔
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), 
5,127,923✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
5,127,923✔
220
  QUERY_PARAM_CHECK(msg);
5,127,923✔
221
  QUERY_PARAM_CHECK(msgLen);
5,127,923✔
222

223
  SDbCfgReq dbCfgReq = {0};
5,127,923✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
5,127,976✔
225

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

237
  *msg = pBuf;
5,127,940✔
238
  *msgLen = bufLen;
5,127,940✔
239

240
  return TSDB_CODE_SUCCESS;
5,127,940✔
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,
293,054✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
293,054✔
272
  QUERY_PARAM_CHECK(msg);
293,054✔
273
  QUERY_PARAM_CHECK(msgLen);
293,054✔
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
293,054✔
301

302
  *msg = pBuf;
293,054✔
303
  *msgLen = bufLen;
293,054✔
304

305
  return TSDB_CODE_SUCCESS;
293,054✔
306
}
307

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

314
  SGetUserAuthReq req = {0};
6,586,217✔
315
  tstrncpy(req.user, input, TSDB_USER_LEN);
6,586,262✔
316

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

328
  *msg = pBuf;
6,586,270✔
329
  *msgLen = bufLen;
6,586,270✔
330

331
  return TSDB_CODE_SUCCESS;
6,586,270✔
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),
88,163✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
88,163✔
363
  QUERY_PARAM_CHECK(msg);
88,163✔
364
  QUERY_PARAM_CHECK(msgLen);
88,163✔
365

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

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

383
  *msg = pBuf;
88,163✔
384
  *msgLen = bufLen;
88,163✔
385

386
  return TSDB_CODE_SUCCESS;
88,163✔
387
}
388

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

395
  SViewMetaReq req = {0};
17,761,910✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
17,761,869✔
397

398
  int32_t bufLen = tSerializeSViewMetaReq(NULL, 0, &req);
17,761,869✔
399
  void   *pBuf = (*mallcFp)(bufLen);
17,761,912✔
400
  if (NULL == pBuf) {
17,761,963✔
401
    return terrno;
×
402
  }
403
  int32_t ret = tSerializeSViewMetaReq(pBuf, bufLen, &req);
17,761,963✔
404
  if (ret < 0) {
17,761,950✔
405
    if (freeFp) (*freeFp)(pBuf);
×
406
    return ret;
×
407
  }
408

409
  *msg = pBuf;
17,761,950✔
410
  *msgLen = bufLen;
17,761,950✔
411

412
  return TSDB_CODE_SUCCESS;
17,761,963✔
413
}
414

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

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

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

435
  *msg = pBuf;
×
436
  *msgLen = bufLen;
×
437
  return TSDB_CODE_SUCCESS;
×
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,
22,440✔
467
                                    void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
468
  QUERY_PARAM_CHECK(input);
22,440✔
469
  QUERY_PARAM_CHECK(msg);
22,440✔
470
  QUERY_PARAM_CHECK(msgLen);
22,440✔
471

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

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

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

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

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

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

509
  *msg = pBuf;
×
510
  *msgLen = len;
×
511
  return TSDB_CODE_SUCCESS;
×
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),
5,353,319✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
5,353,319✔
542
  QUERY_PARAM_CHECK(msg);
5,353,319✔
543
  QUERY_PARAM_CHECK(msgLen);
5,353,319✔
544

545
  SVStbRefDbsReq req = {0};
5,353,319✔
546
  req.suid = *(int64_t*)input;
5,353,319✔
547

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

558
  *msg = pBuf;
5,353,319✔
559
  *msgLen = bufLen;
5,353,319✔
560

561
  return TSDB_CODE_SUCCESS;
5,353,319✔
562
}
563

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

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

575
  if (tDeserializeSUseDbRsp(msg, msgSize, &usedbRsp) != 0) {
23,963,661✔
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,963,661✔
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,963,661✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
79,581,334✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
55,617,711✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
55,617,711✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
113,284,072✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
57,666,399✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
23,963,623✔
597

598
PROCESS_USEDB_OVER:
23,963,661✔
599

600
  if (code != 0) {
23,963,661✔
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,963,661✔
609
  return code;
23,963,661✔
610
}
611

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

619
  if (pMetaMsg->numOfColumns > TSDB_MAX_COLUMNS || pMetaMsg->numOfColumns <= 0) {
37,496,864✔
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 &&
37,496,236✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
6,175,373✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
297,227✔
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) {
37,496,864✔
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) {
37,497,496✔
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) {
37,497,449✔
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) {
37,497,449✔
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;
37,497,500✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
52,625,452✔
655
  QUERY_PARAM_CHECK(msg);
52,625,452✔
656
  QUERY_PARAM_CHECK(pMeta);
52,625,452✔
657
  pMeta->vgId = msg->vgId;
52,625,452✔
658
  pMeta->tableType = msg->tableType;
52,611,980✔
659
  pMeta->uid = msg->tuid;
52,605,346✔
660
  pMeta->suid = msg->suid;
52,621,118✔
661

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

665
  return TSDB_CODE_SUCCESS;
52,624,445✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
405,807✔
695
  return TSDB_CODE_SUCCESS;
405,807✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
54,077,222✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
54,077,222✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
54,077,222✔
717
  pTableMeta->suid = msg->suid;
54,076,823✔
718
  pTableMeta->sversion = msg->sversion;
54,076,590✔
719
  pTableMeta->tversion = msg->tversion;
54,076,590✔
720
  pTableMeta->rversion = msg->rversion;
54,077,222✔
721
  pTableMeta->ownerId = msg->ownerId;
54,077,222✔
722
  pTableMeta->flag = msg->flag;
54,076,590✔
723
  if (msg->virtualStb) {
54,077,222✔
724
    pTableMeta->virtualStb = 1;
433,543✔
725
    pTableMeta->numOfColRefs = 0;
433,543✔
726
  } else {
727
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
53,643,679✔
728
      pTableMeta->virtualStb = 1;
179,302✔
729
      pTableMeta->numOfColRefs = 0;
179,302✔
730
    } else {
731
      pTableMeta->virtualStb = 0;
53,464,377✔
732
      pTableMeta->numOfColRefs = msg->numOfColRefs;
53,464,377✔
733
    }
734
  }
735

736
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
54,077,222✔
737
  pTableMeta->tableInfo.precision = msg->precision;
54,077,222✔
738
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
54,077,222✔
739

740
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
54,077,222✔
741
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
54,076,590✔
742
    pTableMeta->schemaExt = pSchemaExt;
51,588,922✔
743
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
51,588,922✔
744
  } else {
745
    pTableMeta->schemaExt = NULL;
2,488,313✔
746
  }
747

748
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
54,076,603✔
749
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
516,127✔
750
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
516,127✔
751
  } else {
752
    pTableMeta->colRef = NULL;
53,560,103✔
753
  }
754

755
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
54,076,862✔
756
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
2,147,483,647✔
757
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,147,483,647✔
758
    if (hasPK && (i > 0)) {
2,147,483,647✔
759
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
513,470✔
760
        ++pTableMeta->tableInfo.numOfPKs;
259,849✔
761
      } else {
762
        hasPK = false;
253,621✔
763
      }
764
    }
765
  }
766

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

774
  *pMeta = pTableMeta;
54,077,116✔
775
  return TSDB_CODE_SUCCESS;
54,077,222✔
776
}
777

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

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

795
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
164,925✔
796
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
164,925✔
797
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
164,925✔
798
  pTableMeta->suid = msg->suid;
164,925✔
799
  pTableMeta->sversion = msg->sversion;
164,925✔
800
  pTableMeta->tversion = msg->tversion;
164,925✔
801
  pTableMeta->rversion = msg->rversion;
164,925✔
802
  pTableMeta->virtualStb = msg->virtualStb;
164,925✔
803
  pTableMeta->numOfColRefs = msg->numOfColRefs;
164,925✔
804
  pTableMeta->ownerId = msg->ownerId;
164,925✔
805

806
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
164,925✔
807
  pTableMeta->tableInfo.precision = msg->precision;
164,925✔
808
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
164,925✔
809

810
  TAOS_MEMCPY(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
164,925✔
811
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
164,925✔
812
    pTableMeta->schemaExt = pSchemaExt;
164,925✔
813
    TAOS_MEMCPY(pSchemaExt, msg->pSchemaExt, schemaExtSize);
164,925✔
814
  } else {
815
    pTableMeta->schemaExt = NULL;
×
816
  }
817

818
  if (hasRefCol(msg->tableType) && msg->pColRefs) {
164,925✔
819
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
×
820
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
×
821
  } else {
822
    pTableMeta->colRef = NULL;
164,925✔
823
  }
824

825
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
164,925✔
826
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
534,465✔
827
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
369,540✔
828
    if (hasPK && (i > 0)) {
369,540✔
829
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
×
830
        ++pTableMeta->tableInfo.numOfPKs;
×
831
      } else {
832
        hasPK = false;
×
833
      }
834
    }
835
  }
836

837
  char *pTbName = (char *)pTableMeta + metaSize + schemaExtSize + pColRefSize;
164,925✔
838
  tstrncpy(pTbName, msg->tbName, tbNameSize);
164,925✔
839

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

847
  *pMeta = pTableMeta;
164,925✔
848
  return TSDB_CODE_SUCCESS;
164,925✔
849
}
850

851
int32_t queryProcessTableMetaRsp(void *output, char *msg, int32_t msgSize) {
37,332,488✔
852
  int32_t       code = 0;
37,332,488✔
853
  STableMetaRsp metaRsp = {0};
37,332,488✔
854

855
  if (NULL == output || NULL == msg || msgSize <= 0) {
37,332,492✔
856
    qError("queryProcessTableMetaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
857
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
858
    goto PROCESS_META_OVER;
×
859
  }
860

861
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
37,332,492✔
862
    code = TSDB_CODE_INVALID_MSG;
×
863
    goto PROCESS_META_OVER;
×
864
  }
865

866
  code = queryConvertTableMetaMsg(&metaRsp);
37,332,575✔
867
  if (code != TSDB_CODE_SUCCESS) {
37,332,524✔
868
    goto PROCESS_META_OVER;
×
869
  }
870

871
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
111,879,647✔
872
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
74,367,821✔
873
                    metaRsp.virtualStb);
37,035,297✔
874
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
37,332,524✔
875
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
35,540,285✔
876
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
877
    goto PROCESS_META_OVER;
×
878
  }
879

880
  STableMetaOutput *pOut = output;
37,332,562✔
881
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
37,332,562✔
882
  pOut->dbId = metaRsp.dbId;
37,332,163✔
883

884
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
37,332,562✔
885
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
12,251,755✔
886

887
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
12,251,755✔
888
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
12,251,755✔
889

890
    pOut->ctbMeta.vgId = metaRsp.vgId;
12,251,755✔
891
    pOut->ctbMeta.tableType = metaRsp.tableType;
12,251,755✔
892
    pOut->ctbMeta.uid = metaRsp.tuid;
12,251,755✔
893
    pOut->ctbMeta.suid = metaRsp.suid;
12,251,755✔
894

895
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
12,251,755✔
896
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
25,080,807✔
897
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
179,302✔
898

899
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
179,302✔
900
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
179,302✔
901

902
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
179,302✔
903
    if (TSDB_CODE_SUCCESS != code) {
179,302✔
904
      goto PROCESS_META_OVER;
×
905
    }
906
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
179,302✔
907
  } else {
908
    SET_META_TYPE_TABLE(pOut->metaType);
24,901,505✔
909
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
24,901,505✔
910
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
24,900,873✔
911
  }
912

913
PROCESS_META_OVER:
37,332,562✔
914
  if (code != 0) {
37,332,562✔
915
    qError("failed to process table meta rsp since %s", tstrerror(code));
×
916
  }
917

918
  tFreeSTableMetaRsp(&metaRsp);
37,332,562✔
919
  return code;
37,332,562✔
920
}
921

922
static int32_t queryProcessTableNameRsp(void *output, char *msg, int32_t msgSize) {
164,925✔
923
  int32_t       code = 0;
164,925✔
924
  STableMetaRsp metaRsp = {0};
164,925✔
925

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

932
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
164,925✔
933
    code = TSDB_CODE_INVALID_MSG;
×
934
    goto PROCESS_NAME_OVER;
×
935
  }
936

937
  code = queryConvertTableMetaMsg(&metaRsp);
164,925✔
938
  if (code != TSDB_CODE_SUCCESS) {
164,925✔
939
    goto PROCESS_NAME_OVER;
×
940
  }
941

942
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
494,775✔
943
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
329,850✔
944
                    metaRsp.virtualStb);
164,925✔
945

946
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
164,925✔
947
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
164,925✔
948
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
949
    goto PROCESS_NAME_OVER;
×
950
  }
951

952
  STableMetaOutput *pOut = output;
164,925✔
953
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
164,925✔
954
  pOut->dbId = metaRsp.dbId;
164,925✔
955

956
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
164,925✔
957
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
43,605✔
958

959
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
43,605✔
960
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
43,605✔
961

962
    pOut->ctbMeta.vgId = metaRsp.vgId;
43,605✔
963
    pOut->ctbMeta.tableType = metaRsp.tableType;
43,605✔
964
    pOut->ctbMeta.uid = metaRsp.tuid;
43,605✔
965
    pOut->ctbMeta.suid = metaRsp.suid;
43,605✔
966

967
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
43,605✔
968
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
121,320✔
969
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
970

971
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
×
972
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
×
973

974
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
×
975
    if (TSDB_CODE_SUCCESS != code) {
×
976
      goto PROCESS_NAME_OVER;
×
977
    }
978

979
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
×
980
  } else {
981
    SET_META_TYPE_TABLE(pOut->metaType);
121,320✔
982
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
121,320✔
983
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
121,320✔
984
  }
985

986
PROCESS_NAME_OVER:
164,925✔
987
  if (code != 0) {
164,925✔
988
    qError("failed to process table name rsp since %s", tstrerror(code));
×
989
  }
990

991
  tFreeSTableMetaRsp(&metaRsp);
164,925✔
992
  return code;
164,925✔
993
}
994

995
int32_t queryProcessQnodeListRsp(void *output, char *msg, int32_t msgSize) {
48,170✔
996
  SQnodeListRsp out = {0};
48,170✔
997
  int32_t       code = 0;
48,170✔
998

999
  if (NULL == output || NULL == msg || msgSize <= 0) {
48,170✔
1000
    qError("queryProcessQnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1001
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1002
    return code;
×
1003
  }
1004

1005
  out.qnodeList = (SArray *)output;
48,170✔
1006
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
48,170✔
1007
    qError("invalid qnode list rsp msg, msgSize:%d", msgSize);
×
1008
    code = TSDB_CODE_INVALID_MSG;
×
1009
    return code;
×
1010
  }
1011

1012
  return code;
48,170✔
1013
}
1014

1015
int32_t queryProcessDnodeListRsp(void *output, char *msg, int32_t msgSize) {
42,642✔
1016
  SDnodeListRsp out = {0};
42,642✔
1017
  int32_t       code = 0;
42,642✔
1018

1019
  if (NULL == output || NULL == msg || msgSize <= 0) {
42,642✔
1020
    qError("queryProcessDnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1021
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1022
    return code;
×
1023
  }
1024

1025
  if (tDeserializeSDnodeListRsp(msg, msgSize, &out) != 0) {
42,642✔
1026
    qError("invalid dnode list rsp msg, msgSize:%d", msgSize);
×
1027
    code = TSDB_CODE_INVALID_MSG;
×
1028
    return code;
×
1029
  }
1030

1031
  *(SArray **)output = out.dnodeList;
42,642✔
1032

1033
  return code;
42,642✔
1034
}
1035

1036
int32_t queryProcessGetSerVerRsp(void *output, char *msg, int32_t msgSize) {
×
1037
  SServerVerRsp out = {0};
×
1038
  int32_t       code = 0;
×
1039

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

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

1052
  *(char **)output = taosStrdup(out.ver);
×
1053
  if (NULL == *(char **)output) {
×
1054
    return terrno;
×
1055
  }
1056

1057
  return code;
×
1058
}
1059

1060
int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) {
4,649,780✔
1061
  SDbCfgRsp out = {0};
4,649,780✔
1062

1063
  if (NULL == output || NULL == msg || msgSize <= 0) {
4,649,780✔
1064
    qError("queryProcessGetDbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1065
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1066
  }
1067

1068
  if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) {
4,649,780✔
1069
    qError("tDeserializeSDbCfgRsp failed, msgSize:%d, dbCfgRsp:%lu", msgSize, sizeof(out));
×
1070
    return TSDB_CODE_INVALID_MSG;
×
1071
  }
1072

1073
  memcpy(output, &out, sizeof(out));
4,649,780✔
1074

1075
  return TSDB_CODE_SUCCESS;
4,649,780✔
1076
}
1077

1078
int32_t queryProcessGetIndexRsp(void *output, char *msg, int32_t msgSize) {
×
1079
  SUserIndexRsp out = {0};
×
1080

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

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

1091
  memcpy(output, &out, sizeof(out));
×
1092

1093
  return TSDB_CODE_SUCCESS;
×
1094
}
1095

1096
int32_t queryProcessRetrieveFuncRsp(void *output, char *msg, int32_t msgSize) {
278,328✔
1097
  SRetrieveFuncRsp out = {0};
278,328✔
1098

1099
  if (NULL == output || NULL == msg || msgSize <= 0) {
278,328✔
1100
    qError("queryProcessRetrieveFuncRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1101
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1102
  }
1103

1104
  if (tDeserializeSRetrieveFuncRsp(msg, msgSize, &out) != 0) {
278,328✔
1105
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1106
    return TSDB_CODE_INVALID_MSG;
×
1107
  }
1108

1109
  if (1 != out.numOfFuncs) {
278,328✔
1110
    qError("invalid func num returned, numOfFuncs:%d", out.numOfFuncs);
×
1111
    return TSDB_CODE_INVALID_MSG;
×
1112
  }
1113

1114
  SFuncInfo *funcInfo = taosArrayGet(out.pFuncInfos, 0);
278,328✔
1115

1116
  memcpy(output, funcInfo, sizeof(*funcInfo));
278,328✔
1117
  taosArrayDestroy(out.pFuncInfos);
278,328✔
1118
  taosArrayDestroy(out.pFuncExtraInfos);
278,328✔
1119

1120
  return TSDB_CODE_SUCCESS;
278,328✔
1121
}
1122

1123
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
6,585,148✔
1124
  if (NULL == output || NULL == msg || msgSize <= 0) {
6,585,148✔
1125
    qError("queryProcessGetUserAuthRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1126
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1127
  }
1128

1129
  if (tDeserializeSGetUserAuthRsp(msg, msgSize, (SGetUserAuthRsp *)output) != 0) {
6,585,148✔
1130
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1131
    return TSDB_CODE_INVALID_MSG;
×
1132
  }
1133

1134
  return TSDB_CODE_SUCCESS;
6,585,144✔
1135
}
1136

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

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

1149
  return TSDB_CODE_SUCCESS;
×
1150
}
1151

1152
int32_t queryProcessGetTbCfgRsp(void *output, char *msg, int32_t msgSize) {
88,163✔
1153
  if (NULL == output || NULL == msg || msgSize <= 0) {
88,163✔
1154
    qError("queryProcessGetTbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1155
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1156
  }
1157

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

1169
  *(STableCfgRsp **)output = out;
88,163✔
1170

1171
  return TSDB_CODE_SUCCESS;
88,163✔
1172
}
1173

1174
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
227,683✔
1175
  if (NULL == output || NULL == msg || msgSize <= 0) {
227,683✔
1176
    qError("queryProcessGetViewMetaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1177
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1178
  }
1179

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

1191
  qDebugL("view meta recved, dbFName:%s, view:%s, querySQL:%s", out->dbFName, out->name, out->querySql);
227,683✔
1192

1193
  *(SViewMetaRsp **)output = out;
227,683✔
1194

1195
  return TSDB_CODE_SUCCESS;
227,683✔
1196
}
1197

1198
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
×
1199
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1200
    qError("queryProcessGetTbTSMARsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1201
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1202
  }
1203

1204
  if (tDeserializeTableTSMAInfoRsp(msg, msgSize, output) != 0) {
×
1205
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1206
    return TSDB_CODE_INVALID_MSG;
×
1207
  }
1208

1209
  return TSDB_CODE_SUCCESS;
×
1210
}
1211

1212
static int32_t queryProcessGetRsmaRsp(void* output, char* msg, int32_t msgSize) {
17,204✔
1213
  if (NULL == output || NULL == msg || msgSize <= 0) {
17,204✔
1214
    qError("queryProcessGetRsmaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1215
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1216
  }
1217

1218
  if (tDeserializeRsmaInfoRsp(msg, msgSize, output) != 0) {
17,204✔
1219
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1220
    return TSDB_CODE_INVALID_MSG;
×
1221
  }
1222

1223
  return TSDB_CODE_SUCCESS;
17,204✔
1224
}
1225

1226
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
×
1227
  if (!output || !msg || msgSize <= 0) {
×
1228
    qError("queryProcessStreamProgressRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1229
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1230
  }
1231

1232
  if (tDeserializeSStreamProgressRsp(msg, msgSize, output) != 0) {
×
1233
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1234
    return TSDB_CODE_INVALID_MSG;
×
1235
  }
1236
  return TSDB_CODE_SUCCESS;
×
1237
}
1238

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

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

1255
int32_t queryProcessVStbRefDbsRsp(void* output, char* msg, int32_t msgSize) {
5,352,328✔
1256
  if (!output || !msg || msgSize <= 0) {
5,352,328✔
1257
    qError("queryProcessVStbRefDbsRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1258
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1259
  }
1260

1261
  SVStbRefDbsRsp * pRsp = (SVStbRefDbsRsp*)output;
5,352,737✔
1262
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
5,352,737✔
1263
  if (code != 0) {
5,344,210✔
1264
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
31✔
1265
    return code;
×
1266
  }
1267

1268
  return TSDB_CODE_SUCCESS;
5,344,179✔
1269
}
1270

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

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

1317
#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