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

taosdata / TDengine / #4914

06 Jan 2026 01:30AM UTC coverage: 64.876% (-0.008%) from 64.884%
#4914

push

travis-ci

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

180 of 319 new or added lines in 14 files covered. (56.43%)

3475 existing lines in 124 files now uncovered.

194993 of 300563 relevant lines covered (64.88%)

116239151.85 hits per line

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

65.28
/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) {
23,491,251✔
33
  QUERY_PARAM_CHECK(pOut);
23,491,251✔
34
  QUERY_PARAM_CHECK(usedbRsp);
23,491,251✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
23,491,251✔
36
  pOut->dbId = usedbRsp->uid;
23,491,251✔
37

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
23,491,592✔
39
  if (NULL == pOut->dbVgroup) {
23,491,622✔
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
23,491,622✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
23,491,549✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
23,491,622✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
23,491,579✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
23,491,535✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
23,491,562✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
23,491,462✔
54
    return TSDB_CODE_SUCCESS;
3,178,949✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
40,625,346✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
40,516,309✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
20,312,673✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
20,312,586✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
42,132,652✔
84
  infoReq.option = pInput->option;
42,131,905✔
85
  infoReq.header.vgId = pInput->vgId;
42,132,642✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
42,131,863✔
87

88
  if (pInput->dbFName) {
42,132,381✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
42,133,110✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
42,131,951✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
42,131,957✔
94
  void   *pBuf = (*mallcFp)(bufLen);
42,133,078✔
95
  if (NULL == pBuf) {
42,133,306✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
42,133,306✔
99
  if (ret < 0) {
42,131,703✔
100
    if (freeFp) (*freeFp)(pBuf);
37✔
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
42,131,666✔
105
  *msgLen = bufLen;
42,131,666✔
106

107
  return TSDB_CODE_SUCCESS;
42,133,119✔
108
}
109

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

117
  SUseDbReq usedbReq = {0};
21,549,712✔
118
  tstrncpy(usedbReq.db, pInput->db, TSDB_DB_FNAME_LEN);
21,549,748✔
119
  usedbReq.db[sizeof(usedbReq.db) - 1] = 0;
21,549,714✔
120
  usedbReq.vgVersion = pInput->vgVersion;
21,549,714✔
121
  usedbReq.dbId = pInput->dbId;
21,549,748✔
122
  usedbReq.numOfTable = pInput->numOfTable;
21,549,742✔
123
  usedbReq.stateTs = pInput->stateTs;
21,549,166✔
124

125
  int32_t bufLen = tSerializeSUseDbReq(NULL, 0, &usedbReq);
21,549,742✔
126
  void   *pBuf = (*mallcFp)(bufLen);
21,551,210✔
127
  if (NULL == pBuf) {
21,551,210✔
128
    return terrno;
×
129
  }
130
  int32_t ret = tSerializeSUseDbReq(pBuf, bufLen, &usedbReq);
21,551,210✔
131
  if (ret < 0) {
21,550,399✔
132
    if (freeFp) (*freeFp)(pBuf);
×
133
    return ret;
×
134
  }
135

136
  *msg = pBuf;
21,550,412✔
137
  *msgLen = bufLen;
21,550,412✔
138

139
  return TSDB_CODE_SUCCESS;
21,550,406✔
140
}
141

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

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

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

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

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

165
  return TSDB_CODE_SUCCESS;
41,200✔
166
}
167

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

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

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

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

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

223
  SDbCfgReq dbCfgReq = {0};
7,410,776✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
7,410,784✔
225

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

237
  *msg = pBuf;
7,411,515✔
238
  *msgLen = bufLen;
7,411,515✔
239

240
  return TSDB_CODE_SUCCESS;
7,410,784✔
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,
403,258✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
403,258✔
272
  QUERY_PARAM_CHECK(msg);
403,258✔
273
  QUERY_PARAM_CHECK(msgLen);
403,258✔
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
403,258✔
301

302
  *msg = pBuf;
403,258✔
303
  *msgLen = bufLen;
403,258✔
304

305
  return TSDB_CODE_SUCCESS;
403,258✔
306
}
307

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

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

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

328
  *msg = pBuf;
6,116,886✔
329
  *msgLen = bufLen;
6,116,886✔
330

331
  return TSDB_CODE_SUCCESS;
6,116,886✔
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),
74,831✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
74,831✔
363
  QUERY_PARAM_CHECK(msg);
74,831✔
364
  QUERY_PARAM_CHECK(msgLen);
74,831✔
365

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

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

383
  *msg = pBuf;
74,831✔
384
  *msgLen = bufLen;
74,831✔
385

386
  return TSDB_CODE_SUCCESS;
74,831✔
387
}
388

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

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

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

409
  *msg = pBuf;
15,948,638✔
410
  *msgLen = bufLen;
15,947,865✔
411

412
  return TSDB_CODE_SUCCESS;
15,948,596✔
413
}
414

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

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

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

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

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

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

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

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

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

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

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

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

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

558
  *msg = pBuf;
52,864✔
559
  *msgLen = bufLen;
52,864✔
560

