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

taosdata / TDengine / #4891

20 Dec 2025 03:05AM UTC coverage: 65.549% (+2.7%) from 62.824%
#4891

push

travis-ci

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

182743 of 278788 relevant lines covered (65.55%)

104071702.81 hits per line

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

65.2
/source/libs/qcom/src/querymsg.c
1
/*
2
 * Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
3
 *
4
 * This program is free software: you can use, redistribute, and/or modify
5
 * it under the terms of the GNU Affero General Public License, version 3
6
 * or later ("AGPL"), as published by the Free Software Foundation.
7
 *
8
 * This program is distributed in the hope that it will be useful, but WITHOUT
9
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
 * FITNESS FOR A PARTICULAR PURPOSE.
11
 *
12
 * You should have received a copy of the GNU Affero General Public License
13
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14
 */
15

16
#include "query.h"
17
#include "queryInt.h"
18
#include "streamMsg.h"
19
#include "systable.h"
20
#include "tmsg.h"
21
#include "trpc.h"
22

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

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

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

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
26,916,418✔
39
  if (NULL == pOut->dbVgroup) {
26,916,674✔
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
26,916,423✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
26,917,153✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
26,916,902✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
26,915,691✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
26,916,389✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
26,916,389✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
26,916,896✔
54
    return TSDB_CODE_SUCCESS;
4,338,431✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
45,156,488✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
44,971,368✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
22,578,244✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
22,578,244✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
51,404,494✔
84
  infoReq.option = pInput->option;
51,404,494✔
85
  infoReq.header.vgId = pInput->vgId;
51,404,494✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
51,403,992✔
87

88
  if (pInput->dbFName) {
51,404,240✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
51,404,208✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
51,404,497✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
51,404,494✔
94
  void   *pBuf = (*mallcFp)(bufLen);
51,403,548✔
95
  if (NULL == pBuf) {
51,404,207✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
51,404,207✔
99
  if (ret < 0) {
51,403,762✔
100
    if (freeFp) (*freeFp)(pBuf);
96✔
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
51,403,666✔
105
  *msgLen = bufLen;
51,404,171✔
106

107
  return TSDB_CODE_SUCCESS;
51,403,917✔
108
}
109

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

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

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

136
  *msg = pBuf;
24,447,412✔
137
  *msgLen = bufLen;
24,447,161✔
138

139
  return TSDB_CODE_SUCCESS;
24,447,161✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
155,672✔
163
  *msgLen = bufLen;
155,672✔
164

165
  return TSDB_CODE_SUCCESS;
155,672✔
166
}
167

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

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

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

187
  *msg = pBuf;
121,411✔
188
  *msgLen = bufLen;
121,411✔
189

190
  return TSDB_CODE_SUCCESS;
121,411✔
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,685,051✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
1,685,051✔
220
  QUERY_PARAM_CHECK(msg);
1,685,051✔
221
  QUERY_PARAM_CHECK(msgLen);
1,685,051✔
222

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

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

237
  *msg = pBuf;
1,685,274✔
238
  *msgLen = bufLen;
1,685,274✔
239

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

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
163,478✔
301

302
  *msg = pBuf;
163,478✔
303
  *msgLen = bufLen;
163,478✔
304

305
  return TSDB_CODE_SUCCESS;
163,478✔
306
}
307

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

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

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

328
  *msg = pBuf;
3,763,414✔
329
  *msgLen = bufLen;
3,763,414✔
330

331
  return TSDB_CODE_SUCCESS;
3,763,414✔
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),
126,892✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
126,892✔
363
  QUERY_PARAM_CHECK(msg);
126,892✔
364
  QUERY_PARAM_CHECK(msgLen);
126,892✔
365

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

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

383
  *msg = pBuf;
126,892✔
384
  *msgLen = bufLen;
126,892✔
385

386
  return TSDB_CODE_SUCCESS;
126,892✔
387
}
388

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

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

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

409
  *msg = pBuf;
18,619,703✔
410
  *msgLen = bufLen;
18,619,703✔
411

412
  return TSDB_CODE_SUCCESS;
18,619,703✔
413
}
414

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

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

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

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

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

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

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

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

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

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

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

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

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

558
  *msg = pBuf;
64,505✔
559
  *msgLen = bufLen;
64,505✔
560

561
  return TSDB_CODE_SUCCESS;
64,505✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
24,285,056✔
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) {
24,285,056✔
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) {
24,285,564✔
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);
24,285,564✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
77,142,440✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
52,857,458✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
52,857,167✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
108,122,325✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
55,265,449✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
24,284,982✔
597

598
PROCESS_USEDB_OVER:
24,285,564✔
599

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

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

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

