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

taosdata / TDengine / #4894

22 Dec 2025 09:33AM UTC coverage: 65.72% (+0.2%) from 65.57%
#4894

push

travis-ci

web-flow
Update README.md (#34007)

* Update README.md

* docs: update table of contents and improve installation instructions in README

* docs: adjust words

---------

Signed-off-by: WANG Xu <feici02@outlook.com>
Co-authored-by: WANG Xu <feici02@outlook.com>

184394 of 280577 relevant lines covered (65.72%)

111859687.16 hits per line

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

65.2
/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) {
28,604,704✔
33
  QUERY_PARAM_CHECK(pOut);
28,604,704✔
34
  QUERY_PARAM_CHECK(usedbRsp);
28,604,704✔
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
28,604,704✔
36
  pOut->dbId = usedbRsp->uid;
28,604,704✔
37

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

43
  pOut->dbVgroup->vgVersion = usedbRsp->vgVersion;
28,604,704✔
44
  pOut->dbVgroup->hashMethod = usedbRsp->hashMethod;
28,604,704✔
45
  pOut->dbVgroup->hashPrefix = usedbRsp->hashPrefix;
28,604,704✔
46
  pOut->dbVgroup->hashSuffix = usedbRsp->hashSuffix;
28,604,704✔
47
  pOut->dbVgroup->stateTs = usedbRsp->stateTs;
28,604,704✔
48
  pOut->dbVgroup->flags = usedbRsp->flags;
28,604,704✔
49

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

53
  if (usedbRsp->vgNum <= 0) {
28,604,704✔
54
    return TSDB_CODE_SUCCESS;
4,537,751✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
48,133,906✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
47,938,425✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
24,066,953✔
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
24,066,953✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
52,971,333✔
84
  infoReq.option = pInput->option;
52,971,333✔
85
  infoReq.header.vgId = pInput->vgId;
52,971,071✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
52,971,078✔
87

88
  if (pInput->dbFName) {
52,971,078✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
52,970,816✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
52,971,588✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
52,971,333✔
94
  void   *pBuf = (*mallcFp)(bufLen);
52,970,308✔
95
  if (NULL == pBuf) {
52,971,346✔
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
52,971,346✔
99
  if (ret < 0) {
52,971,427✔
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
52,971,427✔
105
  *msgLen = bufLen;
52,971,166✔
106

107
  return TSDB_CODE_SUCCESS;
52,971,427✔
108
}
109

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

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

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

136
  *msg = pBuf;
25,640,636✔
137
  *msgLen = bufLen;
25,640,636✔
138

139
  return TSDB_CODE_SUCCESS;
25,640,636✔
140
}
141

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

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

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

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

162
  *msg = pBuf;
158,664✔
163
  *msgLen = bufLen;
158,664✔
164

165
  return TSDB_CODE_SUCCESS;
158,664✔
166
}
167

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

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

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

187
  *msg = pBuf;
123,371✔
188
  *msgLen = bufLen;
123,371✔
189

190
  return TSDB_CODE_SUCCESS;
123,371✔
191
}
192

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

198
  SServerVerReq req = {0};
×
199

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

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

214
  return TSDB_CODE_SUCCESS;
×
215
}
216

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

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

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

237
  *msg = pBuf;
1,807,804✔
238
  *msgLen = bufLen;
1,807,804✔
239

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

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
164,801✔
301

302
  *msg = pBuf;
164,801✔
303
  *msgLen = bufLen;
164,801✔
304

305
  return TSDB_CODE_SUCCESS;
164,801✔
306
}
307

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

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

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

328
  *msg = pBuf;
3,954,208✔
329
  *msgLen = bufLen;
3,954,208✔
330

331
  return TSDB_CODE_SUCCESS;
3,954,208✔
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),
128,799✔
361
                              void (*freeFp)(void *)) {
362
  QUERY_PARAM_CHECK(input);
128,799✔
363
  QUERY_PARAM_CHECK(msg);
128,799✔
364
  QUERY_PARAM_CHECK(msgLen);
128,799✔
365

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

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

383
  *msg = pBuf;
128,799✔
384
  *msgLen = bufLen;
128,799✔
385

386
  return TSDB_CODE_SUCCESS;
128,799✔
387
}
388

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

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

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

409
  *msg = pBuf;
19,086,566✔
410
  *msgLen = bufLen;
19,086,566✔
411

412
  return TSDB_CODE_SUCCESS;
