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

taosdata / TDengine / #4817

20 Oct 2025 02:09AM UTC coverage: 61.125% (-0.05%) from 61.177%
#4817

push

travis-ci

web-flow
Merge e6f7b1ad7 into 21184b20f

155539 of 324487 branches covered (47.93%)

Branch coverage included in aggregate %.

72 of 84 new or added lines in 6 files covered. (85.71%)

476 existing lines in 111 files now uncovered.

207605 of 269610 relevant lines covered (77.0%)

126509550.12 hits per line

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

42.74
/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) {
31,937,515✔
33
  QUERY_PARAM_CHECK(pOut);
31,937,515!
34
  QUERY_PARAM_CHECK(usedbRsp);
31,937,515!
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
31,937,515!
36
  pOut->dbId = usedbRsp->uid;
31,938,382✔
37

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
31,938,382✔
39
  if (NULL == pOut->dbVgroup) {
31,937,756!
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
31,938,382✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
31,938,382✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
31,938,382✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
31,938,382✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
31,937,967✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
31,937,967✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
31,938,382✔
54
    return TSDB_CODE_SUCCESS;
4,489,938✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
54,896,888✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
54,022,446✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
27,448,444!
60
    return terrno;
×
61
  }
62

63
  for (int32_t i = 0; i < usedbRsp->vgNum; ++i) {
88,623,104✔
64
    SVgroupInfo *pVgInfo = taosArrayGet(usedbRsp->pVgroupInfos, i);
61,174,660✔
65
    pOut->dbVgroup->numOfTable += pVgInfo->numOfTable;
61,174,474✔
66
    qDebug("db:%s, vgId:%d, epNum:%d, current ep:%s:%u", usedbRsp->db, pVgInfo->vgId, pVgInfo->epSet.numOfEps,
61,174,660✔
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))) {
61,174,846!
69
      return terrno;
×
70
    }
71
  }
72

73
  return TSDB_CODE_SUCCESS;
27,448,444✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
88,360,702✔
84
  infoReq.option = pInput->option;
88,361,119✔
85
  infoReq.header.vgId = pInput->vgId;
88,360,754✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
88,360,349✔
87

88
  if (pInput->dbFName) {
88,361,921!
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
88,360,734!
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
88,360,317!
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
88,360,702✔
94
  void   *pBuf = (*mallcFp)(bufLen);
88,359,933✔
95
  if (NULL == pBuf) {
88,361,535!
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
88,361,535✔
99
  if (ret < 0) {
88,360,221!
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
88,360,221✔
105
  *msgLen = bufLen;
88,360,606✔
106

107
  return TSDB_CODE_SUCCESS;
88,361,119✔
108
}
109

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

117
  SUseDbReq usedbReq = {0};
27,648,033✔
118
  tstrncpy(usedbReq.db, pInput->db, TSDB_DB_FNAME_LEN);
27,648,033!
119
  usedbReq.db[sizeof(usedbReq.db) - 1] = 0;
27,648,033✔
120
  usedbReq.vgVersion = pInput->vgVersion;
27,648,033✔
121
  usedbReq.dbId = pInput->dbId;
27,648,033✔
122
  usedbReq.numOfTable = pInput->numOfTable;
27,647,484✔
123
  usedbReq.stateTs = pInput->stateTs;
27,648,033✔
124

125
  int32_t bufLen = tSerializeSUseDbReq(NULL, 0, &usedbReq);
27,647,520✔
126
  void   *pBuf = (*mallcFp)(bufLen);
27,647,298✔
127
  if (NULL == pBuf) {
27,648,033!
128
    return terrno;
×
129
  }
130
  int32_t ret = tSerializeSUseDbReq(pBuf, bufLen, &usedbReq);
27,648,033✔
131
  if (ret < 0) {
27,647,647!
132
    if (freeFp) (*freeFp)(pBuf);
×
133
    return ret;
×
134
  }
135

136
  *msg = pBuf;
27,647,647✔
137
  *msgLen = bufLen;
27,647,647✔
138

139
  return TSDB_CODE_SUCCESS;
27,647,647✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
254,290✔
163
  *msgLen = bufLen;
254,290✔
164

165
  return TSDB_CODE_SUCCESS;
254,290✔
166
}
167

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

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

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

187
  *msg = pBuf;
185,110✔
188
  *msgLen = bufLen;
185,110✔
189

190
  return TSDB_CODE_SUCCESS;
185,110✔
191
}
192

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

