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

taosdata / TDengine / #4827

28 Oct 2025 01:21AM UTC coverage: 59.754% (+0.02%) from 59.732%
#4827

push

travis-ci

web-flow
test: tidy up cases on main branch(10-27) (#33381)

121341 of 258518 branches covered (46.94%)

Branch coverage included in aggregate %.

193621 of 268583 relevant lines covered (72.09%)

4339204.91 hits per line

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

37.66
/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) {
27,814✔
33
  QUERY_PARAM_CHECK(pOut);
27,814!
34
  QUERY_PARAM_CHECK(usedbRsp);
27,814!
35
  memcpy(pOut->db, usedbRsp->db, TSDB_DB_FNAME_LEN);
27,814✔
36
  pOut->dbId = usedbRsp->uid;
27,814✔
37

38
  pOut->dbVgroup = taosMemoryCalloc(1, sizeof(SDBVgInfo));
27,814!
39
  if (NULL == pOut->dbVgroup) {
27,815!
40
    return terrno;
×
41
  }
42

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

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

53
  if (usedbRsp->vgNum <= 0) {
27,815✔
54
    return TSDB_CODE_SUCCESS;
1,576✔
55
  }
56

57
  pOut->dbVgroup->vgHash =
52,477✔
58
      taosHashInit(usedbRsp->vgNum, taosGetDefaultHashFunction(TSDB_DATA_TYPE_INT), true, HASH_ENTRY_LOCK);
26,239✔
59
  if (NULL == pOut->dbVgroup->vgHash) {
26,238!
60
    return terrno;
×
61
  }
62

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

73
  return TSDB_CODE_SUCCESS;
26,239✔
74
}
75

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

83
  STableInfoReq infoReq = {0};
13,193✔
84
  infoReq.option = pInput->option;
13,193✔
85
  infoReq.header.vgId = pInput->vgId;
13,193✔
86
  infoReq.autoCreateCtb = pInput->autoCreateCtb;
13,193✔
87

88
  if (pInput->dbFName) {
13,193✔
89
    tstrncpy(infoReq.dbFName, pInput->dbFName, TSDB_DB_FNAME_LEN);
13,192✔
90
  }
91
  tstrncpy(infoReq.tbName, pInput->tbName, TSDB_TABLE_NAME_LEN);
13,193✔
92

93
  int32_t bufLen = tSerializeSTableInfoReq(NULL, 0, &infoReq);
13,193✔
94
  void   *pBuf = (*mallcFp)(bufLen);
13,193✔
95
  if (NULL == pBuf) {
13,195!
96
    return terrno;
×
97
  }
98
  int32_t ret = tSerializeSTableInfoReq(pBuf, bufLen, &infoReq);
13,195✔
99
  if (ret < 0) {
13,197!
100
    if (freeFp) (*freeFp)(pBuf);
×
101
    return ret;
×
102
  }
103

104
  *msg = pBuf;
13,197✔
105
  *msgLen = bufLen;
13,197✔
106

107
  return TSDB_CODE_SUCCESS;
13,197✔
108
}
109

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

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

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

136
  *msg = pBuf;
23,079✔
137
  *msgLen = bufLen;
23,079✔
138

139
  return TSDB_CODE_SUCCESS;
23,079✔
140
}
141

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

147
  SQnodeListReq qnodeListReq = {0};
3✔
148
  qnodeListReq.rowNum = -1;
3✔
149

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

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

162
  *msg = pBuf;
3✔
163
  *msgLen = bufLen;
3✔
164

165
  return TSDB_CODE_SUCCESS;
3✔
166
}
167

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

173
  SDnodeListReq dnodeListReq = {0};
3✔
174
  dnodeListReq.rowNum = -1;
3✔
175

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

187
  *msg = pBuf;
3✔
188
  *msgLen = bufLen;
3✔
189

190
  return TSDB_CODE_SUCCESS;
3✔
191
}
192

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

198
  SServerVerReq req = {0};
3✔
199

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

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

214
  return TSDB_CODE_SUCCESS;
3✔
215
}
216

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

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

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

237
  *msg = pBuf;
816✔
238
  *msgLen = bufLen;
816✔
239

240
  return TSDB_CODE_SUCCESS;
816✔
241
}
242

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

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

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

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

