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

taosdata / TDengine / #4917

07 Jan 2026 03:52PM UTC coverage: 65.42% (+0.02%) from 65.402%
#4917

push

travis-ci

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

31 of 34 new or added lines in 2 files covered. (91.18%)

819 existing lines in 129 files now uncovered.

202679 of 309814 relevant lines covered (65.42%)

116724351.99 hits per line

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

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

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

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

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

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

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

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

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

53
  if (usedbRsp->vgNum <= 0) {
22,875,203✔
54
    return TSDB_CODE_SUCCESS;
3,241,923✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
39,265,829✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
39,146,369✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
19,632,549✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
19,633,280✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
42,779,380✔
84
  infoReq.option = pInput->option;
42,779,372✔
85
  infoReq.header.vgId = pInput->vgId;
42,779,372✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
42,779,376✔
87

88
  if (pInput->dbFName) {
42,779,376✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
42,779,384✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
42,779,296✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
42,779,346✔
94
  void   *pBuf = (*mallcFp)(bufLen);
42,779,296✔
95
  if (NULL == pBuf) {
42,779,354✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
42,779,354✔
99
  if (ret < 0) {
42,779,397✔
100
    if (freeFp) (*freeFp)(pBuf);
26✔
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
42,779,371✔
105
  *msgLen = bufLen;
42,779,371✔
106

107
  return TSDB_CODE_SUCCESS;
42,779,371✔
108
}
109

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

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

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

136
  *msg = pBuf;
20,826,445✔
137
  *msgLen = bufLen;
20,826,445✔
138

139
  return TSDB_CODE_SUCCESS;
20,826,489✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
42,846✔
163
  *msgLen = bufLen;
42,846✔
164

165
  return TSDB_CODE_SUCCESS;
42,846✔
166
}
167

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

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

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

187
  *msg = pBuf;
41,660✔
188
  *msgLen = bufLen;
41,660✔
189

190
  return TSDB_CODE_SUCCESS;
41,660✔
191
}
192

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

198
  SServerVerReq req = {0};
×
199

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

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

214
  return TSDB_CODE_SUCCESS;
×
215
}
216

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

223
  SDbCfgReq dbCfgReq = {0};
7,304,502✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
7,304,598✔
225

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

237
  *msg = pBuf;
7,304,598✔
238
  *msgLen = bufLen;
7,304,598✔
239

240
  return TSDB_CODE_SUCCESS;
7,304,598✔
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,
411,553✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
411,553✔
272
  QUERY_PARAM_CHECK(msg);
411,553✔
273
  QUERY_PARAM_CHECK(msgLen);
411,553✔
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
411,553✔
301

302
  *msg = pBuf;
411,553✔
303
  *msgLen = bufLen;
411,553✔
304

305
  return TSDB_CODE_SUCCESS;
411,553✔
306
}
307

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

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

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

328
  *msg = pBuf;
5,579,770✔
329
  *msgLen = bufLen;
5,579,770✔
330

331
  return TSDB_CODE_SUCCESS;
5,579,770✔
332
}
333

334
int32_t queryBuildGetTbIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
×
335
                                void (*freeFp)(void *)) {
336
  QUERY_PARAM_CHECK(input);
×
337
  QUERY_PARAM_CHECK(msg);
×
338
  QUERY_PARAM_CHECK(msgLen);
×
339

340
  STableIndexReq indexReq = {0};
×
341
  tstrncpy(indexReq.tbFName, input, TSDB_TABLE_FNAME_LEN);
×
342

343
  int32_t bufLen = tSerializeSTableIndexReq(NULL, 0, &indexReq);
×
344
  void   *pBuf = (*mallcFp)(bufLen);
×
345
  if (NULL == pBuf) {
×
346
    return terrno;
×
347
  }
348
  int32_t ret = tSerializeSTableIndexReq(pBuf, bufLen, &indexReq);
×
349
  if (ret < 0) {
×
350
    if (freeFp) (*freeFp)(pBuf);
×
351
    return ret;
×
352
  }
353

354
  *msg = pBuf;
×
355
  *msgLen = bufLen;
×
356

357
  return TSDB_CODE_SUCCESS;
×
358
}
359

360
int32_t queryBuildGetTbCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
74,568✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
74,568✔
363
  QUERY_PARAM_CHECK(msg);
74,568✔
364
  QUERY_PARAM_CHECK(msgLen);
74,568✔
365

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

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

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

386
  return TSDB_CODE_SUCCESS;
74,568✔
387
}
388

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

395
  SViewMetaReq req = {0};
16,020,192✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
16,020,188✔
397

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

409
  *msg = pBuf;
16,020,189✔
410
  *msgLen = bufLen;
16,020,189✔
411

412
  return TSDB_CODE_SUCCESS;
16,020,189✔
413
}
414

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

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

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

435
  *msg = pBuf;
194,786✔
436
  *msgLen = bufLen;
194,786✔
437
  return TSDB_CODE_SUCCESS;
