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

taosdata / TDengine / #4874

04 Dec 2025 01:55AM UTC coverage: 64.623% (+0.07%) from 64.558%
#4874

push

travis-ci

guanshengliang
Merge branch '3.0' into cover/3.0

865 of 2219 new or added lines in 36 files covered. (38.98%)

6317 existing lines in 143 files now uncovered.

159543 of 246882 relevant lines covered (64.62%)

106415537.4 hits per line

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

64.83
/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,628,380✔
33
  QUERY_PARAM_CHECK(pOut);
26,628,380✔
34
  QUERY_PARAM_CHECK(usedbRsp);
26,628,380✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
26,628,380✔
36
  pOut->dbId = usedbRsp->uid;
26,628,661✔
37

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

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
26,628,801✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
26,628,520✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
26,628,801✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
26,628,801✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
26,628,520✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
26,628,520✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
26,628,520✔
54
    return TSDB_CODE_SUCCESS;
4,831,362✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
43,594,316✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
42,313,496✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
21,797,158✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
21,797,158✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
52,002,148✔
84
  infoReq.option = pInput->option;
52,001,888✔
85
  infoReq.header.vgId = pInput->vgId;
52,002,408✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
52,002,408✔
87

88
  if (pInput->dbFName) {
52,002,689✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
52,001,544✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
52,002,689✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
52,002,429✔
94
  void   *pBuf = (*mallcFp)(bufLen);
52,001,708✔
95
  if (NULL == pBuf) {
52,003,477✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
52,003,477✔
99
  if (ret < 0) {
52,001,733✔
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
52,001,733✔
105
  *msgLen = bufLen;
52,001,192✔
106

107
  return TSDB_CODE_SUCCESS;
52,001,707✔
108
}
109

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

117
  SUseDbReq usedbReq = {0};
23,653,706✔
118
  tstrncpy(usedbReq.db, pInput->db, TSDB_DB_FNAME_LEN);
23,653,706✔
119
  usedbReq.db[sizeof(usedbReq.db) - 1] = 0;
23,653,175✔
120
  usedbReq.vgVersion = pInput->vgVersion;
23,653,175✔
121
  usedbReq.dbId = pInput->dbId;
23,653,706✔
122
  usedbReq.numOfTable = pInput->numOfTable;
23,653,451✔
123
  usedbReq.stateTs = pInput->stateTs;
23,653,430✔
124

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

136
  *msg = pBuf;
23,653,706✔
137
  *msgLen = bufLen;
23,653,706✔
138

139
  return TSDB_CODE_SUCCESS;
23,653,706✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
172,894✔
163
  *msgLen = bufLen;
172,894✔
164

165
  return TSDB_CODE_SUCCESS;
172,894✔
166
}
167

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

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

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

187
  *msg = pBuf;
119,957✔
188
  *msgLen = bufLen;
119,957✔
189

190
  return TSDB_CODE_SUCCESS;
119,957✔
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,791,148✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
1,791,148✔
220
  QUERY_PARAM_CHECK(msg);
1,791,148✔
221
  QUERY_PARAM_CHECK(msgLen);
1,791,148✔
222

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

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

237
  *msg = pBuf;
1,791,148✔
238
  *msgLen = bufLen;
1,791,148✔
239

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

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
425,380✔
301

302
  *msg = pBuf;
425,380✔
303
  *msgLen = bufLen;
425,380✔
304

305
  return TSDB_CODE_SUCCESS;
425,380✔
306
}
307

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

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

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

328
  *msg = pBuf;
3,421,852✔
329
  *msgLen = bufLen;
3,421,852✔
330

331
  return TSDB_CODE_SUCCESS;
3,421,852✔
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),
122,508✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
122,508✔
363
  QUERY_PARAM_CHECK(msg);
122,508✔
364
  QUERY_PARAM_CHECK(msgLen);
122,508✔
365

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

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

383
  *msg = pBuf;
122,508✔
384
  *msgLen = bufLen;
122,508✔
385

386
  return TSDB_CODE_SUCCESS;
122,508✔
387
}
388

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

395
  SViewMetaReq req = {0};
19,258,674✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
19,258,809✔
397

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

409
  *msg = pBuf;
19,258,809✔
410
  *msgLen = bufLen;
19,258,809✔
411

412
  return TSDB_CODE_SUCCESS;