198
  SServerVerReq req = {0};
1✔
199

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

211
  *msg = pBuf;
1✔
212
  *msgLen = bufLen;
1✔
213

214
  return TSDB_CODE_SUCCESS;
1✔
215
}
216

217
int32_t queryBuildGetDBCfgMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t), 
2,009,751✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
2,009,751!
220
  QUERY_PARAM_CHECK(msg);
2,009,751!
221
  QUERY_PARAM_CHECK(msgLen);
2,009,751!
222

223
  SDbCfgReq dbCfgReq = {0};
2,009,751✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
2,009,751!
225

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

237
  *msg = pBuf;
2,009,665✔
238
  *msgLen = bufLen;
2,009,665✔
239

240
  return TSDB_CODE_SUCCESS;
2,009,665✔
241
}
242

243
int32_t queryBuildGetIndexMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t), 
1✔
244
                              void (*freeFp)(void *)) {
245
  QUERY_PARAM_CHECK(input);
1!
246
  QUERY_PARAM_CHECK(msg);
1!
247
  QUERY_PARAM_CHECK(msgLen);
1!
248

249
  SUserIndexReq indexReq = {0};
1✔
250
  tstrncpy(indexReq.indexFName, input, TSDB_INDEX_FNAME_LEN);
1!
251

252
  int32_t bufLen = tSerializeSUserIndexReq(NULL, 0, &indexReq);
1✔
253
  void   *pBuf = (*mallcFp)(bufLen);
1✔
254
  if (NULL == pBuf) {
1!
255
    return terrno;
×
256
  }
257
  int32_t ret = tSerializeSUserIndexReq(pBuf, bufLen, &indexReq);
1✔
258
  if (ret < 0) {
1!
259
    if (freeFp) (*freeFp)(pBuf);
×
260
    return ret;
×
261
  }
262

263
  *msg = pBuf;
1✔
264
  *msgLen = bufLen;
1✔
265

266
  return TSDB_CODE_SUCCESS;
1✔
267
}
268

269
int32_t queryBuildRetrieveFuncMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen,
66,735✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
66,735!
272
  QUERY_PARAM_CHECK(msg);
66,735!
273
  QUERY_PARAM_CHECK(msgLen);
66,735!
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
66,735✔
301

302
  *msg = pBuf;
66,735✔
303
  *msgLen = bufLen;
66,735✔
304

305
  return TSDB_CODE_SUCCESS;
66,735✔
306
}
307

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

314
  SGetUserAuthReq req = {0};
3,897,156✔
315
  tstrncpy(req.user, input, TSDB_USER_LEN);
3,897,573!
316

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

328
  *msg = pBuf;
3,897,573✔
329
  *msgLen = bufLen;
3,897,573✔
330

331
  return TSDB_CODE_SUCCESS;
3,897,573✔
332
}
333

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

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

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

354
  *msg = pBuf;
1✔
355
  *msgLen = bufLen;
1✔
356

357
  return TSDB_CODE_SUCCESS;
1✔
358
}
359

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

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

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

383
  *msg = pBuf;
117,952✔
384
  *msgLen = bufLen;
117,952✔
385

386
  return TSDB_CODE_SUCCESS;
117,952✔
387
}
388

389
int32_t queryBuildGetViewMetaMsg(void *input, char **msg, int32_t msgSize, int32_t *msgLen, void *(*mallcFp)(int64_t),
22,680,315✔
390
                                 void (*freeFp)(void *)) {
391
  QUERY_PARAM_CHECK(input);
22,680,315!
392
  QUERY_PARAM_CHECK(msg);
22,680,315!
393
  QUERY_PARAM_CHECK(msgLen);
22,680,315!
394

395
  SViewMetaReq req = {0};
22,680,315✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
22,680,315!
397

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

409
  *msg = pBuf;
22,680,315✔
410
  *msgLen = bufLen;
22,680,315✔
411

412
  return TSDB_CODE_SUCCESS;
22,680,315✔
413
}
414

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

