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

taosdata / TDengine / #5073

17 May 2026 01:15AM UTC coverage: 73.317% (+0.02%) from 73.298%
#5073

push

travis-ci

web-flow
feat (TDgpt): Dynamic Model Synchronization Enhancements (#35344)

* refactor: do some internal refactor.

* fix: fix multiprocess sync issue.

* feat: add dynamic anomaly detection and forecasting services

* fix: log error message for undeploying model in exception handling

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix: handle undeploy when model exists only on disk

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/286aafa0-c3ce-4c27-b803-2707571e9dc1

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: guard dynamic registry concurrent access

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/5e4db858-6458-40f4-ac28-d1b1b7f97c18

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: tighten service list locking scope

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/5e4db858-6458-40f4-ac28-d1b1b7f97c18

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: restore prophet support and update tests per review feedback

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/92298ae1-7da6-4d07-b20e-101c7cd0b26b

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* fix: improve test name and move copy inside lock scope

Agent-Logs-Url: https://github.com/taosdata/TDengine/sessions/92298ae1-7da6-4d07-b20e-101c7cd0b26b

Co-authored-by: hjxilinx <8252296+hjxilinx@users.noreply.github.com>

* Potential fix for pull request finding

Co-au... (continued)

281387 of 383795 relevant lines covered (73.32%)

138791003.92 hits per line

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

81.3
/source/libs/executor/src/querytask.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 "filter.h"
17
#include "function.h"
18
#include "functionMgt.h"
19
#include "os.h"
20
#include "querynodes.h"
21
#include "tfill.h"
22
#include "tname.h"
23

24
#include "tdatablock.h"
25
#include "tmsg.h"
26
#include "streamMsg.h"
27

28
#include "executorInt.h"
29
#include "index.h"
30
#include "operator.h"
31
#include "query.h"
32
#include "querytask.h"
33
#include "storageapi.h"
34
#include "thash.h"
35
#include "ttypes.h"
36
#include "tref.h"
37

38
#define CLEAR_QUERY_STATUS(q, st) ((q)->status &= (~(st)))
39

40
int32_t doCreateTask(uint64_t queryId, uint64_t taskId, int32_t vgId, EOPTR_EXEC_MODEL model, SStorageAPI* pAPI,
430,251,366✔
41
                     SExecTaskInfo** pTaskInfo) {
42
  if (pTaskInfo == NULL) {
430,251,366✔
43
    return TSDB_CODE_SUCCESS;
×
44
  }
45

46
  SExecTaskInfo* p = taosMemoryCalloc(1, sizeof(SExecTaskInfo));
430,251,366✔
47
  if (p == NULL) {
430,255,689✔
48
    return terrno;
×
49
  }
50

51
  setTaskStatus(p, TASK_NOT_COMPLETED);
430,255,689✔
52
  p->cost.created = taosGetTimestampUs();
430,284,790✔
53

54
  p->execModel = model;
430,268,401✔
55
  p->stopInfo.pStopInfo = taosArrayInit(4, sizeof(SExchangeOpStopInfo));
430,241,324✔
56
  p->pResultBlockList = taosArrayInit(128, POINTER_BYTES);
430,210,183✔
57
  if (p->stopInfo.pStopInfo == NULL || p->pResultBlockList == NULL) {
430,146,791✔
58
    doDestroyTask(p);
1,894✔
59
    return terrno;
×
60
  }
61

62
  p->storageAPI = *pAPI;
430,172,064✔
63
  taosInitRWLatch(&p->lock);
430,176,505✔
64

65
  p->id.vgId = vgId;
430,178,820✔
66
  p->id.queryId = queryId;
430,169,073✔
67
  p->id.taskId = taskId;
430,213,404✔
68
  p->id.str = taosMemoryMalloc(64);
430,227,449✔
69
  if (p->id.str == NULL) {
430,054,120✔
70
    doDestroyTask(p);
×
71
    return terrno;
×
72
  }
73

74
  buildTaskId(taskId, queryId, p->id.str, 64);
430,145,236✔
75
  p->schemaInfos = taosArrayInit(1, sizeof(SSchemaInfo));
430,118,487✔
76
  if (p->id.str == NULL || p->schemaInfos == NULL) {
429,831,246✔
77
    doDestroyTask(p);
113✔
78
    return terrno;
×
79
  }
80

81
  *pTaskInfo = p;
429,918,006✔
82
  return TSDB_CODE_SUCCESS;
429,832,821✔
83
}
84

85
int32_t getTaskCode(void* pTaskInfo) { return ((SExecTaskInfo*)pTaskInfo)->code; }
603✔
86

87
bool isTaskKilled(void* pTaskInfo) { return (0 != ((SExecTaskInfo*)pTaskInfo)->code); }
2,147,483,647✔
88

89
void setTaskKilled(SExecTaskInfo* pTaskInfo, int32_t rspCode) {
75,983✔
90
  pTaskInfo->code = rspCode;
75,983✔
91
  (void)stopTableScanOperator(pTaskInfo->pRoot, pTaskInfo->id.str, &pTaskInfo->storageAPI);
75,983✔
92
}
75,983✔
93

94
void setTaskStatus(SExecTaskInfo* pTaskInfo, int8_t status) {
1,466,034,016✔
95
  if (status == TASK_NOT_COMPLETED) {
1,466,034,016✔
96
    pTaskInfo->status = status;
430,452,662✔
97
  } else {
98
    // QUERY_NOT_COMPLETED is not compatible with any other status, so clear its position first
99
    CLEAR_QUERY_STATUS(pTaskInfo, TASK_NOT_COMPLETED);
1,035,581,354✔
100
    pTaskInfo->status |= status;
1,035,771,620✔
101
  }
102
}
1,466,246,394✔
103

104

105
int32_t initTaskSubJobCtx(SExecTaskInfo* pTaskInfo, SArray** subEndPoints, SReadHandle* readHandle) {
46,604,207✔
106
  int32_t code = 0, lino = 0;
46,604,207✔
107
  int32_t subJobNum = taosArrayGetSize(*subEndPoints);
46,604,207✔
108
  
109
  pTaskInfo->pSubJobCtx = taosMemoryCalloc(1, sizeof(*pTaskInfo->pSubJobCtx));
46,610,670✔
110
  TSDB_CHECK_NULL(pTaskInfo->pSubJobCtx, code, lino, _exit, terrno);
46,598,190✔
111
  
112
  STaskSubJobCtx* ctx = pTaskInfo->pSubJobCtx;
46,597,578✔
113

114
  ctx->queryId = pTaskInfo->id.queryId;
46,600,598✔
115
  ctx->taskId = pTaskInfo->id.taskId;
46,604,640✔
116
  ctx->idStr = pTaskInfo->id.str;
46,600,589✔
117
  ctx->pTaskInfo = pTaskInfo;
46,603,622✔
118
  ctx->subEndPoints = *subEndPoints;
46,601,201✔
119
  ctx->rpcHandle = (readHandle && readHandle->pMsgCb) ? readHandle->pMsgCb->clientRpc : NULL;
46,600,763✔
120
  ctx->isStream = pTaskInfo && IS_STREAM_MODE(pTaskInfo);
46,614,287✔
121

122
  *subEndPoints = NULL;
46,609,463✔
123
  
124
  ctx->subResNodes = taosArrayInit_s(POINTER_BYTES, subJobNum);
46,610,062✔
125
  if (NULL == ctx->subResNodes) {
46,606,766✔
126
    qError("%s taosArrayInit_s %d subResNodes failed, error:%s", GET_TASKID(pTaskInfo), subJobNum, tstrerror(terrno));
×
127
    TSDB_CHECK_NULL(ctx->subResNodes, code, lino, _exit, terrno);
×
128
  }
129
  
130
  TAOS_CHECK_EXIT(tsem_init(&ctx->ready, 0, 0));
46,604,193✔
131

132
  int64_t refId = taosAddRef(fetchObjRefPool, ctx);
46,592,772✔
133
  if (refId < 0) {
46,614,614✔
134
    qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(terrno));
×
135
    TAOS_CHECK_EXIT(terrno);
×
136
  }
137
  
138
  ctx->subJobRefId = refId;
46,614,614✔
139

140
  qDebug("%s subJobCtx %" PRIu64 " with %d endPoints inited", pTaskInfo->id.str, (uint64_t)refId, (int32_t)taosArrayGetSize(ctx->subEndPoints));
46,597,748✔
141

142
_exit:
45,391,631✔
143

144
  if (code) {
46,595,613✔
145
    destroySubJobCtx(pTaskInfo->pSubJobCtx);
×
146
    pTaskInfo->pSubJobCtx = NULL;
×
147
    
148
    qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
×
149
  }
150

151
  return code;
46,596,216✔
152
}
153