624
  if (pMetaMsg->tableType != TSDB_SUPER_TABLE && pMetaMsg->tableType != TSDB_CHILD_TABLE &&
38,512,771✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
6,284,258✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
198,949✔
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) {
38,512,313✔
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) {
38,512,769✔
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) {
38,512,518✔
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) {
38,513,227✔
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;
38,512,518✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
49,960,767✔
655
  QUERY_PARAM_CHECK(msg);
49,960,767✔
656
  QUERY_PARAM_CHECK(pMeta);
49,960,767✔
657
  pMeta->vgId = msg->vgId;
49,960,767✔
658
  pMeta->tableType = msg->tableType;
49,955,667✔
659
  pMeta->uid = msg->tuid;
49,947,914✔
660
  pMeta->suid = msg->suid;
49,953,525✔
661

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

665
  return TSDB_CODE_SUCCESS;
49,954,991✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
361,068✔
695
  return TSDB_CODE_SUCCESS;
361,068✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
67,824,702✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
67,824,907✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
67,824,198✔
717
  pTableMeta->suid = msg->suid;
67,824,449✔
718
  pTableMeta->sversion = msg->sversion;
67,824,702✔
719
  pTableMeta->tversion = msg->tversion;
67,824,702✔
720
  pTableMeta->rversion = msg->rversion;
67,824,449✔
721
  if (msg->virtualStb) {
67,825,158✔
722
    pTableMeta->virtualStb = 1;
303,490✔
723
    pTableMeta->numOfColRefs = 0;
303,490✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
67,520,503✔
726
      pTableMeta->virtualStb = 1;
139,642✔
727
      pTableMeta->numOfColRefs = 0;
139,642✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
67,380,861✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
67,381,570✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
67,825,158✔
735
  pTableMeta->tableInfo.precision = msg->precision;
67,823,742✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
67,824,449✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
67,824,198✔
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
67,824,451✔
740
    pTableMeta->schemaExt = pSchemaExt;
64,993,006✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
64,993,259✔
742
  } else {
743
    pTableMeta->schemaExt = NULL;
2,831,443✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
67,823,993✔
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
454,881✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
454,881✔
749
  } else {
750
    pTableMeta->colRef = NULL;
67,369,570✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
67,824,449✔
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)) {
561,096✔
758
        ++pTableMeta->tableInfo.numOfPKs;
282,530✔
759
      } else {
760
        hasPK = false;
278,566✔
761
      }
762
    }
763
  }
764

765
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
67,824,479✔
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;
67,824,479✔
773
  return TSDB_CODE_SUCCESS;
67,825,158✔
774
}
775

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

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

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

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

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

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

822
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
347,872✔
823
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
1,147,219✔
824
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
799,347✔
825
    if (hasPK && (i > 0)) {
799,347✔
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;
347,872✔
835
  tstrncpy(pTbName, msg->tbName, tbNameSize);
347,872✔
836

837
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
347,872✔
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;
347,872✔
845
  return TSDB_CODE_SUCCESS;
347,872✔
846
}
847

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

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

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

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

868
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
114,435,384✔
869
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
76,130,845✔
870
                    metaRsp.virtualStb);
37,965,948✔
871
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
38,164,897✔
872
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
35,928,228✔
873
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
874
    goto PROCESS_META_OVER;
×
875
  }
876

877
  STableMetaOutput *pOut = output;
38,165,606✔
878
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
38,165,606✔
879
  pOut->dbId = metaRsp.dbId;
38,164,897✔
880

881
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
38,164,927✔
882
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
13,142,742✔
883

884
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
13,142,742✔
885
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
13,142,742✔
886

887
    pOut->ctbMeta.vgId = metaRsp.vgId;
13,142,742✔
888
    pOut->ctbMeta.tableType = metaRsp.tableType;
13,142,286✔
889
    pOut->ctbMeta.uid = metaRsp.tuid;
13,142,742✔
890
    pOut->ctbMeta.suid = metaRsp.suid;
13,142,742✔
891

892
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
13,142,742✔
893
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
25,022,185✔
894
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
139,642✔
895

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

899
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
139,642✔
900
    if (TSDB_CODE_SUCCESS != code) {
139,642✔
901
      goto PROCESS_META_OVER;
×
902
    }
903
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
139,642✔
904
  } else {
905
    SET_META_TYPE_TABLE(pOut->metaType);
24,882,543✔
906
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
24,883,222✔
907
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
24,882,971✔
908
  }
909

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

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

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

923
  if (NULL == output || NULL == msg || msgSize <= 0) {
347,872✔
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) {
347,872✔
930
    code = TSDB_CODE_INVALID_MSG;
×
931
    goto PROCESS_NAME_OVER;
×
932
  }