194,786✔
438
}
439

440
int32_t queryBuildGetTSMAMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
×
441
                             void (*freeFp)(void *)) {
442
  QUERY_PARAM_CHECK(input);
×
443
  QUERY_PARAM_CHECK(msg);
×
444
  QUERY_PARAM_CHECK(msgLen);
×
445

446
  STableTSMAInfoReq req = {0};
×
447
  req.fetchingWithTsmaName = true;
×
448
  tstrncpy(req.name, input, TSDB_TABLE_FNAME_LEN);
×
449

450
  int32_t bufLen = tSerializeTableTSMAInfoReq(NULL, 0, &req);
×
451
  void   *pBuf = (*mallcFp)(bufLen);
×
452
  if (pBuf == NULL) {
×
453
    return terrno;
×
454
  }
455
  int32_t ret = tSerializeTableTSMAInfoReq(pBuf, bufLen, &req);
×
456
  if (ret < 0) {
×
457
    if (freeFp) (*freeFp)(pBuf);
×
458
    return ret;
×
459
  }
460

461
  *msg = pBuf;
×
462
  *msgLen = bufLen;
×
463
  return TSDB_CODE_SUCCESS;
×
464
}
465

466
static int32_t queryBuildGetRsmaMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
21,930✔
467
                                    void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
468
  QUERY_PARAM_CHECK(input);
21,930✔
469
  QUERY_PARAM_CHECK(msg);
21,930✔
470
  QUERY_PARAM_CHECK(msgLen);
21,930✔
471

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

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

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

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

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

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

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

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

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

558
  *msg = pBuf;
707,323✔
559
  *msgLen = bufLen;
707,323✔
560

561
  return TSDB_CODE_SUCCESS;
707,323✔
562
}
563

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

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

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

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

587
  qTrace("db:%s, usedbRsp received, numOfVgroups:%d", usedbRsp.db, usedbRsp.vgNum);
20,719,949✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
68,840,065✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
48,120,116✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
48,120,116✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
98,208,811✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
50,088,695✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
20,719,949✔
597

598
PROCESS_USEDB_OVER:
20,719,949✔
599

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

608
  tFreeSUsedbRsp(&usedbRsp);
20,719,949✔
609
  return code;
20,719,949✔
610
}
611

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

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

624
  if (pMetaMsg->tableType != TSDB_SUPER_TABLE && pMetaMsg->tableType != TSDB_CHILD_TABLE &&
34,428,564✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
4,652,180✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
151,866✔
627
    qError("invalid tableType[%d] in table meta rsp msg", pMetaMsg->tableType);
×
628
    return TSDB_CODE_TSC_INVALID_VALUE;
×
629
  }
630

631
  if (pMetaMsg->sversion < 0) {
34,428,640✔
632
    qError("invalid sversion[%d] in table meta rsp msg", pMetaMsg->sversion);
×
633
    return TSDB_CODE_TSC_INVALID_VALUE;
×
634
  }
635

636
  if (pMetaMsg->tversion < 0) {
34,428,564✔
637
    qError("invalid tversion[%d] in table meta rsp msg", pMetaMsg->tversion);
×
638
    return TSDB_CODE_TSC_INVALID_VALUE;
×
639
  }
640

641
  if (pMetaMsg->rversion < 0) {
34,428,602✔
642
    qError("invalid rversion[%d] in table meta rsp msg", pMetaMsg->rversion);
×
643
    return TSDB_CODE_TSC_INVALID_VALUE;
×
644
  }
645

646
  if (pMetaMsg->pSchemas[0].colId != PRIMARYKEY_TIMESTAMP_COL_ID) {
34,428,564✔
647
    qError("invalid colId[%" PRIi16 "] for the first column in table meta rsp msg", pMetaMsg->pSchemas[0].colId);
×
648
    return TSDB_CODE_TSC_INVALID_VALUE;
×
649
  }
650

651
  return TSDB_CODE_SUCCESS;
34,428,602✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
47,296,971✔
655
  QUERY_PARAM_CHECK(msg);
47,296,971✔
656
  QUERY_PARAM_CHECK(pMeta);
47,296,971✔
657
  pMeta->vgId = msg->vgId;
47,296,971✔
658
  pMeta->tableType = msg->tableType;
47,295,027✔
659
  pMeta->uid = msg->tuid;
47,295,786✔
660
  pMeta->suid = msg->suid;
47,289,498✔
661

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

665
  return TSDB_CODE_SUCCESS;
47,295,660✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
272,953✔
695
  return TSDB_CODE_SUCCESS;
272,953✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
58,902,617✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
58,902,617✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
58,902,617✔
717
  pTableMeta->suid = msg->suid;
58,902,617✔
718
  pTableMeta->sversion = msg->sversion;
58,902,617✔
719
  pTableMeta->tversion = msg->tversion;
58,902,617✔
720
  pTableMeta->rversion = msg->rversion;
58,902,617✔
721
  pTableMeta->ownerId = msg->ownerId;