266
  return TSDB_CODE_SUCCESS;
3✔
267
}
268

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

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

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

300
  taosArrayDestroy(funcReq.pFuncNames);
11✔
301

302
  *msg = pBuf;
11✔
303
  *msgLen = bufLen;
11✔
304

305
  return TSDB_CODE_SUCCESS;
11✔
306
}
307

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

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

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

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

331
  return TSDB_CODE_SUCCESS;
3,433✔
332
}
333

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

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

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

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

357
  return TSDB_CODE_SUCCESS;
3✔
358
}
359

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

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

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

383
  *msg = pBuf;
81✔
384
  *msgLen = bufLen;
81✔
385

386
  return TSDB_CODE_SUCCESS;
81✔
387
}
388

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

395
  SViewMetaReq req = {0};
5,053✔
396
  tstrncpy(req.fullname, input, TSDB_VIEW_FNAME_LEN);
5,053✔
397

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

409
  *msg = pBuf;
5,057✔
410
  *msgLen = bufLen;
5,057✔
411

412
  return TSDB_CODE_SUCCESS;
5,057✔
413
}
414

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

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

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

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

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

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

486
  *msg = pBuf;
×
487
  *msgLen = bufLen;
×
488
  return TSDB_CODE_SUCCESS;
×
489
}
490

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

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

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

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

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

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

558
  *msg = pBuf;
3,588✔
559
  *msgLen = bufLen;
3,588✔
560

561
  return TSDB_CODE_SUCCESS;
3,588✔
562
}
563

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

569
  if (NULL == output || NULL == msg || msgSize <= 0) {
23,066!
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) {
23,066!
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) {
23,067!
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);
23,067✔
588
  for (int32_t i = 0; i < usedbRsp.vgNum; ++i) {
137,840✔
589
    SVgroupInfo *pInfo = taosArrayGet(usedbRsp.pVgroupInfos, i);
114,773✔
590
    qTrace("vgId:%d, numOfEps:%d inUse:%d ", pInfo->vgId, pInfo->epSet.numOfEps, pInfo->epSet.inUse);
114,773✔
591
    for (int32_t j = 0; j < pInfo->epSet.numOfEps; ++j) {
381,971✔
592
      qTrace("vgId:%d, index:%d epset:%s:%u", pInfo->vgId, j, pInfo->epSet.eps[j].fqdn, pInfo->epSet.eps[j].port);
267,198✔
593
    }
594
  }
595

596
  code = queryBuildUseDbOutput(pOut, &usedbRsp);
23,067✔
597

598
PROCESS_USEDB_OVER:
23,067✔
599

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

612
static int32_t queryConvertTableMetaMsg(STableMetaRsp *pMetaMsg) {
10,885✔
613
  QUERY_PARAM_CHECK(pMetaMsg);
10,885!
614
  if (pMetaMsg->numOfTags < 0 || pMetaMsg->numOfTags > TSDB_MAX_TAGS) {
10,885!
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) {
10,885!
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 &&
10,885✔
625
      pMetaMsg->tableType != TSDB_NORMAL_TABLE && pMetaMsg->tableType != TSDB_SYSTEM_TABLE &&
6,015✔
626
      pMetaMsg->tableType != TSDB_VIRTUAL_NORMAL_TABLE && pMetaMsg->tableType != TSDB_VIRTUAL_CHILD_TABLE) {
123!
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) {
10,885!
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) {
10,885!
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) {
10,885!
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) {
10,885!
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;
10,885✔
652
}
653

654
int32_t queryCreateCTableMetaFromMsg(STableMetaRsp *msg, SCTableMeta *pMeta) {
39,763✔
655
  QUERY_PARAM_CHECK(msg);
39,763!
656
  QUERY_PARAM_CHECK(pMeta);
39,763!
657
  pMeta->vgId = msg->vgId;
39,763✔
658
  pMeta->tableType = msg->tableType;
39,763✔
659
  pMeta->uid = msg->tuid;
39,763✔
660
  pMeta->suid = msg->suid;
39,763✔
661

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

665
  return TSDB_CODE_SUCCESS;
39,768✔
666
}
667

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

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

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

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

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

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

694
  *pMeta = pTableMeta;
65✔
695
  return TSDB_CODE_SUCCESS;
65✔
696
}
697

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

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