154

155

156
int32_t createExecTaskInfo(SSubplan* pPlan, SExecTaskInfo** pTaskInfo, SReadHandle* pHandle, uint64_t taskId,
430,099,425✔
157
                           int32_t vgId, char* sql, EOPTR_EXEC_MODEL model, SArray** subEndPoints, bool enableExplain) {
158
  int32_t code = doCreateTask(pPlan->id.queryId, taskId, vgId, model, &pHandle->api, pTaskInfo);
430,099,425✔
159
  if (*pTaskInfo == NULL || code != 0) {
429,721,994✔
160
    nodesDestroyNode((SNode*)pPlan);
14✔
161
    return code;
×
162
  }
163

164
  (*pTaskInfo)->pSubplan = pPlan;
429,805,638✔
165

166
  if (NULL != sql) {
429,738,191✔
167
    (*pTaskInfo)->sql = taosStrdup(sql);
401,377,978✔
168
    if (NULL == (*pTaskInfo)->sql) {
401,370,584✔
169
      code = terrno;
×
170
      doDestroyTask(*pTaskInfo);
×
171
      (*pTaskInfo) = NULL;
×
172
      return code;
×
173
    }
174
  }
175

176
  (*pTaskInfo)->pWorkerCb = pHandle->pWorkerCb;
429,778,670✔
177
  (*pTaskInfo)->pStreamRuntimeInfo = pHandle->streamRtInfo;
429,896,042✔
178
  (*pTaskInfo)->enableExplain = enableExplain;
429,779,506✔
179

180
  if (subEndPoints && taosArrayGetSize(*subEndPoints) > 0) {
429,784,157✔
181
    code = initTaskSubJobCtx(*pTaskInfo, subEndPoints, pHandle);
46,613,243✔
182
    if (code != TSDB_CODE_SUCCESS) {
46,601,031✔
183
      doDestroyTask(*pTaskInfo);
×
184
      (*pTaskInfo) = NULL;
×
185
      return code;
×
186
    }
187
  }
188
  
189
  setTaskScalarExtraInfo(*pTaskInfo);
429,853,110✔
190
  
191
  code = createOperator(pPlan->pNode, *pTaskInfo, pHandle, pPlan->pTagCond, pPlan->pTagIndexCond, pPlan->user,
429,351,479✔
192
                        pPlan->dbFName, &((*pTaskInfo)->pRoot), model);
429,059,950✔
193

194
  if (NULL == (*pTaskInfo)->pRoot || code != 0) {
428,773,046✔
195
    doDestroyTask(*pTaskInfo);
1,588,609✔
196
    (*pTaskInfo) = NULL;
518,359✔
197
  }
198
  return code;
428,091,740✔
199
}
200