19,258,543✔
413
}
414

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

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

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

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

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

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

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

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

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

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

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

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

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

558
  *msg = pBuf;
140,520✔
559
  *msgLen = bufLen;
140,520✔
560

561
  return TSDB_CODE_SUCCESS;
140,520✔
562
}
563

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

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

575
  if (tDeserializeSUseDbRsp(msg, msgSize, &usedbRsp) != 0) {
23,500,512✔
576
    qError("invalid use db rsp msg, msgSize:%d", msgSize);
×
577
    code = TSDB_CODE_INVALID_MSG;
×
578
    goto PROCESS_USEDB_OVER;
×
579
  }
580

581
  if (usedbRsp.vgNum < 0) {
23,500,512✔
582
    qError("invalid db[%s] vgroup number[%d]", usedbRsp.db, usedbRsp.vgNum);
×
583
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
584
    goto PROCESS_USEDB_OVER;
×
585
  }
586

587
  qTrace("db:%s, usedbRsp received, numOfVgroups:%d", usedbRsp.db, usedbRsp.vgNum);
23,500,512✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
75,711,406✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
52,210,894✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
52,210,894✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
106,711,191✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
54,500,297✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
23,500,512✔
597

598
PROCESS_USEDB_OVER:
23,500,512✔
599

600
  if (code != 0) {
23,500,512✔
601
    if (pOut) {
×
602
      if (pOut->dbVgroup) taosHashCleanup(pOut->dbVgroup->vgHash);
×
603
      taosMemoryFreeClear(pOut->dbVgroup);
×
604
    }
605
    qError("failed to process usedb rsp since %s", terrstr());
×
606
  }
607

608
  tFreeSUsedbRsp(&usedbRsp);
23,500,512✔
609
  return code;
23,500,512✔
610
}
611

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

619
  if (pMetaMsg->numOfColumns > TSDB_MAX_COLUMNS || pMetaMsg->numOfColumns <= 0) {
38,501,589✔
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 &&
38,501,746✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
5,869,390✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
196,477✔
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,501,610✔
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,501,610✔
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,501,610✔
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,501,610✔
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,501,610✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
51,335,301✔
655
  QUERY_PARAM_CHECK(msg);
51,335,301✔
656
  QUERY_PARAM_CHECK(pMeta);
51,335,301✔
657
  pMeta->vgId = msg->vgId;
51,335,301✔
658
  pMeta->tableType = msg->tableType;
51,332,259✔
659
  pMeta->uid = msg->tuid;
51,327,821✔
660
  pMeta->suid = msg->suid;
51,324,155✔
661

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

665
  return TSDB_CODE_SUCCESS;
51,326,944✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
423,615✔
695
  return TSDB_CODE_SUCCESS;
423,615✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
51,334,273✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
51,333,836✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
51,334,273✔
717
  pTableMeta->suid = msg->suid;
51,333,836✔
718
  pTableMeta->sversion = msg->sversion;
51,333,836✔
719
  pTableMeta->tversion = msg->tversion;
51,334,273✔
720
  pTableMeta->rversion = msg->rversion;
51,334,273✔
721
  if (msg->virtualStb) {
51,333,836✔
722
    pTableMeta->virtualStb = 1;
240,002✔
723
    pTableMeta->numOfColRefs = 0;
240,002✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
51,093,834✔
726
      pTableMeta->virtualStb = 1;
136,987✔
727
      pTableMeta->numOfColRefs = 0;
136,987✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
50,956,847✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
50,957,284✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
51,334,273✔
735
  pTableMeta->tableInfo.precision = msg->precision;
51,334,273✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
51,334,273✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
51,334,273✔
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
51,334,273✔
740
    pTableMeta->schemaExt = pSchemaExt;
48,336,088✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
48,336,088✔
742
  } else {
743
    pTableMeta->schemaExt = NULL;
2,998,342✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
51,334,430✔
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
444,486✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
444,486✔
749
  } else {
750
    pTableMeta->colRef = NULL;
50,889,944✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
51,334,430✔
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)) {
576,868✔
758
        ++pTableMeta->tableInfo.numOfPKs;
290,375✔
759
      } else {
760
        hasPK = false;
286,493✔
761
      }
762
    }
763
  }
764

765
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
51,333,993✔
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;
51,333,836✔
773
  return TSDB_CODE_SUCCESS;
