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

taosdata / TDengine / #4909

30 Dec 2025 10:52AM UTC coverage: 65.542% (+0.2%) from 65.386%
#4909

push

travis-ci

web-flow
enh: drop multi-stream (#33962)

60 of 106 new or added lines in 4 files covered. (56.6%)

857 existing lines in 113 files now uncovered.

193924 of 295877 relevant lines covered (65.54%)

120594206.86 hits per line

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

65.4
/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) {
22,758,338✔
33
  QUERY_PARAM_CHECK(pOut);
22,758,338✔
34
  QUERY_PARAM_CHECK(usedbRsp);
22,758,338✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
22,758,338✔
36
  pOut->dbId = usedbRsp->uid;
22,758,344✔
37

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

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
22,758,344✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
22,758,344✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
22,758,344✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
22,758,184✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
22,758,344✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
22,758,344✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
22,758,504✔
54
    return TSDB_CODE_SUCCESS;
3,232,887✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
39,050,908✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
38,916,232✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
19,525,457✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
19,525,457✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
41,546,569✔
84
  infoReq.option = pInput->option;
41,546,627✔
85
  infoReq.header.vgId = pInput->vgId;
41,546,632✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
41,546,713✔
87

88
  if (pInput->dbFName) {
41,546,621✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
41,546,119✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
41,546,592✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
41,546,678✔
94
  void   *pBuf = (*mallcFp)(bufLen);
41,546,752✔
95
  if (NULL == pBuf) {
41,546,694✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
41,546,694✔
99
  if (ret < 0) {
41,546,779✔
100
    if (freeFp) (*freeFp)(pBuf);
54✔
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
41,546,725✔
105
  *msgLen = bufLen;
41,546,679✔
106

107
  return TSDB_CODE_SUCCESS;
41,546,606✔
108
}
109

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

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

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

136
  *msg = pBuf;
20,442,281✔
137
  *msgLen = bufLen;
20,442,281✔
138

139
  return TSDB_CODE_SUCCESS;
20,442,281✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
41,202✔
163
  *msgLen = bufLen;
41,202✔
164

165
  return TSDB_CODE_SUCCESS;
41,202✔
166
}
167

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

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

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

187
  *msg = pBuf;
40,048✔
188
  *msgLen = bufLen;
40,048✔
189

190
  return TSDB_CODE_SUCCESS;
40,048✔
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), 
7,216,745✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
7,216,745✔
220
  QUERY_PARAM_CHECK(msg);
7,216,745✔
221
  QUERY_PARAM_CHECK(msgLen);
7,216,745✔
222

223
  SDbCfgReq dbCfgReq = {0};
7,216,745✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
7,217,285✔
225

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

237
  *msg = pBuf;
7,217,285✔
238
  *msgLen = bufLen;
7,217,285✔
239

240
  return TSDB_CODE_SUCCESS;
7,216,755✔
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,
139,610✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
139,610✔
272
  QUERY_PARAM_CHECK(msg);
139,610✔
273
  QUERY_PARAM_CHECK(msgLen);
139,610✔
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
139,610✔
301

302
  *msg = pBuf;
139,610✔
303
  *msgLen = bufLen;
139,610✔
304

305
  return TSDB_CODE_SUCCESS;
139,610✔
306
}
307

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

314
  SGetUserAuthReq req = {0};
5,631,628✔
315
  tstrncpy(req.user, input, TSDB_USER_LEN);
5,631,628✔
316

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

328
  *msg = pBuf;
5,631,628✔
329
  *msgLen = bufLen;
5,631,628✔
330

331
  return TSDB_CODE_SUCCESS;
5,631,628✔
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),
73,884✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
73,884✔
363
  QUERY_PARAM_CHECK(msg);
73,884✔
364
  QUERY_PARAM_CHECK(msgLen);
73,884✔
365

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

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

383
  *msg = pBuf;
73,884✔
384
  *msgLen = bufLen;
73,884✔
385

386
  return TSDB_CODE_SUCCESS;
73,884✔
387
}
388

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

395
  SViewMetaReq req = {0};
15,511,308✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
15,511,308✔
397

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

409
  *msg = pBuf;
15,511,354✔
410
  *msgLen = bufLen;