421
  STableTSMAInfoReq req = {0};
129,904✔
422
  tstrncpy(req.name, input, TSDB_TABLE_FNAME_LEN);
129,904!
423

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

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

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

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

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

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

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

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

509
  *msg = pBuf;
128,576✔
510
  *msgLen = len;
128,576✔
511
  return TSDB_CODE_SUCCESS;
128,576✔
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),
1,576,911✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
1,576,911!
542
  QUERY_PARAM_CHECK(msg);
1,576,911!
543
  QUERY_PARAM_CHECK(msgLen);
1,576,911!
544

545
  SVStbRefDbsReq req = {0};
1,576,911✔
546
  req.suid = *(int64_t*)input;
1,576,911✔
547

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

558
  *msg = pBuf;
1,576,911✔
559
  *msgLen = bufLen;
1,576,911✔
560

561
  return TSDB_CODE_SUCCESS;
1,576,911✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
27,451,422!
UNCOV
570
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
UNCOV
571
    qError("invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
572
    goto PROCESS_USEDB_OVER;
×
573
  }
574

575
  if (tDeserializeSUseDbRsp(msg, msgSize, &usedbRsp) != 0) {
27,451,422!
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) {
27,451,422!
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);
27,451,422✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
83,021,285✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
55,569,863✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
55,569,863✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
112,840,225✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
57,270,362✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
27,451,422✔
597

598
PROCESS_USEDB_OVER:
27,451,422✔
599

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

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

619
  if (pMetaMsg->numOfColumns > TSDB_MAX_COLUMNS || pMetaMsg->numOfColumns <= 0) {
59,494,253!
UNCOV
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 &&
59,495,022✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
6,667,069✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
299,644!
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) {
59,495,022!
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) {
59,494,253!
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) {
59,494,253!
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) {
59,494,253!
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;
59,495,022✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
56,040,707✔
655
  QUERY_PARAM_CHECK(msg);
56,040,707!
656
  QUERY_PARAM_CHECK(pMeta);
56,040,707!
657
  pMeta->vgId = msg->vgId;
56,040,707✔
658
  pMeta->tableType = msg->tableType;
56,039,853✔
659
  pMeta->uid = msg->tuid;
56,044,218✔
660
  pMeta->suid = msg->suid;
56,029,982✔
661

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

665
  return TSDB_CODE_SUCCESS;
56,039,579✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
480,646✔
695
  return TSDB_CODE_SUCCESS;
480,646✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
70,307,888✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
70,307,888✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
70,307,119✔
717
  pTableMeta->suid = msg->suid;
70,307,888✔
718
  pTableMeta->sversion = msg->sversion;
70,307,119✔
719
  pTableMeta->tversion = msg->tversion;
70,307,119✔
720
  pTableMeta->rversion = msg->rversion;
70,307,119✔
721
  if (msg->virtualStb) {
70,307,119✔
722
    pTableMeta->virtualStb = 1;
330,734✔
723
    pTableMeta->numOfColRefs = 0;
330,734✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
69,976,385✔
726
      pTableMeta->virtualStb = 1;
194,658✔
727
      pTableMeta->numOfColRefs = 0;
194,658✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
69,782,496✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
69,782,496✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
70,307,888✔
735
  pTableMeta->tableInfo.precision = msg->precision;
70,307,888✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
70,307,888✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
70,307,888!
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
70,307,888✔
740
    pTableMeta->schemaExt = pSchemaExt;
67,225,446✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
67,225,446!
742
  } else {
743
    pTableMeta->schemaExt = NULL;
3,081,671✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
70,307,117!
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
558,922✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
558,922!
749
  } else {
750
    pTableMeta->colRef = NULL;
69,748,195✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
70,307,888!
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)) {
584,992✔
758
        ++pTableMeta->tableInfo.numOfPKs;
294,763✔
759
      } else {
760
        hasPK = false;
290,229✔
761
      }
762
    }
763
  }
764