51,334,273✔
774
}
775

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

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

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

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

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

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

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

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

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

852
  if (NULL == output || NULL == msg || msgSize <= 0) {
38,156,413✔
UNCOV
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,156,413✔
859
    code = TSDB_CODE_INVALID_MSG;
×
860
    goto PROCESS_META_OVER;
×
861
  }
862

863
  code = queryConvertTableMetaMsg(&metaRsp);
38,156,413✔
864
  if (code != TSDB_CODE_SUCCESS) {
38,156,120✔
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
38,156,120✔
869
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags)) {
35,739,251✔
870
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
871
    goto PROCESS_META_OVER;
×
872
  }
873

874
  STableMetaOutput *pOut = output;
38,156,413✔
875
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
38,156,413✔
876
  pOut->dbId = metaRsp.dbId;
38,156,277✔
877

878
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
38,156,277✔
879
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
12,899,281✔
880

881
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
12,899,281✔
882
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
12,899,281✔
883

884
    pOut->ctbMeta.vgId = metaRsp.vgId;
12,899,281✔
885
    pOut->ctbMeta.tableType = metaRsp.tableType;
12,899,281✔
886
    pOut->ctbMeta.uid = metaRsp.tuid;
12,899,281✔
887
    pOut->ctbMeta.suid = metaRsp.suid;
12,899,281✔
888

889
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
12,899,281✔
890
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
25,256,996✔
891
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
136,987✔
892

893
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
136,987✔
894
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
136,987✔
895

896
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
136,987✔
897
    if (TSDB_CODE_SUCCESS != code) {
136,987✔
898
      goto PROCESS_META_OVER;
×
899
    }
900
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
136,987✔
901
  } else {
902
    SET_META_TYPE_TABLE(pOut->metaType);
25,120,009✔
903
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
25,120,009✔
904
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
25,120,009✔
905
  }
906

907
PROCESS_META_OVER:
38,156,256✔
908
  if (code != 0) {
38,156,256✔
909
    qError("failed to process table meta rsp since %s", tstrerror(code));
×
910
  }
911

912
  tFreeSTableMetaRsp(&metaRsp);
38,156,256✔
913
  return code;
38,156,413✔
914
}
915

916
static int32_t queryProcessTableNameRsp(void *output, char *msg, int32_t msgSize) {
345,333✔
917
  int32_t       code = 0;
345,333✔
918
  STableMetaRsp metaRsp = {0};
345,333✔
919

920
  if (NULL == output || NULL == msg || msgSize <= 0) {
345,333✔
921
    qError("queryProcessTableNameRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
922
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
923
    goto PROCESS_NAME_OVER;
×
924
  }
925

926
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
345,333✔
927
    code = TSDB_CODE_INVALID_MSG;
×
928
    goto PROCESS_NAME_OVER;
×
929
  }
930

931
  code = queryConvertTableMetaMsg(&metaRsp);
345,333✔
932
  if (code != TSDB_CODE_SUCCESS) {
345,333✔
933
    goto PROCESS_NAME_OVER;
×
934
  }
935

936
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
345,333✔
937
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags)) {
345,333✔
938
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
939
    goto PROCESS_NAME_OVER;
×
940
  }
941

942
  STableMetaOutput *pOut = output;
345,333✔
943
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
345,333✔
944
  pOut->dbId = metaRsp.dbId;
345,333✔
945

946
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
345,333✔
947
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
106,476✔
948

949
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
106,476✔
950
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
106,476✔
951

952
    pOut->ctbMeta.vgId = metaRsp.vgId;
106,476✔
953
    pOut->ctbMeta.tableType = metaRsp.tableType;
106,476✔
954
    pOut->ctbMeta.uid = metaRsp.tuid;
106,476✔
955
    pOut->ctbMeta.suid = metaRsp.suid;
106,476✔
956

957
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
106,476✔
958
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
238,857✔
959
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
960

961
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
×
962
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
×
963

964
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
×
965
    if (TSDB_CODE_SUCCESS != code) {
×
966
      goto PROCESS_NAME_OVER;
×
967
    }
968

969
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
×
970
  } else {
971
    SET_META_TYPE_TABLE(pOut->metaType);
238,857✔
972
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
238,857✔
973
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
238,857✔
974
  }
975