714
  pTableMeta->vgId = isStb ? 0 : msg->vgId;
13,637✔
715
  pTableMeta->tableType = isStb ? TSDB_SUPER_TABLE : msg->tableType;
13,637✔
716
  pTableMeta->uid = isStb ? msg->suid : msg->tuid;
13,637✔
717
  pTableMeta->suid = msg->suid;
13,637✔
718
  pTableMeta->sversion = msg->sversion;
13,637✔
719
  pTableMeta->tversion = msg->tversion;
13,637✔
720
  pTableMeta->rversion = msg->rversion;
13,637✔
721
  if (msg->virtualStb) {
13,637✔
722
    pTableMeta->virtualStb = 1;
102✔
723
    pTableMeta->numOfColRefs = 0;
102✔
724
  } else {
725
    if (msg->tableType == TSDB_VIRTUAL_CHILD_TABLE && isStb) {
13,535!
726
      pTableMeta->virtualStb = 1;
64✔
727
      pTableMeta->numOfColRefs = 0;
64✔
728
    } else {
729
      pTableMeta->virtualStb = 0;
13,471✔
730
      pTableMeta->numOfColRefs = msg->numOfColRefs;
13,471✔
731
    }
732
  }
733

734
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
13,637✔
735
  pTableMeta->tableInfo.precision = msg->precision;
13,637✔
736
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
13,637✔
737

738
  memcpy(pTableMeta->schema, msg->pSchemas, sizeof(SSchema) * total);
13,637✔
739
  if (withExtSchema(msg->tableType) && msg->pSchemaExt) {
13,637✔
740
    pTableMeta->schemaExt = pSchemaExt;
12,917✔
741
    memcpy(pSchemaExt, msg->pSchemaExt, schemaExtSize);
12,917✔
742
  } else {
743
    pTableMeta->schemaExt = NULL;
720✔
744
  }
745

746
  if (hasRefCol(msg->tableType) && msg->pColRefs && !isStb) {
13,637!
747
    pTableMeta->colRef = (SColRef *)((char *)pTableMeta + metaSize + schemaExtSize);
60✔
748
    memcpy(pTableMeta->colRef, msg->pColRefs, pColRefSize);
60✔
749
  } else {
750
    pTableMeta->colRef = NULL;
13,577✔
751
  }
752

753
  bool hasPK = (msg->numOfColumns > 1) && (pTableMeta->schema[1].flags & COL_IS_KEY);
13,637!
754
  for (int32_t i = 0; i < msg->numOfColumns; ++i) {
248,610✔
755
    pTableMeta->tableInfo.rowSize += pTableMeta->schema[i].bytes;
234,973✔
756
    if (hasPK && (i > 0)) {
234,973✔
757
      if ((pTableMeta->schema[i].flags & COL_IS_KEY)) {
45✔
758
        ++pTableMeta->tableInfo.numOfPKs;
40✔
759
      } else {
760
        hasPK = false;
5✔
761
      }
762
    }
763
  }
764

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

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

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

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

803
  pTableMeta->tableInfo.numOfTags = msg->numOfTags;
×
804
  pTableMeta->tableInfo.precision = msg->precision;
×
805
  pTableMeta->tableInfo.numOfColumns = msg->numOfColumns;
×
806

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

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

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

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

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

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

863
  code = queryConvertTableMetaMsg(&metaRsp);
10,885✔
864
  if (code != TSDB_CODE_SUCCESS) {
10,886!
865
    goto PROCESS_META_OVER;
×
866
  }
867

868
  if (!IS_SYS_DBNAME(metaRsp.dbFName) &&
10,886!
869
      !tIsValidSchema(metaRsp.pSchemas, metaRsp.numOfColumns, metaRsp.numOfTags)) {
10,295!
870
    code = TSDB_CODE_TSC_INVALID_VALUE;
×
871
    goto PROCESS_META_OVER;
×
872
  }
873

874
  STableMetaOutput *pOut = output;
10,886✔
875
  tstrncpy(pOut->dbFName, metaRsp.dbFName, TSDB_DB_FNAME_LEN);
10,886✔
876
  pOut->dbId = metaRsp.dbId;
10,886✔
877