201
void cleanupQueriedTableScanInfo(void* p) {
308,714,752✔
202
  SSchemaInfo* pSchemaInfo = p;
308,714,752✔
203

204
  taosMemoryFreeClear(pSchemaInfo->dbname);
308,714,752✔
205
  taosMemoryFreeClear(pSchemaInfo->tablename);
308,687,729✔
206
  tDeleteSchemaWrapper(pSchemaInfo->sw);
308,610,914✔
207
  tDeleteSchemaWrapper(pSchemaInfo->qsw);
308,751,452✔
208
}
308,694,515✔
209

210
int32_t initQueriedTableSchemaInfo(SReadHandle* pHandle, SScanPhysiNode* pScanNode, const char* dbName,
308,959,044✔
211
                                   SExecTaskInfo* pTaskInfo) {
212
  SMetaReader mr = {0};
308,959,044✔
213
  if (pHandle == NULL) {
309,011,086✔
214
    return TSDB_CODE_INVALID_PARA;
×
215
  }
216

217
  SStorageAPI* pAPI = &pTaskInfo->storageAPI;
309,011,086✔
218

219
  pAPI->metaReaderFn.initReader(&mr, pHandle->vnode, META_READER_LOCK, &pAPI->metaFn);
309,015,138✔
220
  int32_t code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, pScanNode->uid);