976
PROCESS_NAME_OVER:
345,333✔
977
  if (code != 0) {
345,333✔
978
    qError("failed to process table name rsp since %s", tstrerror(code));
×
979
  }
980

981
  tFreeSTableMetaRsp(&metaRsp);
345,333✔
982
  return code;
345,333✔
983
}
984

985
int32_t queryProcessQnodeListRsp(void *output, char *msg, int32_t msgSize) {
172,894✔
986
  SQnodeListRsp out = {0};
172,894✔
987
  int32_t       code = 0;
172,894✔
988

989
  if (NULL == output || NULL == msg || msgSize <= 0) {
172,894✔
990
    qError("queryProcessQnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
991
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
992
    return code;
×
993
  }
994

995
  out.qnodeList = (SArray *)output;
172,894✔
996
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
172,894✔
997
    qError("invalid qnode list rsp msg, msgSize:%d", msgSize);
×
998
    code = TSDB_CODE_INVALID_MSG;
×
999
    return code;
×
1000
  }
1001

1002
  return code;
172,894✔
1003
}
1004

1005
int32_t queryProcessDnodeListRsp(void *output, char *msg, int32_t msgSize) {
119,957✔
1006
  SDnodeListRsp out = {0};
119,957✔
1007
  int32_t       code = 0;
119,957✔
1008

1009
  if (NULL == output || NULL == msg || msgSize <= 0) {
119,957✔
1010
    qError("queryProcessDnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1011
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1012
    return code;
×
1013
  }
1014

1015
  if (tDeserializeSDnodeListRsp(msg, msgSize, &out) != 0) {
119,957✔
1016
    qError("invalid dnode list rsp msg, msgSize:%d", msgSize);
×
1017
    code = TSDB_CODE_INVALID_MSG;
×
1018
    return code;
×
1019
  }
1020

1021
  *(SArray **)output = out.dnodeList;
119,957✔
1022

1023
  return code;
119,957✔
1024
}
1025

1026
int32_t queryProcessGetSerVerRsp(void *output, char *msg, int32_t msgSize) {
×
1027
  SServerVerRsp out = {0};
×
1028
  int32_t       code = 0;
×
1029

1030
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1031
    qError("queryProcessGetSerVerRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1032
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1033
    return code;
×
1034
  }
1035

1036
  if (tDeserializeSServerVerRsp(msg, msgSize, &out) != 0) {
×
1037
    qError("invalid svr ver rsp msg, msgSize:%d", msgSize);
×
1038
    code = TSDB_CODE_INVALID_MSG;
×
1039
    return code;
×
1040
  }
1041

1042
  *(char **)output = taosStrdup(out.ver);
×
1043
  if (NULL == *(char **)output) {
×
1044
    return terrno;
×
1045
  }
1046

1047
  return code;
×
1048
}
1049

1050
int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) {
1,503,327✔
1051
  SDbCfgRsp out = {0};
1,503,327✔
1052

1053
  if (NULL == output || NULL == msg || msgSize <= 0) {
1,503,327✔
1054
    qError("queryProcessGetDbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1055
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1056
  }
1057

1058
  if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) {
1,503,327✔
1059
    qError("tDeserializeSDbCfgRsp failed, msgSize:%d, dbCfgRsp:%lu", msgSize, sizeof(out));
×
1060
    return TSDB_CODE_INVALID_MSG;
×
1061
  }
1062

1063
  memcpy(output, &out, sizeof(out));
1,503,327✔
1064

1065
  return TSDB_CODE_SUCCESS;
1,503,327✔
1066
}
1067

1068
int32_t queryProcessGetIndexRsp(void *output, char *msg, int32_t msgSize) {
×
1069
  SUserIndexRsp out = {0};
×
1070

1071
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1072
    qError("queryProcessGetIndexRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1073
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1074
  }
1075

1076
  if (tDeserializeSUserIndexRsp(msg, msgSize, &out) != 0) {
×
1077
    qError("tDeserializeSUserIndexRsp failed, msgSize:%d", msgSize);
×
1078
    return TSDB_CODE_INVALID_MSG;
×
1079
  }
1080

1081
  memcpy(output, &out, sizeof(out));
×
1082

1083
  return TSDB_CODE_SUCCESS;
×
1084
}
1085