561
  return TSDB_CODE_SUCCESS;
52,864✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
21,446,799✔
UNCOV
570
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
UNCOV
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) {
21,447,500✔
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) {
21,447,530✔
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);
21,447,530✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
70,679,805✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
49,232,619✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
49,233,047✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
100,257,308✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
51,024,602✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
21,447,186✔
597

598
PROCESS_USEDB_OVER:
21,447,443✔
599

600
  if (code != 0) {
21,447,530✔
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);
21,447,530✔
609
  return code;
21,447,500✔
610
}
611

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

619
  if (pMetaMsg->numOfColumns > TSDB_MAX_COLUMNS || pMetaMsg->numOfColumns <= 0) {
34,393,802✔
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 &&
34,394,415✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
5,220,479✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
142,631✔
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) {
34,396,250✔
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) {
34,393,185✔
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) {
34,393,185✔
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) {
34,395,024✔
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;
34,395,024✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
46,008,600✔
655
  QUERY_PARAM_CHECK(msg);
46,008,600✔
656
  QUERY_PARAM_CHECK(pMeta);
46,008,600✔
657
  pMeta->vgId = msg->vgId;
46,008,600✔
658
  pMeta->tableType = msg->tableType;
46,005,522✔
659
  pMeta->uid = msg->tuid;
45,999,359✔
660
  pMeta->suid = msg->suid;
46,001,491✔
661

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

665
  return TSDB_CODE_SUCCESS;
46,007,817✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
257,680✔
695
  return TSDB_CODE_SUCCESS;
257,680✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
62,187,357✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
62,187,970✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
62,186,744✔
717
  pTableMeta->suid = msg->suid;
62,188,583✔
718
  pTableMeta->sversion = msg->sversion;
62,188,583✔
719
  pTableMeta->tversion = msg->tversion;
62,188,583✔
720
  pTableMeta->rversion = msg->rversion;
62,187,357✔
721
  pTableMeta->ownerId = msg->ownerId;
62,187,970✔
722
  if (msg->virtualStb) {
62,187,970✔
723
    pTableMeta->virtualStb = 1;
248,742✔
724
    pTableMeta->numOfColRefs = 0;
248,742✔
725
  } else {
726
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
61,939,228✔
727
      pTableMeta->virtualStb = 1;
93,807✔
728
      pTableMeta->numOfColRefs = 0;
93,807✔
729
    } else {
730
      pTableMeta->virtualStb = 0;
61,845,421✔
731
      pTableMeta->numOfColRefs = msg->numOfColRefs;
61,846,034✔
732
    }
733
  }
734

735
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
62,187,357✔
736
  pTableMeta->tableInfo.precision = msg->precision;
62,187,933✔
737
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
62,187,933✔
738

739
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
62,187,320✔
740
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
62,187,357✔
741
    pTableMeta->schemaExt = pSchemaExt;
60,095,416✔
742
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
60,096,605✔
743
  } else {
744
    pTableMeta->schemaExt = NULL;
2,092,554✔
745
  }
746

747
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
62,187,970✔
748
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
400,953✔
749
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
400,953✔
750
  } else {
751
    pTableMeta->colRef = NULL;
61,786,367✔
752
  }
753

754
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
62,188,546✔
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)) {
486,158✔
759
        ++pTableMeta->tableInfo.numOfPKs;
244,829✔
760
      } else {
761
        hasPK = false;
241,329✔
762
      }
763
    }
764
  }
765

766
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
62,187,970✔
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;
62,187,970✔
774
  return TSDB_CODE_SUCCESS;
62,188,583✔
775
}
776

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

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

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

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

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

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

824
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
154,972✔
825
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
503,016✔
826
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
348,044✔
827
    if (hasPK && (i > 0)) {
348,044✔
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;
154,972✔
837
  tstrncpy(pTbName, msg->tbName, tbNameSize);
154,972✔
838

839
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
154,972✔
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;
154,972✔
847
  return TSDB_CODE_SUCCESS;
154,972✔
848
}
849

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

854
  if (NULL == output || NULL == msg || msgSize <= 0) {
34,240,056✔
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) {
34,240,056✔
861
    code = TSDB_CODE_INVALID_MSG;
×
862
    goto PROCESS_META_OVER;
×
863
  }
864

865
  code = queryConvertTableMetaMsg(&metaRsp);
34,240,052✔
866
  if (code != TSDB_CODE_SUCCESS) {
34,238,826✔
867
    goto PROCESS_META_OVER;
×
868
  }
869

870
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
102,667,658✔
871
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
68,335,021✔
872
                    metaRsp.virtualStb);
34,096,195✔
873
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
34,238,826✔
874
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
32,641,645✔
875
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
876
    goto PROCESS_META_OVER;
×
877
  }
878

879
  STableMetaOutput *pOut = output;
34,240,052✔
880
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
34,240,052✔
881
  pOut->dbId = metaRsp.dbId;
34,239,439✔
882

883
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
34,240,056✔
884
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
11,656,161✔
885

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

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

894
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
11,656,161✔
895
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
22,583,895✔
896
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
93,807✔
897

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