15,511,308✔
411

412
  return TSDB_CODE_SUCCESS;
15,511,308✔
413
}
414

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

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

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

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

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

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

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

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

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

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

509
  *msg = pBuf;
199,628✔
510
  *msgLen = len;
199,628✔
511
  return TSDB_CODE_SUCCESS;
199,628✔
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),
3,687,179✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
3,687,179✔
542
  QUERY_PARAM_CHECK(msg);
3,687,179✔
543
  QUERY_PARAM_CHECK(msgLen);
3,687,179✔
544

545
  SVStbRefDbsReq req = {0};
3,687,179✔
546
  req.suid = *(int64_t*)input;
3,687,179✔
547

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

558
  *msg = pBuf;
3,687,179✔
559
  *msgLen = bufLen;
3,687,179✔
560

561
  return TSDB_CODE_SUCCESS;
3,687,179✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
20,335,291✔
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) {
20,336,018✔
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) {
20,336,018✔
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);
20,336,018✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
67,182,402✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
46,846,384✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
46,846,384✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
95,358,504✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
48,512,120✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
20,336,018✔
597

598
PROCESS_USEDB_OVER:
20,336,018✔
599

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

612
static int32_t queryConvertTableMetaMsg(STableMetaRsp *pMetaMsg) {
33,766,659✔
613
  QUERY_PARAM_CHECK(pMetaMsg);
33,766,659✔
614
  if (pMetaMsg->numOfTags < 0 || pMetaMsg->numOfTags > TSDB_MAX_TAGS) {
33,766,659✔
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) {
33,766,664✔
UNCOV
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 &&
33,766,664✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
4,670,858✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
179,061✔
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) {
33,766,664✔
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) {
33,766,664✔
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) {
33,766,314✔
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) {
33,766,314✔
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;
33,766,664✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
46,259,406✔
655
  QUERY_PARAM_CHECK(msg);
46,259,406✔
656
  QUERY_PARAM_CHECK(pMeta);
46,259,406✔
657
  pMeta->vgId = msg->vgId;
46,259,406✔
658
  pMeta->tableType = msg->tableType;
46,258,644✔
659
  pMeta->uid = msg->tuid;
46,258,221✔
660
  pMeta->suid = msg->suid;
46,253,426✔
661

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

665
  return TSDB_CODE_SUCCESS;
46,259,113✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
310,349✔
695
  return TSDB_CODE_SUCCESS;
310,349✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
46,698,166✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
46,698,166✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
46,698,166✔
717
  pTableMeta->suid = msg->suid;
46,698,166✔
718
  pTableMeta->sversion = msg->sversion;
46,698,166✔
719
  pTableMeta->tversion = msg->tversion;
46,698,166✔
720
  pTableMeta->rversion = msg->rversion;
46,698,166✔
721
  pTableMeta->ownerId = msg->ownerId;
46,698,166✔
722
  if (msg->virtualStb) {
46,698,132✔
723
    pTableMeta->virtualStb = 1;
323,893✔
724
    pTableMeta->numOfColRefs = 0;
323,893✔
725
  } else {
726
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
46,374,273✔
727
      pTableMeta->virtualStb = 1;
114,400✔
728
      pTableMeta->numOfColRefs = 0;
114,400✔
729
    } else {
730
      pTableMeta->virtualStb = 0;
46,259,873✔
731
      pTableMeta->numOfColRefs = msg->numOfColRefs;
46,259,839✔
732
    }
733
  }
734

735
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
46,698,166✔
736
  pTableMeta->tableInfo.precision = msg->precision;
46,698,166✔
737
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
46,697,555✔
738

739
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
46,698,166✔
740
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
46,698,166✔
741
    pTableMeta->schemaExt = pSchemaExt;
44,546,493✔
742
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
44,546,493✔
743
  } else {
744
    pTableMeta->schemaExt = NULL;
2,151,673✔
745
  }
746

747
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
46,698,132✔
748
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
432,692✔
749
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
432,692✔
750
  } else {
751
    pTableMeta->colRef = NULL;
46,265,474✔
752
  }
753

