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

taosdata / TDengine / #4830

31 Oct 2025 03:37AM UTC coverage: 58.792% (+9.1%) from 49.734%
#4830

push

travis-ci

SallyHuo-TAOS
Merge remote-tracking branch 'origin/cover/3.0' into cover/3.0

# Conflicts:
#	test/ci/run.sh

149913 of 324176 branches covered (46.24%)

Branch coverage included in aggregate %.

199119 of 269498 relevant lines covered (73.89%)

239518383.75 hits per line

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

39.67
/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) {
96,361,581✔
33
  QUERY_PARAM_CHECK(pOut);
96,361,581!
34
  QUERY_PARAM_CHECK(usedbRsp);
96,361,581!
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
96,361,581!
36
  pOut->dbId = usedbRsp->uid;
96,362,884✔
37

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
96,361,138✔
39
  if (NULL == pOut->dbVgroup) {
96,362,880!
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
96,362,880✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
96,361,701✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
96,362,880✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
96,361,701✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
96,361,954✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
96,361,701✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
96,360,779✔
54
    return TSDB_CODE_SUCCESS;
14,308,805✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
164,108,158✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
162,982,948✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
82,054,079!
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
82,054,079✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
114,087,387✔
84
  infoReq.option = pInput->option;
114,086,004✔
85
  infoReq.header.vgId = pInput->vgId;
114,088,162✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
114,085,874✔
87

88
  if (pInput->dbFName) {
114,085,870✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
114,083,628!
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
114,088,489!
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
114,082,800✔
94
  void   *pBuf = (*mallcFp)(bufLen);
114,080,821✔
95
  if (NULL == pBuf) {
114,083,953!
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
114,083,953✔
99
  if (ret < 0) {
114,080,750✔
100
    if (freeFp) (*freeFp)(pBuf);
52!
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
114,080,698✔
105
  *msgLen = bufLen;
114,081,823✔
106

107
  return TSDB_CODE_SUCCESS;
114,080,262✔
108
}
109

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

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

125
  int32_t bufLen = tSerializeSUseDbReq(NULL, 0, &usedbReq);
83,775,665✔
126
  void   *pBuf = (*mallcFp)(bufLen);
83,775,613✔
127
  if (NULL == pBuf) {
83,776,325!
128
    return terrno;
×
129
  }
130
  int32_t ret = tSerializeSUseDbReq(pBuf, bufLen, &usedbReq);
83,776,325✔
131
  if (ret < 0) {
83,776,377!
132
    if (freeFp) (*freeFp)(pBuf);
×
133
    return ret;
×
134
  }
135

136
  *msg = pBuf;
83,776,377✔
137
  *msgLen = bufLen;
83,776,377✔
138

139
  return TSDB_CODE_SUCCESS;
83,776,377✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
1,391,375✔
163
  *msgLen = bufLen;
1,391,375✔
164

165
  return TSDB_CODE_SUCCESS;
1,391,375✔
166
}
167

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

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

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

187
  *msg = pBuf;
743,774✔
188
  *msgLen = bufLen;
743,774✔
189

190
  return TSDB_CODE_SUCCESS;
743,774✔
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), 
6,073,437✔
218
                              void (*freeFp)(void *)) {
219
  QUERY_PARAM_CHECK(input);
6,073,437!
220
  QUERY_PARAM_CHECK(msg);
6,073,437!
221
  QUERY_PARAM_CHECK(msgLen);
6,073,437!
222

223
  SDbCfgReq dbCfgReq = {0};
6,073,437✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
6,073,437!
225

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

237
  *msg = pBuf;
6,073,437✔
238
  *msgLen = bufLen;
6,073,437✔
239

240
  return TSDB_CODE_SUCCESS;
6,073,437✔
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,
247,080✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
247,080!
272
  QUERY_PARAM_CHECK(msg);
247,080!
273
  QUERY_PARAM_CHECK(msgLen);
247,080!
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
247,080✔
301

302
  *msg = pBuf;
247,080✔
303
  *msgLen = bufLen;
247,080✔
304

305
  return TSDB_CODE_SUCCESS;
247,080✔
306
}
307

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

314
  SGetUserAuthReq req = {0};
12,588,705✔
315
  tstrncpy(req.user, input, TSDB_USER_LEN);
12,588,705!
316

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

328
  *msg = pBuf;
12,588,705✔
329
  *msgLen = bufLen;
12,588,705✔
330

331
  return TSDB_CODE_SUCCESS;
12,588,705✔
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),
414,436✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
414,436!
363
  QUERY_PARAM_CHECK(msg);
414,436!
364
  QUERY_PARAM_CHECK(msgLen);
414,436!
365

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

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

383
  *msg = pBuf;
414,436✔
384
  *msgLen = bufLen;
414,436✔
385

386
  return TSDB_CODE_SUCCESS;
414,436✔
387
}
388

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

395
  SViewMetaReq req = {0};
43,852,232✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
43,853,353!
397

398
  int32_t bufLen = tSerializeSViewMetaReq(NULL, 0, &req);
43,853,353✔
399
  void   *pBuf = (*mallcFp)(bufLen);
43,851,105✔
400
  if (NULL == pBuf) {
43,852,232!
401
    return terrno;
×
402
  }
403
  int32_t ret = tSerializeSViewMetaReq(pBuf, bufLen, &req);
43,852,232✔
404
  if (ret < 0) {
43,853,353!
405
    if (freeFp) (*freeFp)(pBuf);
×
406
    return ret;
×
407
  }
408

409
  *msg = pBuf;
43,853,353✔
410
  *msgLen = bufLen;
43,853,353✔
411

412
  return TSDB_CODE_SUCCESS;
43,852,232✔
413
}
414

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

509
  *msg = pBuf;
447,470✔
510
  *msgLen = len;
447,470✔
511
  return TSDB_CODE_SUCCESS;
447,470✔
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),
5,386,696✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
5,386,696!
542
  QUERY_PARAM_CHECK(msg);
5,386,696!
543
  QUERY_PARAM_CHECK(msgLen);
5,386,696!
544

545
  SVStbRefDbsReq req = {0};
5,386,696✔
546
  req.suid = *(int64_t*)input;
5,386,696✔
547

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

558
  *msg = pBuf;
5,386,696✔
559
  *msgLen = bufLen;
5,386,696✔
560

561
  return TSDB_CODE_SUCCESS;
5,386,696✔
562
}
563

564
int32_t queryProcessUseDBRsp(void *output, char *msg, int32_t msgSize) {
83,374,931✔
565
  SUseDbOutput *pOut = output;
83,374,931✔
566
  SUseDbRsp     usedbRsp = {0};
83,374,931✔
567
  int32_t       code = -1;
83,375,643✔
568

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
83,375,643!
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) {
83,376,355✔
576
    qError("invalid use db rsp msg, msgSize:%d", msgSize);
591!
577
    code = TSDB_CODE_INVALID_MSG;
×
578
    goto PROCESS_USEDB_OVER;
×
579
  }
580

581
  if (usedbRsp.vgNum < 0) {
83,375,764!
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);
83,375,764✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
259,166,951✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
175,790,596✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
175,791,187✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
359,700,945✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
183,909,758✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
83,376,355✔
597

598
PROCESS_USEDB_OVER:
83,376,355✔
599

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

612
static int32_t queryConvertTableMetaMsg(STableMetaRsp *pMetaMsg) {
92,451,509✔
613
  QUERY_PARAM_CHECK(pMetaMsg);
92,451,509!
614
  if (pMetaMsg->numOfTags < 0 || pMetaMsg->numOfTags > TSDB_MAX_TAGS) {
92,451,509!
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) {
92,449,986!
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 &&
92,448,520✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
22,285,336✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
637,114!
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) {
92,449,986!
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) {
92,449,986!
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) {
92,446,997!
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) {
92,451,374!
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;
92,447,189✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
127,976,082✔
655
  QUERY_PARAM_CHECK(msg);
127,976,082!
656
  QUERY_PARAM_CHECK(pMeta);
127,976,082!
657
  pMeta->vgId = msg->vgId;
127,976,082✔
658
  pMeta->tableType = msg->tableType;
127,976,959✔
659
  pMeta->uid = msg->tuid;
127,927,231✔
660
  pMeta->suid = msg->suid;
127,945,986✔
661

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

665
  return TSDB_CODE_SUCCESS;
127,974,995✔
666
}
667

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

673
  int32_t pColRefSize = sizeof(SColRef) * msg->numOfColRefs;
1,023,378✔
674

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

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

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

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

694
  *pMeta = pTableMeta;
1,023,378✔
695
  return TSDB_CODE_SUCCESS;
1,023,378✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
127,778,000✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
127,778,000✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
127,779,161✔
717
  pTableMeta->suid = msg->suid;
127,777,943✔
718
  pTableMeta->sversion = msg->sversion;
127,777,445✔
719
  pTableMeta->tversion = msg->tversion;
127,775,088✔
720
  pTableMeta->rversion = msg->rversion;
127,778,135✔
721
  if (msg->virtualStb) {
127,775,276✔
722
    pTableMeta->virtualStb = 1;
713,866✔
723
    pTableMeta->numOfColRefs = 0;
713,866✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
127,062,418✔
726
      pTableMeta->virtualStb = 1;
413,193✔
727
      pTableMeta->numOfColRefs = 0;
413,193✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
126,649,418✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
126,649,683✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
127,776,438✔
735
  pTableMeta->tableInfo.precision = msg->precision;
127,777,638✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
127,776,114✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
127,773,753!
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
127,778,131✔
740
    pTableMeta->schemaExt = pSchemaExt;
118,753,622✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
118,753,753!
742
  } else {
743
    pTableMeta->schemaExt = NULL;
9,023,313✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
127,779,331!
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
1,159,798✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
1,159,798!
749
  } else {
750
    pTableMeta->colRef = NULL;
126,618,337✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
127,778,096✔
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)) {
1,499,179✔
758
        ++pTableMeta->tableInfo.numOfPKs;
754,120✔
759
      } else {
760
        hasPK = false;
745,059✔
761
      }
762
    }
763
  }
764

765
  qDebug("tb:%s, uid:%" PRIx64 " meta returned, type:%d vgId:%d db:%s stb:%s suid:%" PRIx64
127,778,969✔
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;
127,780,492✔
773
  return TSDB_CODE_SUCCESS;
127,780,627✔
774
}
775

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

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

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

803
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
1,242,379✔
804
  pTableMeta->tableInfo.precision = msg->precision;
1,242,379✔
805
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
1,242,379✔
806

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

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

822
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
1,242,379!
823
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
4,101,049✔
824
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,858,670✔
825
    if (hasPK && (i > 0)) {
2,858,670!
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;
1,242,379✔
835
  tstrncpy(pTbName, msg->tbName, tbNameSize);
1,242,379!
836

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

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

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

863
  code = queryConvertTableMetaMsg(&metaRsp);
91,209,130✔
864
  if (code != TSDB_CODE_SUCCESS) {
91,206,141!
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
91,206,141!
869
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags)) {
83,758,163!
870
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
871
    goto PROCESS_META_OVER;
×
872
  }
873

874
  STableMetaOutput *pOut = output;
91,207,607✔
875
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
91,207,607!
876
  pOut->dbId = metaRsp.dbId;
91,207,799✔
877

878
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
91,209,130✔
879
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
24,489,772✔
880

881
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
24,488,441!
882
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
24,488,441!
883

884
    pOut->ctbMeta.vgId = metaRsp.vgId;
24,488,441✔
885
    pOut->ctbMeta.tableType = metaRsp.tableType;
24,489,772✔
886
    pOut->ctbMeta.uid = metaRsp.tuid;
24,488,441✔
887
    pOut->ctbMeta.suid = metaRsp.suid;
24,488,441✔
888

889
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
24,488,441✔
890
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
66,719,358✔
891
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
413,193✔
892

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

896
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
413,193✔
897
    if (TSDB_CODE_SUCCESS != code) {
413,193!
898
      goto PROCESS_META_OVER;
×
899
    }
900
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
413,193✔
901
  } else {
902
    SET_META_TYPE_TABLE(pOut->metaType);
66,306,165✔
903
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
66,305,004!
904
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
66,303,481✔
905
  }
906

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

912
  tFreeSTableMetaRsp(&metaRsp);
91,209,130✔
913
  return code;
91,209,130✔
914
}
915

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

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

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

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

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

946
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
1,242,379✔
947
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
378,004✔
948

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

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

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

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

981
  tFreeSTableMetaRsp(&metaRsp);
1,242,379✔
982
  return code;
1,242,379✔
983
}
984

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

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

1002
  return code;
1,391,375✔
1003
}
1004

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

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

1023
  return code;
743,774✔
1024
}
1025

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

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

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

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

1047
  return code;
×
1048
}
1049

1050
int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) {
5,049,422✔
1051
  SDbCfgRsp out = {0};
5,049,422✔
1052

1053
  if (NULL == output || NULL == msg || msgSize <= 0) {
5,049,422!
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) {
5,049,422!
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));
5,049,422✔
1064

1065
  return TSDB_CODE_SUCCESS;
5,049,422✔
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) {
232,679✔
1087
  SRetrieveFuncRsp out = {0};
232,679✔
1088

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

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

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

1110
  return TSDB_CODE_SUCCESS;
232,679✔
1111
}
1112

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

1124
  return TSDB_CODE_SUCCESS;
12,584,724✔
1125
}
1126

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

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

1139
  return TSDB_CODE_SUCCESS;
×
1140
}
1141

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

1161
  return TSDB_CODE_SUCCESS;
414,436✔
1162
}
1163

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

1183
  *(SViewMetaRsp **)output = out;
435,910✔
1184

1185
  return TSDB_CODE_SUCCESS;
435,910✔
1186
}
1187

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

1199
  return TSDB_CODE_SUCCESS;
447,470✔
1200
}
1201

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

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

1213
  return TSDB_CODE_SUCCESS;
35,420✔
1214
}
1215

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

1258
  return TSDB_CODE_SUCCESS;
5,385,255✔
1259
}
1260

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

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