1086
int32_t queryProcessRetrieveFuncRsp(void *output, char *msg, int32_t msgSize) {
415,881✔
1087
  SRetrieveFuncRsp out = {0};
415,881✔
1088

1089
  if (NULL == output || NULL == msg || msgSize <= 0) {
415,881✔
1090
    qError("queryProcessRetrieveFuncRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1091
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1092
  }
1093

1094
  if (tDeserializeSRetrieveFuncRsp(msg, msgSize, &out) != 0) {
415,881✔
1095
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1096
    return TSDB_CODE_INVALID_MSG;
×
1097
  }
1098

1099
  if (1 != out.numOfFuncs) {
415,881✔
1100
    qError("invalid func num returned, numOfFuncs:%d", out.numOfFuncs);
×
1101
    return TSDB_CODE_INVALID_MSG;
×
1102
  }
1103

1104
  SFuncInfo *funcInfo = taosArrayGet(out.pFuncInfos, 0);
415,881✔
1105

1106
  memcpy(output, funcInfo, sizeof(*funcInfo));
415,881✔
1107
  taosArrayDestroy(out.pFuncInfos);
415,881✔
1108
  taosArrayDestroy(out.pFuncExtraInfos);
415,881✔
1109

1110
  return TSDB_CODE_SUCCESS;
415,881✔
1111
}
1112

1113
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
3,420,487✔
1114
  if (NULL == output || NULL == msg || msgSize <= 0) {
3,420,487✔
1115
    qError("queryProcessGetUserAuthRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1116
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1117
  }
1118

1119
  if (tDeserializeSGetUserAuthRsp(msg, msgSize, (SGetUserAuthRsp *)output) != 0) {
3,420,487✔
1120
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1121
    return TSDB_CODE_INVALID_MSG;
×
1122
  }
1123

1124
  return TSDB_CODE_SUCCESS;
3,420,487✔
1125
}
1126

1127
int32_t queryProcessGetTbIndexRsp(void *output, char *msg, int32_t msgSize) {
×
1128
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1129
    qError("queryProcessGetTbIndexRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1130
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1131
  }
1132

1133
  STableIndexRsp *out = (STableIndexRsp *)output;
×
1134
  if (tDeserializeSTableIndexRsp(msg, msgSize, out) != 0) {
×
1135
    qError("tDeserializeSTableIndexRsp failed, msgSize:%d", msgSize);
×
1136
    return TSDB_CODE_INVALID_MSG;
×
1137
  }
1138

1139
  return TSDB_CODE_SUCCESS;
×
1140
}
1141

1142
int32_t queryProcessGetTbCfgRsp(void *output, char *msg, int32_t msgSize) {
122,508✔
1143
  if (NULL == output || NULL == msg || msgSize <= 0) {
122,508✔
1144
    qError("queryProcessGetTbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1145
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1146
  }
1147

1148
  STableCfgRsp *out = taosMemoryCalloc(1, sizeof(STableCfgRsp));
122,508✔
1149
  if(out == NULL) {
122,508✔
1150
    return terrno;
×
1151
  }
1152
  if (tDeserializeSTableCfgRsp(msg, msgSize, out) != 0) {
122,508✔
1153
    qError("tDeserializeSTableCfgRsp failed, msgSize:%d", msgSize);
×
1154
    tFreeSTableCfgRsp(out);
×
1155
    taosMemoryFree(out);
×
1156
    return TSDB_CODE_INVALID_MSG;
×
1157
  }
1158

1159
  *(STableCfgRsp **)output = out;
122,508✔
1160

1161
  return TSDB_CODE_SUCCESS;
122,508✔
1162
}
1163

1164
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
153,088✔
1165
  if (NULL == output || NULL == msg || msgSize <= 0) {
153,088✔
1166
    qError("queryProcessGetViewMetaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1167
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1168
  }
1169

1170
  SViewMetaRsp *out = taosMemoryCalloc(1, sizeof(SViewMetaRsp));
153,088✔
1171
  if (out == NULL) {
153,088✔
1172
    return terrno;
×
1173
  }
1174
  if (tDeserializeSViewMetaRsp(msg, msgSize, out) != 0) {
153,088✔
1175
    qError("tDeserializeSViewMetaRsp failed, msgSize:%d", msgSize);
×
1176
    tFreeSViewMetaRsp(out);
×
1177
    taosMemoryFree(out);
×
1178
    return TSDB_CODE_INVALID_MSG;
×
1179
  }
1180

1181
  qDebugL("view meta recved, dbFName:%s, view:%s, querySQL:%s", out->dbFName, out->name, out->querySql);
153,088✔
1182

1183
  *(SViewMetaRsp **)output = out;
153,088✔
1184

1185
  return TSDB_CODE_SUCCESS;
153,088✔
1186
}
1187

1188
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
412,692✔
1189
  if (NULL == output || NULL == msg || msgSize <= 0) {
412,692✔
1190
    qError("queryProcessGetTbTSMARsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1191
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1192
  }
1193

1194
  if (tDeserializeTableTSMAInfoRsp(msg, msgSize, output) != 0) {
412,692✔
1195
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1196
    return TSDB_CODE_INVALID_MSG;
×
1197
  }
1198

1199
  return TSDB_CODE_SUCCESS;
412,692✔
1200
}
1201

1202
static int32_t queryProcessGetRsmaRsp(void* output, char* msg, int32_t msgSize) {
35,512✔
1203
  if (NULL == output || NULL == msg || msgSize <= 0) {
35,512✔
1204
    qError("queryProcessGetRsmaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1205
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1206
  }
1207

1208
  if (tDeserializeRsmaInfoRsp(msg, msgSize, output) != 0) {
35,512✔
1209
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1210
    return TSDB_CODE_INVALID_MSG;
×
1211
  }
1212

1213
  return TSDB_CODE_SUCCESS;
35,512✔
1214
}
1215

1216
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
412,692✔
1217
  if (!output || !msg || msgSize <= 0) {
412,692✔
1218
    qError("queryProcessStreamProgressRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1219
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1220
  }
1221

1222
  if (tDeserializeSStreamProgressRsp(msg, msgSize, output) != 0) {
412,692✔
1223
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1224
    return TSDB_CODE_INVALID_MSG;
×
1225
  }
1226
  return TSDB_CODE_SUCCESS;
412,692✔
1227
}
1228

1229
int32_t queryProcessVSubTablesRsp(void* output, char* msg, int32_t msgSize) {
×
1230
  if (!output || !msg || msgSize <= 0) {
×
1231
    qError("queryProcessVSubTablesRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1232
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1233
  }
1234

1235
  SVSubTablesRsp* pRsp = (SVSubTablesRsp*)output;
×
1236
  int32_t code = tDeserializeSVSubTablesRsp(msg, msgSize, pRsp);
×
1237
  if (code != 0) {
×
1238
    qError("tDeserializeSVSubTablesRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1239
    return code;
×
1240
  }
1241
  
1242
  return TSDB_CODE_SUCCESS;
×
1243
}
1244

1245
int32_t queryProcessVStbRefDbsRsp(void* output, char* msg, int32_t msgSize) {
140,520✔
1246
  if (!output || !msg || msgSize <= 0) {
140,520✔
1247
    qError("queryProcessVStbRefDbsRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1248
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1249
  }
1250

1251
  SVStbRefDbsRsp * pRsp = (SVStbRefDbsRsp*)output;
140,520✔
1252
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
140,520✔
1253
  if (code != 0) {
140,520✔
1254
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1255
    return code;
×
1256
  }
1257

1258
  return TSDB_CODE_SUCCESS;
140,520✔
1259
}
1260

1261
void initQueryModuleMsgHandle() {
1,305,123✔
1262
  queryBuildMsg[TMSG_INDEX(TDMT_VND_TABLE_META)] = queryBuildTableMetaReqMsg;
1,305,123✔
1263
  queryBuildMsg[TMSG_INDEX(TDMT_VND_TABLE_NAME)] = queryBuildTableMetaReqMsg;
1,305,123✔
1264
  queryBuildMsg[TMSG_INDEX(TDMT_MND_TABLE_META)] = queryBuildTableMetaReqMsg;
1,305,123✔
1265
  queryBuildMsg[TMSG_INDEX(TDMT_MND_USE_DB)] = queryBuildUseDbMsg;
1,305,123✔
1266
  queryBuildMsg[TMSG_INDEX(TDMT_MND_QNODE_LIST)] = queryBuildQnodeListMsg;
1,305,123✔
1267
  queryBuildMsg[TMSG_INDEX(TDMT_MND_DNODE_LIST)] = queryBuildDnodeListMsg;
1,305,123✔
1268
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_DB_CFG)] = queryBuildGetDBCfgMsg;
1,305,123✔
1269
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_INDEX)] = queryBuildGetIndexMsg;
1,305,123✔
1270
  queryBuildMsg[TMSG_INDEX(TDMT_MND_RETRIEVE_FUNC)] = queryBuildRetrieveFuncMsg;
1,305,123✔
1271
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_USER_AUTH)] = queryBuildGetUserAuthMsg;
1,305,123✔
1272
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_TABLE_INDEX)] = queryBuildGetTbIndexMsg;
1,305,123✔
1273
  queryBuildMsg[TMSG_INDEX(TDMT_VND_TABLE_CFG)] = queryBuildGetTbCfgMsg;