19,086,566✔
413
}
414

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

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

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

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

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

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

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

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

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

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

509
  *msg = pBuf;
220,590✔
510
  *msgLen = len;
220,590✔
511
  return TSDB_CODE_SUCCESS;
220,590✔
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),
2,182,011✔
540
                                void (*freeFp)(void *)) {
541
  QUERY_PARAM_CHECK(input);
2,182,011✔
542
  QUERY_PARAM_CHECK(msg);
2,182,011✔
543
  QUERY_PARAM_CHECK(msgLen);
2,182,011✔
544

545
  SVStbRefDbsReq req = {0};
2,182,011✔
546
  req.suid = *(int64_t*)input;
2,182,011✔
547

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

558
  *msg = pBuf;
2,182,011✔
559
  *msgLen = bufLen;
2,182,011✔
560

561
  return TSDB_CODE_SUCCESS;
2,182,011✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
25,478,399✔
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) {
25,478,399✔
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) {
25,478,399✔
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);
25,478,399✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
81,367,880✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
55,889,481✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
55,889,481✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
114,190,112✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
58,300,631✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
25,478,399✔
597

598
PROCESS_USEDB_OVER:
25,478,399✔
599

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

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

619
  if (pMetaMsg->numOfColumns > TSDB_MAX_COLUMNS || pMetaMsg->numOfColumns <= 0) {
39,617,586✔
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 &&
39,618,060✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
6,573,358✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
245,312✔
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) {
39,618,677✔
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) {
39,618,677✔
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) {
39,618,677✔
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) {
39,616,893✔
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;
39,618,060✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
50,018,746✔
655
  QUERY_PARAM_CHECK(msg);
50,018,746✔
656
  QUERY_PARAM_CHECK(pMeta);
50,018,746✔
657
  pMeta->vgId = msg->vgId;
50,018,746✔
658
  pMeta->tableType = msg->tableType;
50,020,823✔
659
  pMeta->uid = msg->tuid;
50,013,936✔
660
  pMeta->suid = msg->suid;
50,012,702✔
661

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

665
  return TSDB_CODE_SUCCESS;
50,015,071✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
419,852✔
695
  return TSDB_CODE_SUCCESS;
419,852✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
52,854,858✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
52,854,858✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
52,854,858✔
717
  pTableMeta->suid = msg->suid;
52,855,332✔
718
  pTableMeta->sversion = msg->sversion;
52,854,858✔
719
  pTableMeta->tversion = msg->tversion;
52,854,858✔
720
  pTableMeta->rversion = msg->rversion;
52,855,332✔
721
  if (msg->virtualStb) {
52,855,332✔
722
    pTableMeta->virtualStb = 1;
382,946✔
723
    pTableMeta->numOfColRefs = 0;
382,946✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
52,471,912✔
726
      pTableMeta->virtualStb = 1;
165,000✔
727
      pTableMeta->numOfColRefs = 0;
165,000✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
52,306,912✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
52,307,386✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
52,854,858✔
735
  pTableMeta->tableInfo.precision = msg->precision;
52,854,858✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
52,854,858✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
52,855,332✔
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
52,854,858✔
740
    pTableMeta->schemaExt = pSchemaExt;
49,868,309✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
49,868,309✔
742
  } else {
743
    pTableMeta->schemaExt = NULL;
2,987,023✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
52,855,332✔
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
506,085✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
506,085✔
749
  } else {
750
    pTableMeta->colRef = NULL;
52,349,247✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
52,855,332✔
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)) {
559,945✔
758
        ++pTableMeta->tableInfo.numOfPKs;
281,995✔
759
      } else {
760
        hasPK = false;
277,950✔
761
      }
762
    }
763
  }
764

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

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

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

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

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

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

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

822
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
349,670✔
823
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
1,149,274✔
824
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
799,604✔
825
    if (hasPK && (i > 0)) {
799,604✔
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;
349,670✔
835
  tstrncpy(pTbName, msg->tbName, tbNameSize);
349,670✔
836

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

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

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

863
  code = queryConvertTableMetaMsg(&metaRsp);
39,269,007✔
864
  if (code != TSDB_CODE_SUCCESS) {
39,267,916✔
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
117,724,527✔
869
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
78,291,611✔
870
                    metaRsp.virtualStb);
39,023,695✔
871
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
39,267,916✔
872
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
36,951,978✔
873
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
874
    goto PROCESS_META_OVER;
×
875
  }
876

877
  STableMetaOutput *pOut = output;