58,902,617✔
722
  if (msg->virtualStb) {
58,902,617✔
723
    pTableMeta->virtualStb = 1;
266,786✔
724
    pTableMeta->numOfColRefs = 0;
266,786✔
725
  } else {
726
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
58,635,472✔
727
      pTableMeta->virtualStb = 1;
93,675✔
728
      pTableMeta->numOfColRefs = 0;
93,675✔
729
    } else {
730
      pTableMeta->virtualStb = 0;
58,541,797✔
731
      pTableMeta->numOfColRefs = msg->numOfColRefs;
58,541,797✔
732
    }
733
  }
734

735
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
58,902,258✔
736
  pTableMeta->tableInfo.precision = msg->precision;
58,902,617✔
737
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
58,902,258✔
738

739
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
58,902,617✔
740
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
58,902,258✔
741
    pTableMeta->schemaExt = pSchemaExt;
56,753,826✔
742
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
56,753,826✔
743
  } else {
744
    pTableMeta->schemaExt = NULL;
2,148,445✔
745
  }
746

747
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
58,902,271✔
748
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
417,674✔
749
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
417,674✔
750
  } else {
751
    pTableMeta->colRef = NULL;
58,484,956✔
752
  }
753

754
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
58,902,630✔
755
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
2,147,483,647✔
756
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,147,483,647✔
757
    if (hasPK && (i > 0)) {
2,147,483,647✔
758
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
494,050✔
759
        ++pTableMeta->tableInfo.numOfPKs;
249,103✔
760
      } else {
761
        hasPK = false;
244,947✔
762
      }
763
    }
764
  }
765

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

773
  *pMeta = pTableMeta;
58,902,630✔
774
  return TSDB_CODE_SUCCESS;
58,902,630✔
775
}
776

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

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

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

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

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

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

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

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

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

846
  *pMeta = pTableMeta;
153,702✔
847
  return TSDB_CODE_SUCCESS;
153,702✔
848
}
849

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

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

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

865
  code = queryConvertTableMetaMsg(&metaRsp);
34,274,900✔
866
  if (code != TSDB_CODE_SUCCESS) {
34,274,862✔
867
    goto PROCESS_META_OVER;
×
868
  }
869

870
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
102,766,382✔
871
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
68,397,858✔
872
                    metaRsp.virtualStb);
34,122,996✔
873
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
34,274,862✔
874
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
32,637,766✔
875
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
876
    goto PROCESS_META_OVER;
×
877
  }
878

879
  STableMetaOutput *pOut = output;
34,274,900✔
880
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
34,274,900✔
881
  pOut->dbId = metaRsp.dbId;
34,274,541✔
882

883
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
34,274,900✔
884
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
11,909,889✔
885

886
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
11,909,810✔
887
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
11,909,889✔
888

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

894
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
11,909,810✔
895
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
22,365,011✔
896
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
93,675✔
897

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

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

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

917
  tFreeSTableMetaRsp(&metaRsp);
34,274,887✔
918
  return code;
34,274,900✔
919
}
920

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

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

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

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

941
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
461,106✔
942
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
307,404✔
943
                    metaRsp.virtualStb);
153,702✔
944

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

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

955
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
153,702✔
956
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
40,662✔
957

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

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

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

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

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

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

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

990
  tFreeSTableMetaRsp(&metaRsp);
153,702✔
991
  return code;
153,702✔
992
}
993

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

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

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

1011
  return code;
42,846✔
1012
}
1013

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

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

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

1030
  *(SArray **)output = out.dnodeList;
41,660✔
1031

1032
  return code;
41,660✔
1033
}
1034

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

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

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

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

1056
  return code;
×
1057
}
1058

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

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

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

1072
  memcpy(output, &out, sizeof(out));
3,666,931✔
1073

1074
  return TSDB_CODE_SUCCESS;
3,666,821✔
1075
}
1076

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

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

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

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

1092
  return TSDB_CODE_SUCCESS;
×
1093
}
1094

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

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

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

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

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

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

1119
  return TSDB_CODE_SUCCESS;
390,262✔
1120
}
1121

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

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

1133
  return TSDB_CODE_SUCCESS;
5,579,774✔
1134
}
1135

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

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

1148
  return TSDB_CODE_SUCCESS;
×
1149
}
1150

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

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

1168
  *(STableCfgRsp **)output = out;
74,568✔
1169

1170
  return TSDB_CODE_SUCCESS;
74,568✔
1171
}
1172

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

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

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

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

1194
  return TSDB_CODE_SUCCESS;
5,067✔
1195
}
1196

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

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

1208
  return TSDB_CODE_SUCCESS;
194,112✔
1209
}
1210

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

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

1222
  return TSDB_CODE_SUCCESS;
16,813✔
1223
}
1224

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

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

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

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

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

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

1267
  return TSDB_CODE_SUCCESS;
707,323✔
1268
}
1269

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

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

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

© 2026 Coveralls, Inc