933

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

939
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
1,043,616✔
940
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
695,744✔
941
                    metaRsp.virtualStb);
347,872✔
942

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

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

953
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
347,872✔
954
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
104,735✔
955

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

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

964
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
104,735✔
965
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
243,137✔
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);
243,137✔
979
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
243,137✔
980
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
243,137✔
981
  }
982

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

988
  tFreeSTableMetaRsp(&metaRsp);
347,872✔
989
  return code;
347,872✔
990
}
991

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

996
  if (NULL == output || NULL == msg || msgSize <= 0) {
155,672✔
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;
155,672✔
1003
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
155,672✔
1004
    qError("invalid qnode list rsp msg, msgSize:%d", msgSize);
×
1005
    code = TSDB_CODE_INVALID_MSG;
×
1006
    return code;
×
1007
  }
1008

1009
  return code;
155,672✔
1010
}
1011

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

1016
  if (NULL == output || NULL == msg || msgSize <= 0) {
121,411✔
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) {
121,411✔
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;
121,411✔
1029

1030
  return code;
121,411✔
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,398,755✔
1058
  SDbCfgRsp out = {0};
1,398,755✔
1059

1060
  if (NULL == output || NULL == msg || msgSize <= 0) {
1,398,755✔
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,398,755✔
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,398,755✔
1071

1072
  return TSDB_CODE_SUCCESS;
1,398,755✔
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) {
159,238✔
1094
  SRetrieveFuncRsp out = {0};
159,238✔
1095

1096
  if (NULL == output || NULL == msg || msgSize <= 0) {
159,238✔
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) {
159,238✔
1102
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1103
    return TSDB_CODE_INVALID_MSG;
×
1104
  }
1105

1106
  if (1 != out.numOfFuncs) {
159,238✔
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);
159,238✔
1112

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

1117
  return TSDB_CODE_SUCCESS;
159,238✔
1118
}
1119

1120
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
3,762,028✔
1121
  if (NULL == output || NULL == msg || msgSize <= 0) {
3,762,028✔
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,762,028✔
1127
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1128
    return TSDB_CODE_INVALID_MSG;
×
1129
  }
1130

1131
  return TSDB_CODE_SUCCESS;
3,762,028✔
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) {
126,892✔
1150
  if (NULL == output || NULL == msg || msgSize <= 0) {
126,892✔
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));
126,892✔
1156
  if(out == NULL) {
126,892✔
1157
    return terrno;
×
1158
  }
1159
  if (tDeserializeSTableCfgRsp(msg, msgSize, out) != 0) {
126,892✔
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;
126,892✔
1167

1168
  return TSDB_CODE_SUCCESS;
126,892✔
1169
}
1170

1171
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
154,854✔
1172
  if (NULL == output || NULL == msg || msgSize <= 0) {
154,854✔
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));
154,854✔
1178
  if (out == NULL) {
154,854✔
1179
    return terrno;
×
1180
  }
1181
  if (tDeserializeSViewMetaRsp(msg, msgSize, out) != 0) {
154,854✔
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);
154,854✔
1189

1190
  *(SViewMetaRsp **)output = out;
154,854✔
1191

1192
  return TSDB_CODE_SUCCESS;
154,854✔
1193
}
1194

1195
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
205,900✔
1196
  if (NULL == output || NULL == msg || msgSize <= 0) {
205,900✔
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) {
205,900✔
1202
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1203
    return TSDB_CODE_INVALID_MSG;
×
1204
  }
1205

1206
  return TSDB_CODE_SUCCESS;
205,900✔
1207
}
1208

1209
static int32_t queryProcessGetRsmaRsp(void* output, char* msg, int32_t msgSize) {
17,848✔
1210
  if (NULL == output || NULL == msg || msgSize <= 0) {
17,848✔
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) {
17,848✔
1216
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1217
    return TSDB_CODE_INVALID_MSG;
×
1218
  }
1219

1220
  return TSDB_CODE_SUCCESS;
17,848✔
1221
}
1222

1223
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
205,900✔
1224
  if (!output || !msg || msgSize <= 0) {
205,900✔
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) {
205,900✔
1230
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1231
    return TSDB_CODE_INVALID_MSG;
×
1232
  }
1233
  return TSDB_CODE_SUCCESS;
205,900✔
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) {
64,505✔
1253
  if (!output || !msg || msgSize <= 0) {
64,505✔
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;
64,505✔
1259
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
64,505✔
1260
  if (code != 0) {
64,505✔
1261
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1262
    return code;
×
1263
  }
1264

1265
  return TSDB_CODE_SUCCESS;
64,505✔
1266
}
1267

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

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