309,068,678✔
221
  if (code != TSDB_CODE_SUCCESS) {
307,946,723✔
222
    qError("failed to get the table meta, uid:0x%" PRIx64 ", suid:0x%" PRIx64 ", %s", pScanNode->uid, pScanNode->suid,
×
223
           GET_TASKID(pTaskInfo));
224

225
    pAPI->metaReaderFn.clearReader(&mr);
×
226
    return code;
×
227
  }
228

229
  SSchemaInfo schemaInfo = {0};
307,946,723✔
230

231
  schemaInfo.tablename = taosStrdup(mr.me.name);
307,692,081✔
232
  schemaInfo.dbname = taosStrdup(dbName);
308,105,334✔
233
  if (schemaInfo.tablename == NULL || schemaInfo.dbname == NULL) {
308,474,378✔
234
    pAPI->metaReaderFn.clearReader(&mr);
884,614✔
235
    cleanupQueriedTableScanInfo(&schemaInfo);
×
236
    return terrno;
×
237
  }
238

239
  if (mr.me.type == TSDB_VIRTUAL_NORMAL_TABLE || mr.me.type == TSDB_VIRTUAL_CHILD_TABLE) {
307,589,764✔
240
    schemaInfo.rversion = mr.me.colRef.version;
330,094✔
241
  }
242

243
  if (mr.me.type == TSDB_SUPER_TABLE) {
307,589,764✔
244
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.stbEntry.schemaRow);
139,530,635✔
245
    schemaInfo.tversion = mr.me.stbEntry.schemaTag.version;
139,530,635✔
246
  } else if (mr.me.type == TSDB_CHILD_TABLE || mr.me.type == TSDB_VIRTUAL_CHILD_TABLE) {
168,700,682✔
247
    tDecoderClear(&mr.coder);
119,469,214✔
248

249
    tb_uid_t suid = mr.me.ctbEntry.suid;
119,460,003✔
250
    code = pAPI->metaReaderFn.getEntryGetUidCache(&mr, suid);
119,460,003✔
251
    if (code != TSDB_CODE_SUCCESS) {
119,464,458✔
252
      pAPI->metaReaderFn.clearReader(&mr);
×
253
      cleanupQueriedTableScanInfo(&schemaInfo);
×
254
      return code;
×
255
    }
256

257
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.stbEntry.schemaRow);
119,457,889✔
258
    schemaInfo.tversion = mr.me.stbEntry.schemaTag.version;
119,457,889✔
259
  } else {
260
    schemaInfo.sw = tCloneSSchemaWrapper(&mr.me.ntbEntry.schemaRow);
49,324,873✔
261
  }
262

263
  pAPI->metaReaderFn.clearReader(&mr);
308,313,397✔
264

265
  if (schemaInfo.sw == NULL) {
307,896,486✔
266
    cleanupQueriedTableScanInfo(&schemaInfo);
×
267
    return terrno;
×
268
  }
269

270
  schemaInfo.qsw = extractQueriedColumnSchema(pScanNode);
307,896,486✔
271
  if (schemaInfo.qsw == NULL) {
308,167,112✔
272
    cleanupQueriedTableScanInfo(&schemaInfo);
×
273
    return terrno;
×
274
  }
275

276
  void* p = taosArrayPush(pTaskInfo->schemaInfos, &schemaInfo);
308,167,112✔
277
  if (p == NULL) {
308,765,219✔
278
    cleanupQueriedTableScanInfo(&schemaInfo);
×
279
    return terrno;
×
280
  }
281

282
  return code;
308,765,219✔
283
}
284

