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

taosdata / TDengine / #4898

26 Dec 2025 09:58AM UTC coverage: 65.061% (-0.7%) from 65.717%
#4898

push

travis-ci

web-flow
feat: support encryption of configuration files, data files and metadata files (#33801)

350 of 1333 new or added lines in 31 files covered. (26.26%)

2796 existing lines in 159 files now uncovered.

184024 of 282850 relevant lines covered (65.06%)

113940470.33 hits per line

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

65.32
/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,376,513✔
33
  QUERY_PARAM_CHECK(pOut);
22,376,513✔
34
  QUERY_PARAM_CHECK(usedbRsp);
22,376,513✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
22,376,513✔
36
  pOut->dbId = usedbRsp->uid;
22,376,513✔
37

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

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
22,376,523✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
22,376,484✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
22,376,484✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
22,376,527✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
22,376,523✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
22,376,410✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
22,376,509✔
54
    return TSDB_CODE_SUCCESS;
3,218,580✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
38,315,866✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
38,198,713✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
19,157,933✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
19,157,933✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
42,407,357✔
84
  infoReq.option = pInput->option;
42,407,313✔
85
  infoReq.header.vgId = pInput->vgId;
42,407,307✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
42,407,350✔
87

88
  if (pInput->dbFName) {
42,407,319✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
42,407,269✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
42,407,357✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
42,407,357✔
94
  void   *pBuf = (*mallcFp)(bufLen);
42,406,915✔
95
  if (NULL == pBuf) {
42,407,428✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
42,407,428✔
99
  if (ret < 0) {
42,406,773✔
UNCOV
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
42,406,787✔
105
  *msgLen = bufLen;
42,406,787✔
106

107
  return TSDB_CODE_SUCCESS;
42,407,297✔
108
}
109

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

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

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

136
  *msg = pBuf;
20,429,673✔
137
  *msgLen = bufLen;
20,429,673✔
138

139
  return TSDB_CODE_SUCCESS;
20,429,673✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
39,028✔
163
  *msgLen = bufLen;
39,028✔
164

165
  return TSDB_CODE_SUCCESS;
39,028✔
166
}
167

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

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

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

187
  *msg = pBuf;
39,023✔
188
  *msgLen = bufLen;
39,023✔
189

190
  return TSDB_CODE_SUCCESS;
39,023✔
191
}
192

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

198
  SServerVerReq req = {0};
×
199

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

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

214
  return TSDB_CODE_SUCCESS;
×
215
}
216

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

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

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

237
  *msg = pBuf;
1,422,061✔
238
  *msgLen = bufLen;
1,422,061✔
239

240
  return TSDB_CODE_SUCCESS;
1,422,061✔
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,
111,759✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
111,759✔
272
  QUERY_PARAM_CHECK(msg);
111,759✔
273
  QUERY_PARAM_CHECK(msgLen);
111,759✔
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
111,759✔
301

302
  *msg = pBuf;
111,759✔
303
  *msgLen = bufLen;
111,759✔
304

305
  return TSDB_CODE_SUCCESS;
111,759✔
306
}
307

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

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

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

328
  *msg = pBuf;
3,109,927✔
329
  *msgLen = bufLen;
3,109,927✔
330

331
  return TSDB_CODE_SUCCESS;
3,109,927✔
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),
77,049✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
77,049✔
363
  QUERY_PARAM_CHECK(msg);
77,049✔
364
  QUERY_PARAM_CHECK(msgLen);
77,049✔
365

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

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

383
  *msg = pBuf;
77,049✔
384
  *msgLen = bufLen;
77,049✔
385

386
  return TSDB_CODE_SUCCESS;
77,049✔
387
}
388

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

395
  SViewMetaReq req = {0};
16,061,837✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
16,061,831✔
397

398
  int32_t bufLen = tSerializeSViewMetaReq(NULL, 0, &req);
16,061,831✔
399
  void   *pBuf = (*mallcFp)(bufLen);
16,061,863✔
400
  if (NULL == pBuf) {
16,061,881✔
401
    return terrno;
×
402
  }
403
  int32_t ret = tSerializeSViewMetaReq(pBuf, bufLen, &req);
16,061,881✔
404
  if (ret < 0) {
16,061,875✔
405
    if (freeFp) (*freeFp)(pBuf);
×
406
    return ret;
×
407
  }
408

409
  *msg = pBuf;
16,061,875✔
410
  *msgLen = bufLen;
16,061,875✔
411

412
  return TSDB_CODE_SUCCESS;
16,061,838✔
413
}
414

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

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

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

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

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

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

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

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

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

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

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

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

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

558
  *msg = pBuf;
75,613✔
559
  *msgLen = bufLen;
75,613✔
560

561
  return TSDB_CODE_SUCCESS;
75,613✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
20,278,415✔
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,278,415✔
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,279,115✔
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,279,115✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
67,364,190✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
47,085,075✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
47,085,075✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
95,974,365✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
48,889,290✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
20,279,115✔
597

598
PROCESS_USEDB_OVER:
20,279,115✔
599

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

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

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