1,305,123✔
1274
  queryBuildMsg[TMSG_INDEX(TDMT_MND_TABLE_CFG)] = queryBuildGetTbCfgMsg;
1,305,123✔
1275
  queryBuildMsg[TMSG_INDEX(TDMT_MND_SERVER_VERSION)] = queryBuildGetSerVerMsg;
1,305,123✔
1276
  queryBuildMsg[TMSG_INDEX(TDMT_MND_VIEW_META)] = queryBuildGetViewMetaMsg;
1,305,123✔
1277
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_TABLE_TSMA)] = queryBuildGetTableTSMAMsg;
1,305,123✔
1278
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_TSMA)] = queryBuildGetTSMAMsg;
1,305,123✔
1279
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_RSMA)] = queryBuildGetRsmaMsg;
1,305,123✔
1280
  queryBuildMsg[TMSG_INDEX(TDMT_MND_GET_STREAM_PROGRESS)] = queryBuildGetStreamProgressMsg;
1,305,123✔
1281
  queryBuildMsg[TMSG_INDEX(TDMT_VND_VSUBTABLES_META)] = queryBuildVSubTablesMsg;
1,305,123✔
1282
  queryBuildMsg[TMSG_INDEX(TDMT_VND_VSTB_REF_DBS)] = queryBuildVStbRefDBsMsg;