901
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
93,807✔
902
    if (TSDB_CODE_SUCCESS != code) {
93,807✔
903
      goto PROCESS_META_OVER;
×
904
    }
905
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
93,807✔
906
  } else {
907
    SET_META_TYPE_TABLE(pOut->metaType);
22,490,088✔
908
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
22,489,475✔
909
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
22,488,249✔
910
  }
911

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

917
  tFreeSTableMetaRsp(&metaRsp);
34,240,056✔
918
  return code;
34,240,019✔
919
}
920

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

925
  if (NULL == output || NULL == msg || msgSize <= 0) {
154,972✔
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) {
154,972✔
932
    code = TSDB_CODE_INVALID_MSG;
×
933
    goto PROCESS_NAME_OVER;
×
934
  }
935

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

941
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
464,916✔
942
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
309,944✔
943
                    metaRsp.virtualStb);
154,972✔
944

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

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

955
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
154,972✔
956
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
41,328✔
957

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

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

966
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
41,328✔
967
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
113,644✔
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,644✔
981
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
113,644✔
982
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
113,644✔
983
  }
984

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

990
  tFreeSTableMetaRsp(&metaRsp);
154,972✔
991
  return code;
154,972✔
992
}
993

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

998
  if (NULL == output || NULL == msg || msgSize <= 0) {
41,200✔
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,200✔
1005
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
41,200✔
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,200✔
1012
}
1013

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

1018
  if (NULL == output || NULL == msg || msgSize <= 0) {
40,173✔
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,173✔
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,173✔
1031

1032
  return code;
40,173✔
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,920,846✔
1060
  SDbCfgRsp out = {0};
3,920,846✔
1061

1062
  if (NULL == output || NULL == msg || msgSize <= 0) {
3,920,846✔
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,920,846✔
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,920,846✔
1073

1074
  return TSDB_CODE_SUCCESS;
3,920,846✔
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) {
382,424✔
1096
  SRetrieveFuncRsp out = {0};
382,424✔
1097

1098
  if (NULL == output || NULL == msg || msgSize <= 0) {
382,424✔
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) {
382,424✔
1104
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1105
    return TSDB_CODE_INVALID_MSG;
×
1106
  }
1107

1108
  if (1 != out.numOfFuncs) {
382,424✔
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);
382,424✔
1114

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

1119
  return TSDB_CODE_SUCCESS;
382,424✔
1120
}
1121

1122
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
6,116,890✔
1123
  if (NULL == output || NULL == msg || msgSize <= 0) {
6,116,890✔
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) {
6,116,890✔
1129
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1130
    return TSDB_CODE_INVALID_MSG;
×
1131
  }
1132

1133
  return TSDB_CODE_SUCCESS;
6,116,890✔
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) {
74,831✔
1152
  if (NULL == output || NULL == msg || msgSize <= 0) {
74,831✔
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));
74,831✔
1158
  if(out == NULL) {
74,831✔
1159
    return terrno;
×
1160
  }
1161
  if (tDeserializeSTableCfgRsp(msg, msgSize, out) != 0) {
74,831✔
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;
74,831✔
1169

1170
  return TSDB_CODE_SUCCESS;
74,831✔
1171
}
1172

1173
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
5,001✔
1174
  if (NULL == output || NULL == msg || msgSize <= 0) {
5,001✔
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));
5,001✔
1180
  if (out == NULL) {
5,001✔
1181
    return terrno;
×
1182
  }
1183
  if (tDeserializeSViewMetaRsp(msg, msgSize, out) != 0) {
5,001✔
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);
5,001✔
1191

1192
  *(SViewMetaRsp **)output = out;
5,001✔
1193

1194
  return TSDB_CODE_SUCCESS;
5,001✔
1195
}
1196

1197
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
187,920✔
1198
  if (NULL == output || NULL == msg || msgSize <= 0) {
187,920✔
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) {
187,920✔
1204
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1205
    return TSDB_CODE_INVALID_MSG;
×
1206
  }
1207

1208
  return TSDB_CODE_SUCCESS;
187,920✔
1209
}
1210

1211
static int32_t queryProcessGetRsmaRsp(void* output, char* msg, int32_t msgSize) {
16,422✔
1212
  if (NULL == output || NULL == msg || msgSize <= 0) {
16,422✔
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,422✔
1218
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1219
    return TSDB_CODE_INVALID_MSG;
×
1220
  }
1221

1222
  return TSDB_CODE_SUCCESS;
16,422✔
1223
}
1224

1225
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
187,920✔
1226
  if (!output || !msg || msgSize <= 0) {
187,920✔
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) {
187,920✔
1232
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1233
    return TSDB_CODE_INVALID_MSG;
×
1234
  }
1235
  return TSDB_CODE_SUCCESS;
187,920✔
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) {
52,864✔
1255
  if (!output || !msg || msgSize <= 0) {
52,864✔
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;
52,864✔
1261
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
52,864✔
1262
  if (code != 0) {
52,864✔
1263
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1264
    return code;
×
1265
  }
1266

1267
  return TSDB_CODE_SUCCESS;
52,864✔
1268
}
1269

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

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