765
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
70,307,119✔
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;
70,307,119✔
773
  return TSDB_CODE_SUCCESS;
70,307,888✔
774
}
775

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

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

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

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

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

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

822
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
473,253!
823
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
1,555,359✔
824
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
1,082,106✔
825
    if (hasPK && (i > 0)) {
1,082,106!
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;
473,253✔
835
  tstrncpy(pTbName, msg->tbName, tbNameSize);
473,253!
836

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

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

852
  if (NULL == output || NULL == msg || msgSize <= 0) {
59,021,769!
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) {
59,021,769!
859
    code = TSDB_CODE_INVALID_MSG;
×
860
    goto PROCESS_META_OVER;
×
861
  }
862

863
  code = queryConvertTableMetaMsg(&metaRsp);
59,021,769✔
864
  if (code != TSDB_CODE_SUCCESS) {
59,021,000!
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
59,021,000!
869
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags)) {
56,692,911!
870
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
871
    goto PROCESS_META_OVER;
×
872
  }
873

874
  STableMetaOutput *pOut = output;
59,021,769✔
875
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
59,021,769!
876
  pOut->dbId = metaRsp.dbId;
59,021,769✔
877

878
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
59,021,769✔
879
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
10,857,774✔
880

881
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
10,857,774!
882
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
10,857,774!
883

884
    pOut->ctbMeta.vgId = metaRsp.vgId;
10,857,774✔
885
    pOut->ctbMeta.tableType = metaRsp.tableType;
10,857,774✔
886
    pOut->ctbMeta.uid = metaRsp.tuid;
10,857,774✔
887
    pOut->ctbMeta.suid = metaRsp.suid;
10,857,774✔
888

889
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
10,857,774✔
890
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
48,163,995✔
891
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
194,658✔
892

893
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
194,658!
894
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
194,658!
895

896
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
194,658✔
897
    if (TSDB_CODE_SUCCESS != code) {
194,658!
898
      goto PROCESS_META_OVER;
×
899
    }
900
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
194,658✔
901
  } else {
902
    SET_META_TYPE_TABLE(pOut->metaType);
47,969,337✔
903
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
47,969,337!
904
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
47,968,568✔
905
  }
906

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

912
  tFreeSTableMetaRsp(&metaRsp);
59,021,769✔
913
  return code;
59,021,769✔
914
}
915

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

920
  if (NULL == output || NULL == msg || msgSize <= 0) {
473,253!
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) {
473,253!
927
    code = TSDB_CODE_INVALID_MSG;
×
928
    goto PROCESS_NAME_OVER;
×
929
  }
930

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

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

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

946
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
473,253✔
947
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
145,088✔
948

949
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
145,088!
950
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
145,088!
951

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

957
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
145,088✔
958
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
328,165!
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);
328,165✔
972
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
328,165!
973
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
328,165✔
974
  }
975

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

981
  tFreeSTableMetaRsp(&metaRsp);
473,253✔
982
  return code;
473,253✔
983
}
984

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

989
  if (NULL == output || NULL == msg || msgSize <= 0) {
254,290!
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;
254,290✔
996
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
254,290!
997
    qError("invalid qnode list rsp msg, msgSize:%d", msgSize);
×
998
    code = TSDB_CODE_INVALID_MSG;
×
999
    return code;
×
1000
  }
1001

1002
  return code;
254,290✔
1003
}
1004

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

1009
  if (NULL == output || NULL == msg || msgSize <= 0) {
185,110!
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) {
185,110!
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;
185,110✔
1022

1023
  return code;
185,110✔
1024
}
1025

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

1030
  if (NULL == output || NULL == msg || msgSize <= 0) {
1!
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) {
1!
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);
1!
1043
  if (NULL == *(char **)output) {
1!
1044
    return terrno;
×
1045
  }
1046

1047
  return code;
1✔
1048
}
1049

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