39,269,007✔
878
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
39,269,007✔
879
  pOut->dbId = metaRsp.dbId;
39,268,390✔
880

881
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
39,269,007✔
882
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
13,422,660✔
883

884
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
13,422,660✔
885
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
13,422,660✔
886

887
    pOut->ctbMeta.vgId = metaRsp.vgId;
13,422,043✔
888
    pOut->ctbMeta.tableType = metaRsp.tableType;
13,421,569✔
889
    pOut->ctbMeta.uid = metaRsp.tuid;
13,421,569✔
890
    pOut->ctbMeta.suid = metaRsp.suid;
13,422,660✔
891

892
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
13,421,569✔
893
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
25,846,347✔
894
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
165,000✔
895

896
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
165,000✔
897
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
165,000✔
898

899
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
165,000✔
900
    if (TSDB_CODE_SUCCESS != code) {
165,000✔
901
      goto PROCESS_META_OVER;
×
902
    }
903
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
165,000✔
904
  } else {
905
    SET_META_TYPE_TABLE(pOut->metaType);
25,681,347✔
906
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
25,681,347✔
907
    code = queryCreateTableMetaFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
25,681,347✔
908
  }
909

910
PROCESS_META_OVER:
39,268,973✔
911
  if (code != 0) {
39,268,973✔
912
    qError("failed to process table meta rsp since %s", tstrerror(code));
×
913
  }
914

915
  tFreeSTableMetaRsp(&metaRsp);
39,268,973✔
916
  return code;
39,269,007✔
917
}
918

919
static int32_t queryProcessTableNameRsp(void *output, char *msg, int32_t msgSize) {
349,670✔
920
  int32_t       code = 0;
349,670✔
921
  STableMetaRsp metaRsp = {0};
349,670✔
922

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

929
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
349,670✔
930
    code = TSDB_CODE_INVALID_MSG;
×
931
    goto PROCESS_NAME_OVER;
×
932
  }
933

934
  code = queryConvertTableMetaMsg(&metaRsp);
349,670✔
935
  if (code != TSDB_CODE_SUCCESS) {
349,670✔
936
    goto PROCESS_NAME_OVER;
×
937
  }
938

939
  bool isVirtual = (metaRsp.tableType == TSDB_VIRTUAL_NORMAL_TABLE ||
1,049,010✔
940
                    metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE ||
699,340✔
941
                    metaRsp.virtualStb);
349,670✔
942

943
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
349,670✔
944
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags, isVirtual)) {
349,670✔
945
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
946
    goto PROCESS_NAME_OVER;
×
947
  }
948

949
  STableMetaOutput *pOut = output;
349,670✔
950
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
349,670✔
951
  pOut->dbId = metaRsp.dbId;
349,670✔
952

953
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
349,670✔
954
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
109,484✔
955

956
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
109,484✔
957
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
109,484✔
958

959
    pOut->ctbMeta.vgId = metaRsp.vgId;
109,484✔
960
    pOut->ctbMeta.tableType = metaRsp.tableType;
109,484✔
961
    pOut->ctbMeta.uid = metaRsp.tuid;
109,484✔
962
    pOut->ctbMeta.suid = metaRsp.suid;
109,484✔
963

964
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
109,484✔
965
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
240,186✔
966
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
967

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

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

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

983
PROCESS_NAME_OVER:
349,670✔
984
  if (code != 0) {
349,670✔
985
    qError("failed to process table name rsp since %s", tstrerror(code));
×
986
  }
987

988
  tFreeSTableMetaRsp(&metaRsp);
349,670✔
989
  return code;
349,670✔
990
}
991

992
int32_t queryProcessQnodeListRsp(void *output, char *msg, int32_t msgSize) {
158,664✔
993
  SQnodeListRsp out = {0};
158,664✔
994
  int32_t       code = 0;
158,664✔
995

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

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

1009
  return code;
158,664✔
1010
}
1011

1012
int32_t queryProcessDnodeListRsp(void *output, char *msg, int32_t msgSize) {
123,371✔
1013
  SDnodeListRsp out = {0};
123,371✔
1014
  int32_t       code = 0;
123,371✔
1015

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

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

1028
  *(SArray **)output = out.dnodeList;
123,371✔
1029

1030
  return code;
123,371✔
1031
}
1032

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

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

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

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

1054
  return code;
×
1055
}
1056