285
SSchemaWrapper* extractQueriedColumnSchema(SScanPhysiNode* pScanNode) {
307,884,524✔
286
  int32_t numOfCols = LIST_LENGTH(pScanNode->pScanCols);
307,884,524✔
287
  int32_t numOfTags = LIST_LENGTH(pScanNode->pScanPseudoCols);
308,642,089✔
288

289
  SSchemaWrapper* pqSw = taosMemoryCalloc(1, sizeof(SSchemaWrapper));
308,223,162✔
290
  if (pqSw == NULL) {
307,663,038✔
291
    return NULL;
×
292
  }
293

294
  pqSw->pSchema = taosMemoryCalloc(numOfCols + numOfTags, sizeof(SSchema));
307,663,038✔
295
  if (pqSw->pSchema == NULL) {
306,936,130✔
296
    taosMemoryFree(pqSw);
×
297
    return NULL;
×
298
  }
299

300
  for (int32_t i = 0; i < numOfCols; ++i) {
1,383,553,609✔
301
    STargetNode* pNode = (STargetNode*)nodesListGetNode(pScanNode->pScanCols, i);
1,074,789,630✔
302
    SColumnNode* pColNode = (SColumnNode*)pNode->pExpr;
1,074,350,097✔
303

304
    SSchema* pSchema = &pqSw->pSchema[pqSw->nCols++];
1,074,661,659✔
305
    pSchema->colId = pColNode->colId;
1,074,893,636✔
306
    pSchema->type = pColNode->node.resType.type;
1,075,570,231✔
307
    pSchema->bytes = pColNode->node.resType.bytes;
1,075,506,118✔
308
    tstrncpy(pSchema->name, pColNode->colName, tListLen(pSchema->name));
1,075,401,379✔
309
  }
310

311
  // this the tags and pseudo function columns, we only keep the tag columns
312
  for (int32_t i = 0; i < numOfTags; ++i) {
509,231,486✔
313
    STargetNode* pNode = (STargetNode*)nodesListGetNode(pScanNode->pScanPseudoCols, i);
200,270,820✔
314

315
    int32_t type = nodeType(pNode->pExpr);
200,356,716✔
316
    if (type == QUERY_NODE_COLUMN) {
200,448,674✔
317
      SColumnNode* pColNode = (SColumnNode*)pNode->pExpr;
151,747,494✔
318

319
      SSchema* pSchema = &pqSw->pSchema[pqSw->nCols++];
151,754,521✔
320
      pSchema->colId = pColNode->colId;
151,674,194✔
321
      pSchema->type = pColNode->node.resType.type;
151,574,842✔
322
      pSchema->bytes = pColNode->node.resType.bytes;
151,363,374✔
323
      tstrncpy(pSchema->name, pColNode->colName, tListLen(pSchema->name));
151,530,555✔
324
    }
325
  }
326

327
  return pqSw;
308,960,666✔
328
}
329

330
static void cleanupTmqInfo(STmqTaskInfo* pTmqInfo) {
429,682,800✔
331
  tDeleteSchemaWrapper(pTmqInfo->schema);
429,682,800✔
332
  tOffsetDestroy(&pTmqInfo->currentOffset);
429,851,292✔
333
}
429,314,312✔
334

335
static void freeBlock(void* pParam) {
726,262,828✔
336
  SSDataBlock* pBlock = *(SSDataBlock**)pParam;
726,262,828✔
337
  blockDataDestroy(pBlock);
726,340,753✔
338
}
726,405,540✔
339

340

341
void destroySubJobCtx(STaskSubJobCtx* pCtx) {
46,605,270✔
342
  if (pCtx->transporterId > 0) {
46,605,270✔
343
    int32_t ret = asyncFreeConnById(pCtx->rpcHandle, pCtx->transporterId);
×
344
    if (ret != 0) {
×
345
      qDebug("%s failed to free subQ rpc handle, code:%s", pCtx->idStr, tstrerror(ret));
×
346
    }
347
    pCtx->transporterId = -1;
×
348
  }
349

350
  if (pCtx->subEndPoints != NULL) {
46,612,470✔
351
    size_t size = taosArrayGetSize(pCtx->subEndPoints);
46,616,691✔
352
    if (size > 0) {
46,616,691✔
353
      int32_t code = tsem_destroy(&pCtx->ready);
46,616,691✔
354
      if (code != TSDB_CODE_SUCCESS) {
46,611,885✔
355
        qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
×
356
      }
357
      taosArrayDestroy(pCtx->subResNodes);
46,611,885✔
358
    }
359
    if (pCtx->isStream) {
46,611,273✔
360
      taosArrayDestroyP(pCtx->subEndPoints, (FDelete)nodesDestroyNode);
269,439✔
361
    } else {
362
      taosArrayDestroyP(pCtx->subEndPoints, NULL);
46,342,437✔
363
    }
364
    pCtx->subEndPoints = NULL;
46,607,655✔
365
  }
366
  
367
  taosMemoryFreeClear(pCtx);  
46,604,658✔
368
}
46,603,452✔
369