754
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
46,698,132✔
755
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
2,147,483,647✔
756
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,147,483,647✔
757
    if (hasPK && (i > 0)) {
2,147,483,647✔
758
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
481,947✔
759
        ++pTableMeta->tableInfo.numOfPKs;
243,335✔
760
      } else {
761
        hasPK = false;
238,612✔
762
      }
763
    }
764
  }
765

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

773
  *pMeta = pTableMeta;
46,698,166✔
774
  return TSDB_CODE_SUCCESS;
46,698,166✔
775
}
776

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

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

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

805
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
155,682✔
806
  pTableMeta->tableInfo.precision = msg->precision;
155,682✔
807
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
155,682✔
808

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

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

824
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
155,682✔
825
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
505,488✔
826
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
349,806✔
827
    if (hasPK && (i > 0)) {
349,806✔
828
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
×
829
        ++pTableMeta->tableInfo.numOfPKs;
×
830
      } else {
831
        hasPK = false;
×
832
      }
833
    }
834
  }
835

836
  char *pTbName = (char *)pTableMeta + metaSize + schemaExtSize + pColRefSize;
155,682✔
837
  tstrncpy(pTbName, msg->tbName, tbNameSize);
155,682✔
838

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

846
  *pMeta = pTableMeta;
155,682✔
847
  return TSDB_CODE_SUCCESS;
155,682✔
848
}
849

850
int32_t queryProcessTableMetaRsp(void *output, char *msg, int32_t msgSize) {
33,610,982✔
851
  int32_t       code = 0;
33,610,982✔
852
  STableMetaRsp metaRsp = {0};
33,610,982✔
853

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

860
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
33,610,982✔
861
    code = TSDB_CODE_INVALID_MSG;
×
862
    goto PROCESS_META_OVER;
×
863
  }
864

865
  code = queryConvertTableMetaMsg(&metaRsp);
33,610,982✔
866
  if (code != TSDB_CODE_SUCCESS) {
33,610,982✔
867
    goto PROCESS_META_OVER;
×
868
  }
869

870
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
100,768,285✔
871
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
67,042,903✔
872
                    metaRsp.virtualStb);
33,431,921✔
873
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
33,610,982✔
874
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
32,006,401✔
875
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
876
    goto PROCESS_META_OVER;
×
877
  }
878

879
  STableMetaOutput *pOut = output;
33,610,982✔
880
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
33,610,982✔
881
  pOut->dbId = metaRsp.dbId;
33,610,982✔
882

883
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
33,610,982✔
884
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
11,594,606✔
885

886
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
11,594,606✔
887
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
11,594,606✔
888

889
    pOut->ctbMeta.vgId = metaRsp.vgId;
11,594,606✔
890
    pOut->ctbMeta.tableType = metaRsp.tableType;
11,594,606✔
891
    pOut->ctbMeta.uid = metaRsp.tuid;
11,594,606✔
892
    pOut->ctbMeta.suid = metaRsp.suid;
11,594,606✔
893

894
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
11,594,606✔
895
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
22,016,376✔
896
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
114,400✔
897

898
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
114,400✔
899
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
114,400✔
900

901
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
114,400✔
902
    if (TSDB_CODE_SUCCESS != code) {
114,400✔
903
      goto PROCESS_META_OVER;
×
904
    }
905
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
114,400✔
906
  } else {
907
    SET_META_TYPE_TABLE(pOut->metaType);
21,901,976✔
908
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
21,901,976✔
909
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
21,901,633✔
910
  }
911

912
PROCESS_META_OVER:
33,610,982✔
913
  if (code != 0) {
33,610,982✔
914
    qError("failed to process table meta rsp since %s", tstrerror(code));
×
915
  }
916

917
  tFreeSTableMetaRsp(&metaRsp);
33,610,982✔
918
  return code;
33,610,982✔
919
}
920

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

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

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

936
  code = queryConvertTableMetaMsg(&metaRsp);
155,682✔
937
  if (code != TSDB_CODE_SUCCESS) {
155,682✔
938
    goto PROCESS_NAME_OVER;
×
939
  }
940

941
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
467,046✔
942
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
311,364✔
943
                    metaRsp.virtualStb);
155,682✔
944

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

951
  STableMetaOutput *pOut = output;