1057
int32_t queryProcessGetDbCfgRsp(void *output, char *msg, int32_t msgSize) {
1,510,862✔
1058
  SDbCfgRsp out = {0};
1,510,862✔
1059

1060
  if (NULL == output || NULL == msg || msgSize <= 0) {
1,510,862✔
1061
    qError("queryProcessGetDbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1062
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1063
  }
1064

1065
  if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) {
1,510,862✔
1066
    qError("tDeserializeSDbCfgRsp failed, msgSize:%d, dbCfgRsp:%lu", msgSize, sizeof(out));
×
1067
    return TSDB_CODE_INVALID_MSG;
×
1068
  }
1069

1070
  memcpy(output, &out, sizeof(out));
1,510,862✔
1071

1072
  return TSDB_CODE_SUCCESS;
1,510,862✔
1073
}
1074

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

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

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

1088
  memcpy(output, &out, sizeof(out));
×
1089

1090
  return TSDB_CODE_SUCCESS;
×
1091
}
1092

1093
int32_t queryProcessRetrieveFuncRsp(void *output, char *msg, int32_t msgSize) {
160,402✔
1094
  SRetrieveFuncRsp out = {0};
160,402✔
1095

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

1101
  if (tDeserializeSRetrieveFuncRsp(msg, msgSize, &out) != 0) {
160,402✔
1102
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1103
    return TSDB_CODE_INVALID_MSG;
×
1104
  }
1105

1106
  if (1 != out.numOfFuncs) {
160,402✔
1107
    qError("invalid func num returned, numOfFuncs:%d", out.numOfFuncs);
×
1108
    return TSDB_CODE_INVALID_MSG;
×
1109
  }
1110

1111
  SFuncInfo *funcInfo = taosArrayGet(out.pFuncInfos, 0);
160,402✔
1112

1113
  memcpy(output, funcInfo, sizeof(*funcInfo));
160,402✔
1114
  taosArrayDestroy(out.pFuncInfos);
160,402✔
1115
  taosArrayDestroy(out.pFuncExtraInfos);
160,402✔
1116

1117
  return TSDB_CODE_SUCCESS;
160,402✔
1118
}
1119

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

1126
  if (tDeserializeSGetUserAuthRsp(msg, msgSize, (SGetUserAuthRsp *)output) != 0) {
3,952,798✔
1127
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1128
    return TSDB_CODE_INVALID_MSG;
×
1129
  }
1130

1131
  return TSDB_CODE_SUCCESS;
3,952,798✔
1132
}
1133

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

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

1146
  return TSDB_CODE_SUCCESS;
×
1147
}
1148

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

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

1166
  *(STableCfgRsp **)output = out;
128,799✔
1167

1168
  return TSDB_CODE_SUCCESS;
128,799✔
1169
}
1170

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

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

1188
  qDebugL("view meta recved, dbFName:%s, view:%s, querySQL:%s", out->dbFName, out->name, out->querySql);
159,138✔
1189

1190
  *(SViewMetaRsp **)output = out;
159,138✔
1191

1192
  return TSDB_CODE_SUCCESS;
159,138✔
1193
}
1194

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

1201
  if (tDeserializeTableTSMAInfoRsp(msg, msgSize, output) != 0) {
220,590✔
1202
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1203
    return TSDB_CODE_INVALID_MSG;
×
1204
  }
1205

1206
  return TSDB_CODE_SUCCESS;
220,590✔
1207
}
1208

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

1215
  if (tDeserializeRsmaInfoRsp(msg, msgSize, output) != 0) {
18,584✔
1216
    qError("tDeserializeRsmaInfoRsp failed, msgSize:%d", msgSize);
×
1217
    return TSDB_CODE_INVALID_MSG;
×
1218
  }
1219

1220
  return TSDB_CODE_SUCCESS;
18,584✔
1221
}
1222

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

1229
  if (tDeserializeSStreamProgressRsp(msg, msgSize, output) != 0) {
220,590✔
1230
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1231
    return TSDB_CODE_INVALID_MSG;
×
1232
  }
1233
  return TSDB_CODE_SUCCESS;
220,590✔
1234
}
1235

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

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

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

1258
  SVStbRefDbsRsp * pRsp = (SVStbRefDbsRsp*)output;
2,182,011✔
1259
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
2,182,011✔
1260
  if (code != 0) {
2,182,011✔
1261
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
659✔
1262
    return code;
×
1263
  }
1264

1265
  return TSDB_CODE_SUCCESS;
2,181,352✔
1266
}
1267

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

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

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