370
void doDestroyTask(SExecTaskInfo* pTaskInfo) {
430,299,423✔
371
  qDebug("%s execTask is freed", GET_TASKID(pTaskInfo));
430,299,423✔
372
  destroyOperator(pTaskInfo->pRoot);
430,299,552✔
373
  pTaskInfo->pRoot = NULL;
429,823,449✔
374

375
  if (pTaskInfo->pSubJobCtx) {
429,982,791✔
376
    int32_t  code = taosRemoveRef(fetchObjRefPool, pTaskInfo->pSubJobCtx->subJobRefId);
46,614,288✔
377
    if (code != TSDB_CODE_SUCCESS) {
46,611,894✔
378
      qError("%s failed at line %d since %s", __func__, __LINE__, tstrerror(code));
×
379
    }
380
  }
381

382
  taosArrayDestroyEx(pTaskInfo->schemaInfos, cleanupQueriedTableScanInfo);
430,101,254✔
383
  cleanupTmqInfo(&pTaskInfo->tmqInfo);
429,823,063✔
384

385
  if (!pTaskInfo->localFetch.localExec) {
429,304,155✔
386
    nodesDestroyNode((SNode*)pTaskInfo->pSubplan);
429,427,286✔
387
    pTaskInfo->pSubplan = NULL;
430,018,899✔
388
  }
389

390
  taosArrayDestroyEx(pTaskInfo->pResultBlockList, freeBlock);
430,032,291✔
391
  taosArrayDestroy(pTaskInfo->stopInfo.pStopInfo);
430,034,251✔
392
  if (!pTaskInfo->paramSet) {
429,992,887✔
393
    freeOperatorParam(pTaskInfo->pOpParam, OP_GET_PARAM);
416,927,360✔
394
    pTaskInfo->pOpParam = NULL;
416,476,291✔
395
  }
396
  if (pTaskInfo->ownStreamRtInfo && pTaskInfo->pStreamRuntimeInfo != NULL) {
429,421,928✔
397
    SStreamRuntimeFuncInfo* pRt = &pTaskInfo->pStreamRuntimeInfo->funcInfo;
560,162✔
398

399
    // When isMultiGroupCalc, pStreamPesudoFuncVals is aliased to curGrpCalc->pParams
400
    // inside pGroupCalcInfos.  NULL it out so tDestroyStRtFuncInfo won't free it twice.
401
    if (pRt->isMultiGroupCalc && pRt->pGroupCalcInfos != NULL) {
559,720✔
402
      pRt->pStreamPesudoFuncVals = NULL;
76,908✔
403
      pRt->pStreamPartColVals = NULL;
76,908✔
404
    }
405
    tDestroyStRtFuncInfo(pRt);
560,162✔
406
    taosMemoryFreeClear(pTaskInfo->pStreamRuntimeInfo);
559,278✔
407
  }
408
  taosMemoryFreeClear(pTaskInfo->sql);
429,693,641✔
409
  taosMemoryFreeClear(pTaskInfo->id.str);
429,863,900✔
410
  taosMemoryFreeClear(pTaskInfo);
429,460,733✔
411
}
429,475,742✔
412

413
void buildTaskId(uint64_t taskId, uint64_t queryId, char* dst, int32_t len) {
607,154,711✔
414
  int32_t ret = snprintf(dst, len, "TID:0x%" PRIx64 " QID:0x%" PRIx64, taskId, queryId);
607,154,711✔
415
  if (ret < 0) {
607,154,711✔
416
    qError("TID:0x%"PRIx64" QID:0x%"PRIx64" create task id failed,  ignore and continue", taskId, queryId);
×
417
  }
418
}
607,154,711✔
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