155,682✔
952
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
155,682✔
953
  pOut->dbId = metaRsp.dbId;
155,682✔
954

955
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
155,682✔
956
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
41,832✔
957

958
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
41,832✔
959
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
41,832✔
960

961
    pOut->ctbMeta.vgId = metaRsp.vgId;
41,832✔
962
    pOut->ctbMeta.tableType = metaRsp.tableType;
41,832✔
963
    pOut->ctbMeta.uid = metaRsp.tuid;
41,832✔
964
    pOut->ctbMeta.suid = metaRsp.suid;
41,832✔
965

966
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
41,832✔
967
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
113,850✔
968
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
969

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

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

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

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

990
  tFreeSTableMetaRsp(&metaRsp);
155,682✔
991
  return code;
155,682✔
992
}
993

994
int32_t queryProcessQnodeListRsp(void *output, char *msg, int32_t msgSize) {
41,202✔
995
  SQnodeListRsp out = {0};
41,202✔
996
  int32_t       code = 0;
41,202✔
997

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

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

1011
  return code;
41,202✔
1012
}
1013

1014
int32_t queryProcessDnodeListRsp(void *output, char *msg, int32_t msgSize) {
40,048✔
1015
  SDnodeListRsp out = {0};
40,048✔
1016
  int32_t       code = 0;
40,048✔
1017

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

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

1030
  *(SArray **)output = out.dnodeList;
40,048✔
1031

1032
  return code;
40,048✔
1033
}
1034

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

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

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

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

1056
  return code;
×
1057
}
1058

1059
int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) {
3,683,680✔
1060
  SDbCfgRsp out = {0};
3,683,680✔
1061

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

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

1072
  memcpy(output, &out, sizeof(out));
3,683,680✔
1073

1074
  return TSDB_CODE_SUCCESS;
3,683,680✔
1075
}
1076

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

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

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

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

1092
  return TSDB_CODE_SUCCESS;
×
1093
}
1094

1095
int32_t queryProcessRetrieveFuncRsp(void *output, char *msg, int32_t msgSize) {
134,946✔
1096
  SRetrieveFuncRsp out = {0};
134,946✔
1097

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

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

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

1113
  SFuncInfo *funcInfo = taosArrayGet(out.pFuncInfos, 0);
134,946✔
1114

1115
  memcpy(output, funcInfo, sizeof(*funcInfo));
134,946✔
1116
  taosArrayDestroy(out.pFuncInfos);
134,946✔
1117
  taosArrayDestroy(out.pFuncExtraInfos);
134,946✔
1118

1119
  return TSDB_CODE_SUCCESS;
134,946✔
1120
}
1121

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

1128
  if (tDeserializeSGetUserAuthRsp(msg, msgSize, (SGetUserAuthRsp *)output) != 0) {
5,631,628✔
1129
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
16✔
1130
    return TSDB_CODE_INVALID_MSG;
×
1131
  }
1132

1133
  return TSDB_CODE_SUCCESS;
5,631,612✔
1134
}
1135

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

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

1148
  return TSDB_CODE_SUCCESS;
×
1149
}
1150

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

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

1168
  *(STableCfgRsp **)output = out;
73,884✔
1169

1170
  return TSDB_CODE_SUCCESS;
73,884✔
1171
}
1172

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

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

1190
  qDebugL("view meta recved, dbFName:%s, view:%s, querySQL:%s", out->dbFName, out->name, out->querySql);
4,948✔
1191

1192
  *(SViewMetaRsp **)output = out;
4,948✔
1193

1194
  return TSDB_CODE_SUCCESS;
4,948✔
1195
}
1196

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

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

1208
  return TSDB_CODE_SUCCESS;
199,628✔
1209
}
1210

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

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

1222
  return TSDB_CODE_SUCCESS;
16,721✔
1223
}
1224

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

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

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

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

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

1260
  SVStbRefDbsRsp * pRsp = (SVStbRefDbsRsp*)output;
3,687,179✔
1261
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
3,687,179✔
1262
  if (code != 0) {
3,687,179✔
1263
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
563✔
1264
    return code;
×
1265
  }
1266

1267
  return TSDB_CODE_SUCCESS;
3,686,616✔
1268
}
1269

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

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

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