1053
  if (NULL == output || NULL == msg || msgSize <= 0) {
1,601,712!
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,601,712!
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,601,712✔
1064

1065
  return TSDB_CODE_SUCCESS;
1,601,712✔
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) {
62,854✔
1087
  SRetrieveFuncRsp out = {0};
62,854✔
1088

1089
  if (NULL == output || NULL == msg || msgSize <= 0) {
62,854!
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) {
62,854!
1095
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1096
    return TSDB_CODE_INVALID_MSG;
×
1097
  }
1098

1099
  if (1 != out.numOfFuncs) {
62,854!
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);
62,854✔
1105

1106
  memcpy(output, funcInfo, sizeof(*funcInfo));
62,854!
1107
  taosArrayDestroy(out.pFuncInfos);
62,854✔
1108
  taosArrayDestroy(out.pFuncExtraInfos);
62,854✔
1109

1110
  return TSDB_CODE_SUCCESS;
62,854✔
1111
}
1112

1113
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
3,895,797✔
1114
  if (NULL == output || NULL == msg || msgSize <= 0) {
3,895,797!
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,895,797!
1120
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1121
    return TSDB_CODE_INVALID_MSG;
×
1122
  }
1123

1124
  return TSDB_CODE_SUCCESS;
3,895,797✔
1125
}
1126

1127
int32_t queryProcessGetTbIndexRsp(void *output, char *msg, int32_t msgSize) {
1✔
1128
  if (NULL == output || NULL == msg || msgSize <= 0) {
1!
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;
1✔
1134
  if (tDeserializeSTableIndexRsp(msg, msgSize, out) != 0) {
1!
1135
    qError("tDeserializeSTableIndexRsp failed, msgSize:%d", msgSize);
×
1136
    return TSDB_CODE_INVALID_MSG;
×
1137
  }
1138

1139
  return TSDB_CODE_SUCCESS;
1✔
1140
}
1141

1142
int32_t queryProcessGetTbCfgRsp(void *output, char *msg, int32_t msgSize) {
117,952✔
1143
  if (NULL == output || NULL == msg || msgSize <= 0) {
117,952!
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));
117,952!
1149
  if(out == NULL) {
117,952!
1150
    return terrno;
×
1151
  }
1152
  if (tDeserializeSTableCfgRsp(msg, msgSize, out) != 0) {
117,952!
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;
117,952✔
1160

1161
  return TSDB_CODE_SUCCESS;
117,952✔
1162
}
1163

1164
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
187,071✔
1165
  if (NULL == output || NULL == msg || msgSize <= 0) {
187,071!
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));
187,071!
1171
  if (out == NULL) {
187,071!
1172
    return terrno;
×
1173
  }
1174
  if (tDeserializeSViewMetaRsp(msg, msgSize, out) != 0) {
187,071!
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);
187,071✔
1182

1183
  *(SViewMetaRsp **)output = out;
187,071✔
1184

1185
  return TSDB_CODE_SUCCESS;
187,071✔
1186
}
1187

1188
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
128,576✔
1189
  if (NULL == output || NULL == msg || msgSize <= 0) {
128,576!
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) {
128,576!
1195
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1196
    return TSDB_CODE_INVALID_MSG;
×
1197
  }
1198

1199
  return TSDB_CODE_SUCCESS;
128,576✔
1200
}
1201

1202
static int32_t queryProcessGetRsmaRsp(void* output, char* msg, int32_t msgSize) {
11,242✔
1203
  if (NULL == output || NULL == msg || msgSize <= 0) {
11,242!
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) {
11,242!
1209
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1210
    return TSDB_CODE_INVALID_MSG;
×
1211
  }
1212

1213
  return TSDB_CODE_SUCCESS;
11,242✔
1214
}
1215

1216
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
128,576✔
1217
  if (!output || !msg || msgSize <= 0) {
128,576!
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) {
128,576!
1223
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1224
    return TSDB_CODE_INVALID_MSG;
×
1225
  }
1226
  return TSDB_CODE_SUCCESS;
128,576✔
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) {
1,576,911✔
1246
  if (!output || !msg || msgSize <= 0) {
1,576,911!
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;
1,576,911✔
1252
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
1,576,911✔
1253
  if (code != 0) {
1,576,166!
1254
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1255
    return code;
×
1256
  }
1257

1258
  return TSDB_CODE_SUCCESS;
1,576,166✔
1259
}
1260

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

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