878
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
10,886✔
879
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
1,374✔
880

881
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
1,374✔
882
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
1,374✔
883

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

889
    code = queryCreateTableMetaFromMsg(&metaRsp, true, &pOut->tbMeta);
1,374✔
890
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
9,512✔
891
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
64✔
892

893
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
64✔
894
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
64✔
895

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

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

912
  tFreeSTableMetaRsp(&metaRsp);
10,885✔
913
  return code;
10,885✔
914
}
915

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

920
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
921
    qError("queryProcessTableNameRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
922
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
923
    goto PROCESS_NAME_OVER;
×
924
  }
925

926
  if (tDeserializeSTableMetaRsp(msg, msgSize, &metaRsp) != 0) {
×
927
    code = TSDB_CODE_INVALID_MSG;
×
928
    goto PROCESS_NAME_OVER;
×
929
  }
930

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

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

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

946
  if (metaRsp.tableType == TSDB_CHILD_TABLE) {
×
947
    SET_META_TYPE_BOTH_TABLE(pOut->metaType);
×
948

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

952
    pOut->ctbMeta.vgId = metaRsp.vgId;
×
953
    pOut->ctbMeta.tableType = metaRsp.tableType;
×
954
    pOut->ctbMeta.uid = metaRsp.tuid;
×
955
    pOut->ctbMeta.suid = metaRsp.suid;
×
956

957
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
×
958
  } else if (metaRsp.tableType == TSDB_VIRTUAL_CHILD_TABLE) {
×
959
    SET_META_TYPE_BOTH_VTABLE(pOut->metaType);
×
960

961
    tstrncpy(pOut->ctbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
×
962
    tstrncpy(pOut->tbName, metaRsp.stbName, TSDB_TABLE_NAME_LEN);
×
963

964
    code = queryCreateVCTableMetaFromMsg(&metaRsp, &pOut->vctbMeta);
×
965
    if (TSDB_CODE_SUCCESS != code) {
×
966
      goto PROCESS_NAME_OVER;
×
967
    }
968

969
    code = queryCreateTableMetaExFromMsg(&metaRsp, true, &pOut->tbMeta);
×
970
  } else {
971
    SET_META_TYPE_TABLE(pOut->metaType);
×
972
    tstrncpy(pOut->tbName, metaRsp.tbName, TSDB_TABLE_NAME_LEN);
×
973
    code = queryCreateTableMetaExFromMsg(&metaRsp, (metaRsp.tableType == TSDB_SUPER_TABLE), &pOut->tbMeta);
×
974
  }
975

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

981
  tFreeSTableMetaRsp(&metaRsp);
×
982
  return code;
×
983
}
984

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

989
  if (NULL == output || NULL == msg || msgSize <= 0) {
3!
990
    qError("queryProcessQnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
991
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
992
    return code;
×
993
  }
994

995
  out.qnodeList = (SArray *)output;
3✔
996
  if (tDeserializeSQnodeListRsp(msg, msgSize, &out) != 0) {
3!
997
    qError("invalid qnode list rsp msg, msgSize:%d", msgSize);
×
998
    code = TSDB_CODE_INVALID_MSG;
×
999
    return code;
×
1000
  }
1001

1002
  return code;
3✔
1003
}
1004

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

1009
  if (NULL == output || NULL == msg || msgSize <= 0) {
3!
1010
    qError("queryProcessDnodeListRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1011
    code = TSDB_CODE_TSC_INVALID_INPUT;
×
1012
    return code;
×
1013
  }
1014

1015
  if (tDeserializeSDnodeListRsp(msg, msgSize, &out) != 0) {
3!
1016
    qError("invalid dnode list rsp msg, msgSize:%d", msgSize);
×
1017
    code = TSDB_CODE_INVALID_MSG;
×
1018
    return code;
×
1019
  }
1020

1021
  *(SArray **)output = out.dnodeList;
3✔
1022

1023
  return code;
3✔
1024
}
1025

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

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

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

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

1047
  return code;
3✔
1048
}
1049

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

1053
  if (NULL == output || NULL == msg || msgSize <= 0) {
807!
1054
    qError("queryProcessGetDbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1055
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1056
  }
1057

1058
  if (tDeserializeSDbCfgRsp(msg, msgSize, &out) != 0) {
807!
1059
    qError("tDeserializeSDbCfgRsp failed, msgSize:%d, dbCfgRsp:%lu", msgSize, sizeof(out));
×
1060
    return TSDB_CODE_INVALID_MSG;
×
1061
  }
1062

1063
  memcpy(output, &out, sizeof(out));
807✔
1064

1065
  return TSDB_CODE_SUCCESS;
807✔
1066
}
1067

1068
int32_t queryProcessGetIndexRsp(void *output, char *msg, int32_t msgSize) {
×
1069
  SUserIndexRsp out = {0};
×
1070

1071
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1072
    qError("queryProcessGetIndexRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1073
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1074
  }
1075

1076
  if (tDeserializeSUserIndexRsp(msg, msgSize, &out) != 0) {
×
1077
    qError("tDeserializeSUserIndexRsp failed, msgSize:%d", msgSize);
×
1078
    return TSDB_CODE_INVALID_MSG;
×
1079
  }
1080

1081
  memcpy(output, &out, sizeof(out));
×
1082

1083
  return TSDB_CODE_SUCCESS;
×
1084
}
1085