624
  if (pMetaMsg->tableType != TSDB_SUPER_TABLE && pMetaMsg->tableType != TSDB_CHILD_TABLE &&
33,904,614✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
4,689,384✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
175,818✔
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,904,614✔
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,904,003✔
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,904,614✔
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,904,003✔
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,903,443✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
46,865,652✔
655
  QUERY_PARAM_CHECK(msg);
46,865,652✔
656
  QUERY_PARAM_CHECK(pMeta);
46,865,652✔
657
  pMeta->vgId = msg->vgId;
46,865,652✔
658
  pMeta->tableType = msg->tableType;
46,858,933✔
659
  pMeta->uid = msg->tuid;
46,860,728✔
660
  pMeta->suid = msg->suid;
46,858,135✔
661

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

665
  return TSDB_CODE_SUCCESS;
46,857,595✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
297,726✔
695
  return TSDB_CODE_SUCCESS;
297,726✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
61,749,615✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
61,749,615✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
61,749,615✔
717
  pTableMeta->suid = msg->suid;
61,749,615✔
718
  pTableMeta->sversion = msg->sversion;
61,749,615✔
719
  pTableMeta->tversion = msg->tversion;
61,749,615✔
720
  pTableMeta->rversion = msg->rversion;
61,749,615✔
721
  if (msg->virtualStb) {
61,749,615✔
722
    pTableMeta->virtualStb = 1;
264,153✔
723
    pTableMeta->numOfColRefs = 0;
264,153✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
61,485,462✔
726
      pTableMeta->virtualStb = 1;
123,117✔
727
      pTableMeta->numOfColRefs = 0;
123,117✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
61,362,345✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
61,362,345✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
61,749,615✔
735
  pTableMeta->tableInfo.precision = msg->precision;
61,749,615✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
61,749,615✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
61,749,615✔
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
61,749,615✔
740
    pTableMeta->schemaExt = pSchemaExt;
59,589,412✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
59,589,412✔
742
  } else {
743
    pTableMeta->schemaExt = NULL;
2,160,203✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
61,749,004✔
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
402,522✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
402,522✔
749
  } else {
750
    pTableMeta->colRef = NULL;
61,346,482✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
61,749,615✔
754
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
2,147,483,647✔
755
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,147,483,647✔
756
    if (hasPK && (i > 0)) {
2,147,483,647✔
757
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
496,902✔
758
        ++pTableMeta->tableInfo.numOfPKs;
250,364✔
759
      } else {
760
        hasPK = false;
246,538✔
761
      }
762
    }
763
  }
764

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

772
  *pMeta = pTableMeta;
61,749,601✔
773
  return TSDB_CODE_SUCCESS;
61,749,601✔
774
}
775

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

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

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

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

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

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

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

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

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

844
  *pMeta = pTableMeta;
138,558✔
845
  return TSDB_CODE_SUCCESS;
138,558✔
846
}
847

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

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

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

863
  code = queryConvertTableMetaMsg(&metaRsp);
33,766,070✔
864
  if (code != TSDB_CODE_SUCCESS) {
33,764,885✔
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
101,241,968✔
869
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
67,353,966✔
870
                    metaRsp.virtualStb);
33,589,081✔
871
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
33,764,885✔
872
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
32,130,321✔
873
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
874
    goto PROCESS_META_OVER;
×
875
  }
876

877
  STableMetaOutput *pOut = output;
33,765,510✔
878
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
33,765,510✔
879
  pOut->dbId = metaRsp.dbId;
33,765,504✔
880

881
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
33,766,064✔
882
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
11,644,777✔
883

884
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
11,644,777✔
885
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
11,644,783✔
886

887
    pOut->ctbMeta.vgId = metaRsp.vgId;
11,644,783✔
888
    pOut->ctbMeta.tableType = metaRsp.tableType;
11,644,783✔
889
    pOut->ctbMeta.uid = metaRsp.tuid;
11,644,783✔
890
    pOut->ctbMeta.suid = metaRsp.suid;
11,644,745✔
891

892
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
11,644,777✔
893
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
22,121,287✔
894
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
123,117✔
895

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

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

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

915
  tFreeSTableMetaRsp(&metaRsp);
33,766,056✔
916
  return code;
33,766,070✔
917
}
918

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

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

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

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

939
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
415,674✔
940
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
277,116✔
941
                    metaRsp.virtualStb);
138,558✔
942

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

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

953
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
138,558✔
954
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
39,909✔
955

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

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

964
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
39,909✔
965
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
98,649✔
966
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
967

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

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

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

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

988
  tFreeSTableMetaRsp(&metaRsp);
138,558✔
989
  return code;
138,558✔
990
}
991

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

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

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

1009
  return code;
39,028✔
1010
}
1011

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

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

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

1028
  *(SArray **)output = out.dnodeList;
39,023✔
1029

1030
  return code;
39,023✔
1031
}
1032

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

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

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

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

1054
  return code;
×
1055
}
1056

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

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

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

1070
  memcpy(output, &out, sizeof(out));
1,306,436✔
1071

1072
  return TSDB_CODE_SUCCESS;
1,306,436✔
1073
}
1074

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

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

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

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

1090
  return TSDB_CODE_SUCCESS;
×
1091
}
1092

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

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

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

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

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

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

1117
  return TSDB_CODE_SUCCESS;
105,795✔
1118
}
1119

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

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

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

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

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

1146
  return TSDB_CODE_SUCCESS;
×
1147
}
1148

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

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

1166
  *(STableCfgRsp **)output = out;
77,049✔
1167

1168
  return TSDB_CODE_SUCCESS;
77,049✔
1169
}
1170

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

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

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

1190
  *(SViewMetaRsp **)output = out;
118,262✔
1191

1192
  return TSDB_CODE_SUCCESS;
118,262✔
1193
}
1194

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

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

1206
  return TSDB_CODE_SUCCESS;
187,561✔
1207
}
1208

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

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

1220
  return TSDB_CODE_SUCCESS;
16,353✔
1221
}
1222

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

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

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

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

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

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

1265
  return TSDB_CODE_SUCCESS;
75,613✔
1266
}
1267

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

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

1314
#pragma GCC diagnostic pop
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc