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

taosdata / TDengine / #4938

23 Jan 2026 09:40AM UTC coverage: 66.8% (+0.006%) from 66.794%
#4938

push

travis-ci

web-flow
fix: case failuer caused by the modification of the error description (#34391)

204187 of 305671 relevant lines covered (66.8%)

124015580.65 hits per line

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

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

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

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

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

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

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
26,067,865✔
39
  if (NULL == pOut->dbVgroup) {
26,068,183✔
40
    return terrno;
×
41
  }
42

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
26,067,865✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
26,068,183✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
26,068,183✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
26,067,862✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
26,067,865✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
26,068,183✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
26,068,183✔
54
    return TSDB_CODE_SUCCESS;
3,269,533✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
45,596,664✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
44,803,291✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
22,798,332✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
22,798,332✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
43,169,574✔
84
  infoReq.option = pInput->option;
43,169,628✔
85
  infoReq.header.vgId = pInput->vgId;
43,169,623✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
43,169,662✔
87

88
  if (pInput->dbFName) {
43,169,647✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
43,169,611✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
43,169,655✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
43,169,628✔
94
  void   *pBuf = (*mallcFp)(bufLen);
43,169,643✔
95
  if (NULL == pBuf) {
43,169,659✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
43,169,659✔
99
  if (ret < 0) {
43,169,647✔
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
43,169,647✔
105
  *msgLen = bufLen;
43,169,585✔
106

107
  return TSDB_CODE_SUCCESS;
43,169,621✔
108
}
109

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

117
  SUseDbReq usedbReq = {0};
21,610,485✔
118
  tstrncpy(usedbReq.db, pInput->db, TSDB_DB_FNAME_LEN);
21,610,485✔
119
  usedbReq.db[sizeof(usedbReq.db) - 1] = 0;
21,610,447✔
120
  usedbReq.vgVersion = pInput->vgVersion;
21,610,447✔
121
  usedbReq.dbId = pInput->dbId;
21,610,514✔
122
  usedbReq.numOfTable = pInput->numOfTable;
21,610,514✔
123
  usedbReq.stateTs = pInput->stateTs;
21,610,514✔
124

125
  int32_t bufLen = tSerializeSUseDbReq(NULL, 0, &usedbReq);
21,610,476✔
126
  void   *pBuf = (*mallcFp)(bufLen);
21,610,521✔
127
  if (NULL == pBuf) {
21,610,515✔
128
    return terrno;
×
129
  }
130
  int32_t ret = tSerializeSUseDbReq(pBuf, bufLen, &usedbReq);
21,610,515✔
131
  if (ret < 0) {
21,610,514✔
132
    if (freeFp) (*freeFp)(pBuf);
×
133
    return ret;
×
134
  }
135

136
  *msg = pBuf;
21,610,522✔
137
  *msgLen = bufLen;
21,610,493✔
138

139
  return TSDB_CODE_SUCCESS;
21,610,493✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
57,880✔
163
  *msgLen = bufLen;
57,880✔
164

165
  return TSDB_CODE_SUCCESS;
57,880✔
166
}
167

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

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

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

187
  *msg = pBuf;
38,476✔
188
  *msgLen = bufLen;
38,476✔
189

190
  return TSDB_CODE_SUCCESS;
38,476✔
191
}
192

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

198
  SServerVerReq req = {0};
×
199

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

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

214
  return TSDB_CODE_SUCCESS;
×
215
}
216

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

223
  SDbCfgReq dbCfgReq = {0};
7,293,604✔
224
  tstrncpy(dbCfgReq.db, input, TSDB_DB_FNAME_LEN);
7,293,609✔
225

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

237
  *msg = pBuf;
7,293,609✔
238
  *msgLen = bufLen;
7,293,609✔
239

240
  return TSDB_CODE_SUCCESS;
7,293,609✔
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,
286,999✔
270
                                  void *(*mallcFp)(int64_t), void (*freeFp)(void *)) {
271
  QUERY_PARAM_CHECK(input);
286,999✔
272
  QUERY_PARAM_CHECK(msg);
286,999✔
273
  QUERY_PARAM_CHECK(msgLen);
286,999✔
274

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
286,999✔
301

302
  *msg = pBuf;
286,999✔
303
  *msgLen = bufLen;
286,999✔
304

305
  return TSDB_CODE_SUCCESS;
286,999✔
306
}
307

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

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

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

328
  *msg = pBuf;
5,628,633✔
329
  *msgLen = bufLen;
5,628,633✔
330

331
  return TSDB_CODE_SUCCESS;
5,628,633✔
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),
78,648✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
78,648✔
363
  QUERY_PARAM_CHECK(msg);
78,648✔
364
  QUERY_PARAM_CHECK(msgLen);
78,648✔
365

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

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

383
  *msg = pBuf;
78,648✔
384
  *msgLen = bufLen;
78,648✔
385

386
  return TSDB_CODE_SUCCESS;
78,648✔
387
}
388

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

395
  SViewMetaReq req = {0};
16,162,629✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
16,162,648✔
397

398
  int32_t bufLen = tSerializeSViewMetaReq(NULL, 0, &req);
16,162,648✔
399
  void   *pBuf = (*mallcFp)(bufLen);
16,161,965✔
400
  if (NULL == pBuf) {
16,162,679✔
401
    return terrno;
×
402
  }
403
  int32_t ret = tSerializeSViewMetaReq(pBuf, bufLen, &req);
16,162,679✔
404
  if (ret < 0) {
16,162,679✔
405
    if (freeFp) (*freeFp)(pBuf);
36✔
406
    return ret;
×
407
  }
408

409
  *msg = pBuf;
16,162,643✔
410
  *msgLen = bufLen;
16,162,643✔
411

412
  return TSDB_CODE_SUCCESS;
16,162,638✔
413
}
414

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

509
  *msg = pBuf;
186,624✔
510
  *msgLen = len;
186,624✔
511
  return TSDB_CODE_SUCCESS;
186,624✔
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),
4,490,831✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
4,490,831✔
542
  QUERY_PARAM_CHECK(msg);
4,490,831✔
543
  QUERY_PARAM_CHECK(msgLen);
4,490,831✔
544

545
  SVStbRefDbsReq req = {0};
4,490,831✔
546
  req.suid = *(int64_t*)input;
4,490,831✔
547

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

558
  *msg = pBuf;
4,490,831✔
559
  *msgLen = bufLen;
4,490,831✔
560

561
  return TSDB_CODE_SUCCESS;
4,490,831✔
562
}
563

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

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

575
  if (tDeserializeSUseDbRsp(msg, msgSize, &usedbRsp) != 0) {
21,508,211✔
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) {
21,508,247✔
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);
21,508,247✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
71,028,418✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
49,520,171✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
49,520,171✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
100,890,949✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
51,370,778✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
21,508,247✔
597

598
PROCESS_USEDB_OVER:
21,508,247✔
599

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

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

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

624
  if (pMetaMsg->tableType != TSDB_SUPER_TABLE && pMetaMsg->tableType != TSDB_CHILD_TABLE &&
34,990,140✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
4,932,122✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
221,351✔
627
    qError("invalid tableType[%d] in table meta rsp msg", pMetaMsg->tableType);
×
628
    return TSDB_CODE_TSC_INVALID_VALUE;
×
629
  }
630

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

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

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

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

651
  return TSDB_CODE_SUCCESS;
34,990,753✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
49,958,787✔
655
  QUERY_PARAM_CHECK(msg);
49,958,787✔
656
  QUERY_PARAM_CHECK(pMeta);
49,958,787✔
657
  pMeta->vgId = msg->vgId;
49,958,787✔
658
  pMeta->tableType = msg->tableType;
49,953,861✔
659
  pMeta->uid = msg->tuid;
49,949,907✔
660
  pMeta->suid = msg->suid;
49,955,709✔
661

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

665
  return TSDB_CODE_SUCCESS;
49,958,494✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
345,978✔
695
  return TSDB_CODE_SUCCESS;
345,978✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
49,678,217✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
49,676,991✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
49,676,378✔
717
  pTableMeta->suid = msg->suid;
49,676,726✔
718
  pTableMeta->sversion = msg->sversion;
49,676,991✔
719
  pTableMeta->tversion = msg->tversion;
49,676,991✔
720
  pTableMeta->rversion = msg->rversion;
49,675,500✔
721
  pTableMeta->ownerId = msg->ownerId;
49,677,339✔
722
  if (msg->virtualStb) {
49,676,378✔
723
    pTableMeta->virtualStb = 1;
372,507✔
724
    pTableMeta->numOfColRefs = 0;
372,507✔
725
  } else {
726
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
49,303,836✔
727
      pTableMeta->virtualStb = 1;
133,872✔
728
      pTableMeta->numOfColRefs = 0;
133,872✔
729
    } else {
730
      pTableMeta->virtualStb = 0;
49,171,225✔
731
      pTableMeta->numOfColRefs = msg->numOfColRefs;
49,171,838✔
732
    }
733
  }
734

735
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
49,676,956✔
736
  pTableMeta->tableInfo.precision = msg->precision;
49,677,604✔
737
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
49,677,339✔
738

739
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
49,677,604✔
740
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
49,677,339✔
741
    pTableMeta->schemaExt = pSchemaExt;
47,415,910✔
742
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
47,415,945✔
743
  } else {
744
    pTableMeta->schemaExt = NULL;
2,262,307✔
745
  }
746

747
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
49,676,726✔
748
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
468,901✔
749
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
468,901✔
750
  } else {
751
    pTableMeta->colRef = NULL;
49,208,078✔
752
  }
753

754
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
49,678,205✔
755
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
2,147,483,647✔
756
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
2,147,483,647✔
757
    if (hasPK && (i > 0)) {
2,147,483,647✔
758
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
501,027✔
759
        ++pTableMeta->tableInfo.numOfPKs;
252,263✔
760
      } else {
761
        hasPK = false;
248,764✔
762
      }
763
    }
764
  }
765

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

773
  *pMeta = pTableMeta;
49,678,205✔
774
  return TSDB_CODE_SUCCESS;
49,678,205✔
775
}
776

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

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

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

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

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

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

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

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

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

846
  *pMeta = pTableMeta;
160,242✔
847
  return TSDB_CODE_SUCCESS;
160,242✔
848
}
849

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

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

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

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

870
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
104,404,090✔
871
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
69,439,695✔
872
                    metaRsp.virtualStb);
34,609,172✔
873
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
34,830,523✔
874
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
33,172,863✔
875
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
876
    goto PROCESS_META_OVER;
×
877
  }
878

879
  STableMetaOutput *pOut = output;
34,829,297✔
880
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
34,829,297✔
881
  pOut->dbId = metaRsp.dbId;
34,829,910✔
882

883
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
34,830,523✔
884
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
11,866,514✔
885

886
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
11,866,514✔
887
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
11,866,514✔
888

889
    pOut->ctbMeta.vgId = metaRsp.vgId;
11,866,514✔
890
    pOut->ctbMeta.tableType = metaRsp.tableType;
11,866,514✔
891
    pOut->ctbMeta.uid = metaRsp.tuid;
11,866,509✔
892
    pOut->ctbMeta.suid = metaRsp.suid;
11,866,514✔
893

894
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
11,866,514✔
895
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
22,964,009✔
896
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
133,872✔
897

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

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

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

917
  tFreeSTableMetaRsp(&metaRsp);
34,830,476✔
918
  return code;
34,830,523✔
919
}
920

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

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

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

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

941
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
480,726✔
942
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
320,484✔
943
                    metaRsp.virtualStb);
160,242✔
944

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

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

955
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
160,242✔
956
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
42,844✔
957

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

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

966
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
42,844✔
967
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
117,398✔
968
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
969

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

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

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

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

990
  tFreeSTableMetaRsp(&metaRsp);
160,242✔
991
  return code;
160,242✔
992
}
993

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

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

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

1011
  return code;
57,880✔
1012
}
1013

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

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

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

1030
  *(SArray **)output = out.dnodeList;
38,476✔
1031

1032
  return code;
38,476✔
1033
}
1034

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

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

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

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

1056
  return code;
×
1057
}
1058

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

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

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

1072
  memcpy(output, &out, sizeof(out));
3,691,630✔
1073

1074
  return TSDB_CODE_SUCCESS;
3,691,630✔
1075
}
1076

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

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

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

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

1092
  return TSDB_CODE_SUCCESS;
×
1093
}
1094

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

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

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

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

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

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

1119
  return TSDB_CODE_SUCCESS;
272,796✔
1120
}
1121

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

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

1133
  return TSDB_CODE_SUCCESS;
5,628,633✔
1134
}
1135

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

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

1148
  return TSDB_CODE_SUCCESS;
×
1149
}
1150

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

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

1168
  *(STableCfgRsp **)output = out;
78,648✔
1169

1170
  return TSDB_CODE_SUCCESS;
78,648✔
1171
}
1172

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

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

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

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

1194
  return TSDB_CODE_SUCCESS;
5,981✔
1195
}
1196

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

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

1208
  return TSDB_CODE_SUCCESS;
186,624✔
1209
}
1210

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

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

1222
  return TSDB_CODE_SUCCESS;
16,445✔
1223
}
1224

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

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

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

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

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

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

1267
  return TSDB_CODE_SUCCESS;
4,480,948✔
1268
}
1269

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

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

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

© 2026 Coveralls, Inc