1086
int32_t queryProcessRetrieveFuncRsp(void *output, char *msg, int32_t msgSize) {
11✔
1087
  SRetrieveFuncRsp out = {0};
11✔
1088

1089
  if (NULL == output || NULL == msg || msgSize <= 0) {
11!
1090
    qError("queryProcessRetrieveFuncRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1091
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1092
  }
1093

1094
  if (tDeserializeSRetrieveFuncRsp(msg, msgSize, &out) != 0) {
11!
1095
    qError("tDeserializeSRetrieveFuncRsp failed, msgSize:%d", msgSize);
×
1096
    return TSDB_CODE_INVALID_MSG;
×
1097
  }
1098

1099
  if (1 != out.numOfFuncs) {
11!
1100
    qError("invalid func num returned, numOfFuncs:%d", out.numOfFuncs);
×
1101
    return TSDB_CODE_INVALID_MSG;
×
1102
  }
1103

1104
  SFuncInfo *funcInfo = taosArrayGet(out.pFuncInfos, 0);
11✔
1105

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

1110
  return TSDB_CODE_SUCCESS;
11✔
1111
}
1112

1113
int32_t queryProcessGetUserAuthRsp(void *output, char *msg, int32_t msgSize) {
3,433✔
1114
  if (NULL == output || NULL == msg || msgSize <= 0) {
3,433!
1115
    qError("queryProcessGetUserAuthRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1116
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1117
  }
1118

1119
  if (tDeserializeSGetUserAuthRsp(msg, msgSize, (SGetUserAuthRsp *)output) != 0) {
3,433!
1120
    qError("tDeserializeSGetUserAuthRsp failed, msgSize:%d", msgSize);
×
1121
    return TSDB_CODE_INVALID_MSG;
×
1122
  }
1123

1124
  return TSDB_CODE_SUCCESS;
3,432✔
1125
}
1126

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

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

1139
  return TSDB_CODE_SUCCESS;
3✔
1140
}
1141

1142
int32_t queryProcessGetTbCfgRsp(void *output, char *msg, int32_t msgSize) {
81✔
1143
  if (NULL == output || NULL == msg || msgSize <= 0) {
81!
1144
    qError("queryProcessGetTbCfgRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1145
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1146
  }
1147

1148
  STableCfgRsp *out = taosMemoryCalloc(1, sizeof(STableCfgRsp));
81!
1149
  if(out == NULL) {
81!
1150
    return terrno;
×
1151
  }
1152
  if (tDeserializeSTableCfgRsp(msg, msgSize, out) != 0) {
81!
1153
    qError("tDeserializeSTableCfgRsp failed, msgSize:%d", msgSize);
×
1154
    tFreeSTableCfgRsp(out);
×
1155
    taosMemoryFree(out);
×
1156
    return TSDB_CODE_INVALID_MSG;
×
1157
  }
1158

1159
  *(STableCfgRsp **)output = out;
81✔
1160

1161
  return TSDB_CODE_SUCCESS;
81✔
1162
}
1163

1164
int32_t queryProcessGetViewMetaRsp(void *output, char *msg, int32_t msgSize) {
1✔
1165
  if (NULL == output || NULL == msg || msgSize <= 0) {
1!
1166
    qError("queryProcessGetViewMetaRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1167
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1168
  }
1169

1170
  SViewMetaRsp *out = taosMemoryCalloc(1, sizeof(SViewMetaRsp));
1!
1171
  if (out == NULL) {
1!
1172
    return terrno;
×
1173
  }
1174
  if (tDeserializeSViewMetaRsp(msg, msgSize, out) != 0) {
1!
1175
    qError("tDeserializeSViewMetaRsp failed, msgSize:%d", msgSize);
×
1176
    tFreeSViewMetaRsp(out);
×
1177
    taosMemoryFree(out);
×
1178
    return TSDB_CODE_INVALID_MSG;
×
1179
  }
1180

1181
  qDebugL("view meta recved, dbFName:%s, view:%s, querySQL:%s", out->dbFName, out->name, out->querySql);
1!
1182

1183
  *(SViewMetaRsp **)output = out;
1✔
1184

1185
  return TSDB_CODE_SUCCESS;
1✔
1186
}
1187

1188
int32_t queryProcessGetTbTSMARsp(void* output, char* msg, int32_t msgSize) {
×
1189
  if (NULL == output || NULL == msg || msgSize <= 0) {
×
1190
    qError("queryProcessGetTbTSMARsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1191
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1192
  }
1193

1194
  if (tDeserializeTableTSMAInfoRsp(msg, msgSize, output) != 0) {
×
1195
    qError("tDeserializeTbTSMARsp failed, msgSize:%d", msgSize);
×
1196
    return TSDB_CODE_INVALID_MSG;
×
1197
  }
1198

1199
  return TSDB_CODE_SUCCESS;
×
1200
}
1201

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

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

1213
  return TSDB_CODE_SUCCESS;
×
1214
}
1215

1216
int32_t queryProcessStreamProgressRsp(void* output, char* msg, int32_t msgSize) {
×
1217
  if (!output || !msg || msgSize <= 0) {
×
1218
    qError("queryProcessStreamProgressRsp: invalid input param, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1219
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1220
  }
1221

1222
  if (tDeserializeSStreamProgressRsp(msg, msgSize, output) != 0) {
×
1223
    qError("tDeserializeStreamProgressRsp failed, msgSize:%d", msgSize);
×
1224
    return TSDB_CODE_INVALID_MSG;
×
1225
  }
1226
  return TSDB_CODE_SUCCESS;
×
1227
}
1228

1229
int32_t queryProcessVSubTablesRsp(void* output, char* msg, int32_t msgSize) {
×
1230
  if (!output || !msg || msgSize <= 0) {
×
1231
    qError("queryProcessVSubTablesRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1232
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1233
  }
1234

1235
  SVSubTablesRsp* pRsp = (SVSubTablesRsp*)output;
×
1236
  int32_t code = tDeserializeSVSubTablesRsp(msg, msgSize, pRsp);
×
1237
  if (code != 0) {
×
1238
    qError("tDeserializeSVSubTablesRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1239
    return code;
×
1240
  }
1241
  
1242
  return TSDB_CODE_SUCCESS;
×
1243
}
1244

1245
int32_t queryProcessVStbRefDbsRsp(void* output, char* msg, int32_t msgSize) {
3,588✔
1246
  if (!output || !msg || msgSize <= 0) {
3,588!
1247
    qError("queryProcessVStbRefDbsRsp input error, output:%p, msg:%p, msgSize:%d", output, msg, msgSize);
×
1248
    return TSDB_CODE_TSC_INVALID_INPUT;
×
1249
  }
1250

1251
  SVStbRefDbsRsp * pRsp = (SVStbRefDbsRsp*)output;
3,588✔
1252
  int32_t code = tDeserializeSVStbRefDbsRsp(msg, msgSize, pRsp);
3,588✔
1253
  if (code != 0) {
3,587!
1254
    qError("tDeserializeSVStbRefDbsRsp failed, msgSize: %d, error:%d", msgSize, code);
×
1255
    return code;
×
1256
  }
1257

1258
  return TSDB_CODE_SUCCESS;
3,587✔
1259
}
1260

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

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

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

© 2026 Coveralls, Inc