1,305,123✔
1283

1284
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_TABLE_META)] = queryProcessTableMetaRsp;
1,305,123✔
1285
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_TABLE_NAME)] = queryProcessTableNameRsp;
1,305,123✔
1286
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_TABLE_META)] = queryProcessTableMetaRsp;
1,305,123✔
1287
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_USE_DB)] = queryProcessUseDBRsp;
1,305,123✔
1288
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_QNODE_LIST)] = queryProcessQnodeListRsp;
1,305,123✔
1289
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_DNODE_LIST)] = queryProcessDnodeListRsp;
1,305,123✔
1290
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_DB_CFG)] = queryProcessGetDbCfgRsp;
1,305,123✔
1291
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_INDEX)] = queryProcessGetIndexRsp;
1,305,123✔
1292
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_RETRIEVE_FUNC)] = queryProcessRetrieveFuncRsp;
1,305,123✔
1293
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_USER_AUTH)] = queryProcessGetUserAuthRsp;
1,305,123✔
1294
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_TABLE_INDEX)] = queryProcessGetTbIndexRsp;
1,305,123✔
1295
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_TABLE_CFG)] = queryProcessGetTbCfgRsp;
1,305,123✔
1296
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_TABLE_CFG)] = queryProcessGetTbCfgRsp;
1,305,123✔
1297
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_SERVER_VERSION)] = queryProcessGetSerVerRsp;
1,305,123✔
1298
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_VIEW_META)] = queryProcessGetViewMetaRsp;
1,305,123✔
1299
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_TABLE_TSMA)] = queryProcessGetTbTSMARsp;
1,305,123✔
1300
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_TSMA)] = queryProcessGetTbTSMARsp;
1,305,123✔
1301
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_RSMA)] = queryProcessGetRsmaRsp;
1,305,123✔
1302
  queryProcessMsgRsp[TMSG_INDEX(TDMT_MND_GET_STREAM_PROGRESS)] = queryProcessStreamProgressRsp;
1,305,123✔
1303
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_VSUBTABLES_META)] = queryProcessVSubTablesRsp;
1,305,123✔
1304
  queryProcessMsgRsp[TMSG_INDEX(TDMT_VND_VSTB_REF_DBS)] = queryProcessVStbRefDbsRsp;
1,305,123✔
1305
}
1,305,123✔
1306

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