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

taosdata / TDengine / #4791

13 Oct 2025 06:50AM UTC coverage: 57.628% (-0.8%) from 58.476%
#4791

push

travis-ci

web-flow
Merge pull request #33213 from taosdata/fix/huoh/timemoe_model_directory

fix: fix tdgpt timemoe model directory

136628 of 303332 branches covered (45.04%)

Branch coverage included in aggregate %.

208121 of 294900 relevant lines covered (70.57%)

4250784.02 hits per line

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

72.1
/source/libs/executor/src/eventwindowoperator.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 "executorInt.h"
17
#include "filter.h"
18
#include "function.h"
19
#include "functionMgt.h"
20
#include "operator.h"
21
#include "querytask.h"
22
#include "tcommon.h"
23
#include "tcompare.h"
24
#include "tdatablock.h"
25
#include "ttime.h"
26

27
static int32_t eventWindowAggregateNext(SOperatorInfo* pOperator, SSDataBlock** pRes);
28
static void    destroyEWindowOperatorInfo(void* param);
29
static int32_t eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock);
30
void cleanupResultInfoInEventWindow(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo);
31

32
static int32_t resetEventWindowOperState(SOperatorInfo* pOper) {
×
33
  SEventWindowOperatorInfo* pEvent = pOper->info;
×
34
  SExecTaskInfo*           pTaskInfo = pOper->pTaskInfo;
×
35
  SEventWinodwPhysiNode* pPhynode = (SEventWinodwPhysiNode*)pOper->pPhyNode;
×
36
  pOper->status = OP_NOT_OPENED;
×
37

38
  resetBasicOperatorState(&pEvent->binfo);
×
39
  taosMemoryFreeClear(pEvent->pRow);
×
40

41
  pEvent->groupId = 0;
×
42
  pEvent->pPreDataBlock = NULL;
×
43
  pEvent->inWindow = false;
×
44

45
  colDataDestroy(&pEvent->twAggSup.timeWindowData);
×
46
  int32_t code = initExecTimeWindowInfo(&pEvent->twAggSup.timeWindowData, &pTaskInfo->window);
×
47
  cleanupResultInfoInEventWindow(pOper, pEvent);
×
48

49
  if (code == 0) {
×
50
    code = resetAggSup(&pOper->exprSupp, &pEvent->aggSup, pTaskInfo, pPhynode->window.pFuncs, NULL,
×
51
                       sizeof(int64_t) * 2 + POINTER_BYTES, pTaskInfo->id.str, pTaskInfo->streamInfo.pState,
×
52
                       &pTaskInfo->storageAPI.functionStore);
53
  }
54
  if (code == 0) {
×
55
    code = resetExprSupp(&pEvent->scalarSup, pTaskInfo, pPhynode->window.pExprs, NULL,
×
56
                         &pTaskInfo->storageAPI.functionStore);
57
  }
58
  return code;
×
59
}
60

61
int32_t createEventwindowOperatorInfo(SOperatorInfo* downstream, SPhysiNode* physiNode,
298✔
62
                                             SExecTaskInfo* pTaskInfo, SOperatorInfo** pOptrInfo) {
63
  QRY_PARAM_CHECK(pOptrInfo);
298!
64

65
  int32_t                   code = TSDB_CODE_SUCCESS;
298✔
66
  int32_t                   lino = 0;
298✔
67
  SEventWindowOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SEventWindowOperatorInfo));
298!
68
  SOperatorInfo*            pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
298!
69
  if (pInfo == NULL || pOperator == NULL) {
298!
70
    code = terrno;
×
71
    goto _error;
×
72
  }
73

74
  pOperator->pPhyNode = physiNode;
298✔
75
  pOperator->exprSupp.hasWindowOrGroup = true;
298✔
76

77
  SEventWinodwPhysiNode* pEventWindowNode = (SEventWinodwPhysiNode*)physiNode;
298✔
78

79
  int32_t tsSlotId = ((SColumnNode*)pEventWindowNode->window.pTspk)->slotId;
298✔
80
  code = filterInitFromNode((SNode*)pEventWindowNode->pStartCond, &pInfo->pStartCondInfo, 0,
298✔
81
                            pTaskInfo->pStreamRuntimeInfo);
298✔
82
  QUERY_CHECK_CODE(code, lino, _error);
298!
83

84
  code = filterInitFromNode((SNode*)pEventWindowNode->pEndCond, &pInfo->pEndCondInfo, 0,
298✔
85
                            pTaskInfo->pStreamRuntimeInfo);
298✔
86
  QUERY_CHECK_CODE(code, lino, _error);
298!
87

88
  if (pEventWindowNode->window.pExprs != NULL) {
298✔
89
    int32_t    numOfScalarExpr = 0;
2✔
90
    SExprInfo* pScalarExprInfo = NULL;
2✔
91

92
    code = createExprInfo(pEventWindowNode->window.pExprs, NULL, &pScalarExprInfo, &numOfScalarExpr);
2✔
93
    QUERY_CHECK_CODE(code, lino, _error);
2!
94
    code = initExprSupp(&pInfo->scalarSup, pScalarExprInfo, numOfScalarExpr, &pTaskInfo->storageAPI.functionStore);
2✔
95
    QUERY_CHECK_CODE(code, lino, _error);
2!
96
  }
97

98
  code = filterInitFromNode((SNode*)pEventWindowNode->window.node.pConditions, &pOperator->exprSupp.pFilterInfo, 0,
298✔
99
                            pTaskInfo->pStreamRuntimeInfo);
298✔
100
  QUERY_CHECK_CODE(code, lino, _error);
298!
101

102
  size_t keyBufSize = sizeof(int64_t) + sizeof(int64_t) + POINTER_BYTES;
298✔
103

104
  int32_t    num = 0;
298✔
105
  SExprInfo* pExprInfo = NULL;
298✔
106
  code = createExprInfo(pEventWindowNode->window.pFuncs, NULL, &pExprInfo, &num);
298✔
107
  QUERY_CHECK_CODE(code, lino, _error);
298!
108

109
  initResultSizeInfo(&pOperator->resultInfo, 4096);
298✔
110

111
  code = initAggSup(&pOperator->exprSupp, &pInfo->aggSup, pExprInfo, num, keyBufSize, pTaskInfo->id.str,
298✔
112
                    pTaskInfo->streamInfo.pState, &pTaskInfo->storageAPI.functionStore);
298✔
113
  QUERY_CHECK_CODE(code, lino, _error);
298!
114

115
  SSDataBlock* pResBlock = createDataBlockFromDescNode(pEventWindowNode->window.node.pOutputDataBlockDesc);
298✔
116
  QUERY_CHECK_NULL(pResBlock, code, lino, _error, terrno);
298!
117
  initBasicInfo(&pInfo->binfo, pResBlock);
298✔
118

119
  code = blockDataEnsureCapacity(pResBlock, pOperator->resultInfo.capacity);
298✔
120
  QUERY_CHECK_CODE(code, lino, _error);
298!
121

122
  initResultRowInfo(&pInfo->binfo.resultRowInfo);
298✔
123
  pInfo->binfo.inputTsOrder = physiNode->inputTsOrder;
298✔
124
  pInfo->binfo.outputTsOrder = physiNode->outputTsOrder;
298✔
125

126
  pInfo->twAggSup = (STimeWindowAggSupp){.waterMark = pEventWindowNode->window.watermark,
298✔
127
                                         .calTrigger = pEventWindowNode->window.triggerType};
298✔
128

129
  code = initExecTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pTaskInfo->window);
298✔
130
  QUERY_CHECK_CODE(code, lino, _error);
298!
131

132
  pInfo->tsSlotId = tsSlotId;
298✔
133
  pInfo->pPreDataBlock = NULL;
298✔
134
  pInfo->pOperator = pOperator;
298✔
135
  pInfo->trueForLimit = pEventWindowNode->trueForLimit;
298✔
136

137
  setOperatorInfo(pOperator, "EventWindowOperator", QUERY_NODE_PHYSICAL_PLAN_MERGE_EVENT, true, OP_NOT_OPENED, pInfo,
298✔
138
                  pTaskInfo);
139
  pOperator->fpSet = createOperatorFpSet(optrDummyOpenFn, eventWindowAggregateNext, NULL, destroyEWindowOperatorInfo,
298✔
140
                                         optrDefaultBufFn, NULL, optrDefaultGetNextExtFn, NULL);
141

142
  setOperatorResetStateFn(pOperator, resetEventWindowOperState);
298✔
143
  code = appendDownstream(pOperator, &downstream, 1);
298✔
144
  if (code != TSDB_CODE_SUCCESS) {
298!
145
    goto _error;
×
146
  }
147

148
  *pOptrInfo = pOperator;
298✔
149
  return TSDB_CODE_SUCCESS;
298✔
150

151
_error:
×
152
  if (pInfo != NULL) {
×
153
    destroyEWindowOperatorInfo(pInfo);
×
154
  }
155

156
  destroyOperatorAndDownstreams(pOperator, &downstream, 1);
×
157
  pTaskInfo->code = code;
×
158
  return code;
×
159
}
160

161
void cleanupResultInfoInEventWindow(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo) {
298✔
162
  if (pInfo == NULL || pInfo->pRow == NULL || pOperator == NULL) {
298!
163
    return;
54✔
164
  }
165
  SExprSupp*       pSup = &pOperator->exprSupp;
244✔
166
  for (int32_t j = 0; j < pSup->numOfExprs; ++j) {
2,463✔
167
    pSup->pCtx[j].resultInfo = getResultEntryInfo(pInfo->pRow, j, pSup->rowEntryInfoOffset);
2,219✔
168
    if (pSup->pCtx[j].fpSet.cleanup) {
2,219!
169
      pSup->pCtx[j].fpSet.cleanup(&pSup->pCtx[j]);
×
170
    }
171
  }
172
}
173

174
void destroyEWindowOperatorInfo(void* param) {
298✔
175
  SEventWindowOperatorInfo* pInfo = (SEventWindowOperatorInfo*)param;
298✔
176
  if (pInfo == NULL) {
298!
177
    return;
×
178
  }
179

180
  if (pInfo->pRow != NULL) {
298✔
181
    taosMemoryFree(pInfo->pRow);
244!
182
  }
183

184
  if (pInfo->pStartCondInfo != NULL) {
298!
185
    filterFreeInfo(pInfo->pStartCondInfo);
298✔
186
    pInfo->pStartCondInfo = NULL;
298✔
187
  }
188

189
  if (pInfo->pEndCondInfo != NULL) {
298!
190
    filterFreeInfo(pInfo->pEndCondInfo);
298✔
191
    pInfo->pEndCondInfo = NULL;
298✔
192
  }
193

194
  cleanupBasicInfo(&pInfo->binfo);
298✔
195
  colDataDestroy(&pInfo->twAggSup.timeWindowData);
298✔
196

197
  cleanupResultInfoInEventWindow(pInfo->pOperator, pInfo);
298✔
198
  pInfo->pOperator = NULL;
298✔
199
  cleanupAggSup(&pInfo->aggSup);
298✔
200
  cleanupExprSupp(&pInfo->scalarSup);
298✔
201
  taosMemoryFreeClear(param);
298!
202
}
203

204
static int32_t eventWindowAggregateNext(SOperatorInfo* pOperator, SSDataBlock** ppRes) {
4,090✔
205
  int32_t                   code = TSDB_CODE_SUCCESS;
4,090✔
206
  int32_t                   lino = 0;
4,090✔
207
  SEventWindowOperatorInfo* pInfo = pOperator->info;
4,090✔
208
  SExecTaskInfo*            pTaskInfo = pOperator->pTaskInfo;
4,090✔
209

210
  SExprSupp* pSup = &pOperator->exprSupp;
4,090✔
211
  int32_t    order = pInfo->binfo.inputTsOrder;
4,090✔
212

213
  SSDataBlock* pRes = pInfo->binfo.pRes;
4,090✔
214

215
  blockDataCleanup(pRes);
4,090✔
216

217
  SOperatorInfo* downstream = pOperator->pDownstream[0];
4,090✔
218
  while (1) {
9,386✔
219
    SSDataBlock* pBlock = NULL;
13,476✔
220
    if (pInfo->pPreDataBlock == NULL) {
13,476✔
221
      pBlock = getNextBlockFromDownstream(pOperator, 0);
8,979✔
222
    } else {
223
      pBlock = pInfo->pPreDataBlock;
4,497✔
224
      pInfo->pPreDataBlock = NULL;
4,497✔
225
    }
226

227
    if (pBlock == NULL) {
13,476✔
228
      break;
292✔
229
    }
230

231
    pRes->info.scanFlag = pBlock->info.scanFlag;
13,184✔
232
    code = setInputDataBlock(pSup, pBlock, order, MAIN_SCAN, true);
13,184✔
233
    QUERY_CHECK_CODE(code, lino, _end);
13,184!
234

235
    code = blockDataUpdateTsWindow(pBlock, pInfo->tsSlotId);
13,184✔
236
    QUERY_CHECK_CODE(code, lino, _end);
13,184!
237

238
    // there is an scalar expression that needs to be calculated right before apply the group aggregation.
239
    if (pInfo->scalarSup.pExprInfo != NULL) {
13,184✔
240
      code = projectApplyFunctions(pInfo->scalarSup.pExprInfo, pBlock, pBlock, pInfo->scalarSup.pCtx,
4✔
241
                                   pInfo->scalarSup.numOfExprs, NULL, GET_STM_RTINFO(pOperator->pTaskInfo));
4!
242
      QUERY_CHECK_CODE(code, lino, _end);
4!
243
    }
244

245
    code = eventWindowAggImpl(pOperator, pInfo, pBlock);
13,184✔
246
    QUERY_CHECK_CODE(code, lino, _end);
13,184!
247

248
    code = doFilter(pRes, pSup->pFilterInfo, NULL, NULL);
13,184✔
249
    QUERY_CHECK_CODE(code, lino, _end);
13,184!
250

251
    if (pRes->info.rows >= pOperator->resultInfo.threshold ||
13,184✔
252
        (pRes->info.id.groupId != pInfo->groupId && pRes->info.rows > 0)) {
13,144✔
253
      (*ppRes) = pRes;
3,798✔
254
      return code;
3,798✔
255
    }
256
  }
257

258
_end:
292✔
259
  if (code != TSDB_CODE_SUCCESS) {
292!
260
    qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
×
261
    pTaskInfo->code = code;
×
262
    T_LONG_JMP(pTaskInfo->env, code);
×
263
  }
264
  (*ppRes) =  pRes->info.rows == 0 ? NULL : pRes;
292✔
265
  return code;
292✔
266
}
267

268
static int32_t setSingleOutputTupleBufv1(SResultRowInfo* pResultRowInfo, STimeWindow* win, SResultRow** pResult,
309,042✔
269
                                         SExprSupp* pExprSup, SAggSupporter* pAggSup) {
270
  if (*pResult == NULL) {
309,042✔
271
    SResultRow* p = taosMemoryCalloc(1, pAggSup->resultRowSize);
244!
272
    if (!p) {
244!
273
      return terrno;
×
274
    }
275
    pResultRowInfo->cur = (SResultRowPosition){.pageId = p->pageId, .offset = p->offset};
244✔
276
    *pResult = p;
244✔
277
  }
278

279
  (*pResult)->win = *win;
309,042✔
280

281
  return setResultRowInitCtx(*pResult, pExprSup->pCtx, pExprSup->numOfExprs, pExprSup->rowEntryInfoOffset);
309,042✔
282
}
283

284
static int32_t doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSup, int32_t startIndex,
309,042✔
285
                                    int32_t endIndex, const SSDataBlock* pBlock, int64_t* tsList,
286
                                    SExecTaskInfo* pTaskInfo) {
287
  int32_t code = TSDB_CODE_SUCCESS;
309,042✔
288
  SWindowRowsSup* pRowSup = &pInfo->winSup;
309,042✔
289

290
  int32_t numOfOutput = pSup->numOfExprs;
309,042✔
291
  int32_t numOfRows = endIndex - startIndex + 1;
309,042✔
292

293
  doKeepTuple(pRowSup, tsList[endIndex], endIndex, pBlock->info.id.groupId);
309,042✔
294

295
  code = setSingleOutputTupleBufv1(&pInfo->binfo.resultRowInfo, &pRowSup->win, &pInfo->pRow, pSup, &pInfo->aggSup);
309,042✔
296
  if (code != TSDB_CODE_SUCCESS) {  // null data, too many state code
309,043!
297
    qError("failed to set single output tuple buffer, code:%d", code);
×
298
    return code;
×
299
  }
300

301
  updateTimeWindowInfo(&pInfo->twAggSup.timeWindowData, &pRowSup->win, 0);
309,043✔
302
  code = applyAggFunctionOnPartialTuples(pTaskInfo, pSup->pCtx, &pInfo->twAggSup.timeWindowData, startIndex, numOfRows,
309,042✔
303
                                         pBlock->info.rows, numOfOutput);
309,042✔
304
  return code;
309,043✔
305
}
306

307
int32_t eventWindowAggImpl(SOperatorInfo* pOperator, SEventWindowOperatorInfo* pInfo, SSDataBlock* pBlock) {
13,184✔
308
  int32_t          code = TSDB_CODE_SUCCESS;
13,184✔
309
  int32_t          lino = 0;
13,184✔
310
  SExecTaskInfo*   pTaskInfo = pOperator->pTaskInfo;
13,184✔
311
  SExprSupp*       pSup = &pOperator->exprSupp;
13,184✔
312
  SSDataBlock*     pRes = pInfo->binfo.pRes;
13,184✔
313
  int64_t          gid = pBlock->info.id.groupId;
13,184✔
314
  SColumnInfoData *ps = NULL, *pe = NULL;
13,184✔
315
  SColumnInfoData* pColInfoData = taosArrayGet(pBlock->pDataBlock, pInfo->tsSlotId);
13,184✔
316
  QUERY_CHECK_NULL(pColInfoData, code, lino, _return, terrno);
13,184!
317
  TSKEY*           tsList = (TSKEY*)pColInfoData->pData;
13,184✔
318
  SWindowRowsSup*  pRowSup = &pInfo->winSup;
13,184✔
319
  int32_t          rowIndex = 0;
13,184✔
320
  int64_t          minWindowSize = getMinWindowSize(pOperator);
13,184✔
321

322
  pRowSup->numOfRows = 0;
13,184✔
323
  if (pInfo->groupId == 0) {
13,184✔
324
    pInfo->groupId = gid;
2,114✔
325
  } else if (pInfo->groupId != gid) {
11,070✔
326
    // this is a new group, reset the info
327
    pInfo->inWindow = false;
4,529✔
328
    pInfo->groupId = gid;
4,529✔
329
    pInfo->pPreDataBlock = pBlock;
4,529✔
330
    goto _return;
4,529✔
331
  }
332
  pRes->info.id.groupId = pInfo->groupId;
8,655✔
333

334
  SFilterColumnParam param1 = {.numOfCols = taosArrayGetSize(pBlock->pDataBlock), .pDataBlock = pBlock->pDataBlock};
8,655✔
335

336
  code = filterSetDataFromSlotId(pInfo->pStartCondInfo, &param1);
8,655✔
337
  QUERY_CHECK_CODE(code, lino, _return);
8,655!
338

339
  int32_t status1 = 0;
8,655✔
340
  code = filterExecute(pInfo->pStartCondInfo, pBlock, &ps, NULL, param1.numOfCols, &status1);
8,655✔
341
  QUERY_CHECK_CODE(code, lino, _return);
8,655!
342

343
  SFilterColumnParam param2 = {.numOfCols = taosArrayGetSize(pBlock->pDataBlock), .pDataBlock = pBlock->pDataBlock};
8,655✔
344
  code = filterSetDataFromSlotId(pInfo->pEndCondInfo, &param2);
8,655✔
345
  QUERY_CHECK_CODE(code, lino, _return);
8,655!
346

347
  int32_t status2 = 0;
8,655✔
348
  code = filterExecute(pInfo->pEndCondInfo, pBlock, &pe, NULL, param2.numOfCols, &status2);
8,655✔
349
  QUERY_CHECK_CODE(code, lino, _return);
8,655!
350

351
  int32_t startIndex = pInfo->inWindow ? 0 : -1;
8,655✔
352
  while (rowIndex < pBlock->info.rows) {
624,647✔
353
    if (pInfo->inWindow) {  // let's find the first end value
619,321✔
354
      for (rowIndex = startIndex; rowIndex < pBlock->info.rows; ++rowIndex) {
2,052,064✔
355
        if (((bool*)pe->pData)[rowIndex]) {
2,047,265✔
356
          break;
304,243✔
357
        }
358
      }
359

360
      if (rowIndex < pBlock->info.rows) {
309,042✔
361
        code = doEventWindowAggImpl(pInfo, pSup, startIndex, rowIndex, pBlock, tsList, pTaskInfo);
304,243✔
362
        QUERY_CHECK_CODE(code, lino, _return);
304,243!
363
        doUpdateNumOfRows(pSup->pCtx, pInfo->pRow, pSup->numOfExprs, pSup->rowEntryInfoOffset);
304,243✔
364

365
        if (pRowSup->win.ekey - pRowSup->win.skey < minWindowSize) {
304,243✔
366
          qDebug("skip small window, groupId: %" PRId64 ", windowSize: %" PRId64 ", minWindowSize: %" PRId64,
1,736!
367
                 pInfo->groupId, pRowSup->win.ekey - pRowSup->win.skey, minWindowSize);
368
        } else {
369
          // check buffer size
370
          if (pRes->info.rows + pInfo->pRow->numOfRows >= pRes->info.capacity) {
302,507!
371
            int32_t newSize = pRes->info.rows + pInfo->pRow->numOfRows;
×
372
            code = blockDataEnsureCapacity(pRes, newSize);
×
373
            QUERY_CHECK_CODE(code, lino, _return);
×
374
          }
375

376
          code = copyResultrowToDataBlock(pSup->pExprInfo, pSup->numOfExprs, pInfo->pRow, pSup->pCtx, pRes,
302,507✔
377
                                          pSup->rowEntryInfoOffset, pTaskInfo);
302,507✔
378
          QUERY_CHECK_CODE(code, lino, _return);
302,507!
379

380
          pRes->info.rows += pInfo->pRow->numOfRows;
302,507✔
381
        }
382
        pInfo->pRow->numOfRows = 0;
304,243✔
383

384
        pInfo->inWindow = false;
304,243✔
385
        rowIndex += 1;
304,243✔
386
      } else {
387
        code = doEventWindowAggImpl(pInfo, pSup, startIndex, pBlock->info.rows - 1, pBlock, tsList, pTaskInfo);
4,799✔
388
        QUERY_CHECK_CODE(code, lino, _return);
4,800!
389
      }
390
    } else {  // find the first start value that is fulfill for the start condition
391
      for (; rowIndex < pBlock->info.rows; ++rowIndex) {
1,332,219✔
392
        if (((bool*)ps->pData)[rowIndex]) {
1,328,889✔
393
          doKeepNewWindowStartInfo(pRowSup, tsList, rowIndex, gid);
306,949✔
394
          pInfo->inWindow = true;
306,949✔
395
          startIndex = rowIndex;
306,949✔
396
          if (pInfo->pRow != NULL) {
306,949✔
397
            clearResultRowInitFlag(pSup->pCtx, pSup->numOfExprs);
306,705✔
398
          }
399
          break;
306,949✔
400
        }
401
      }
402

403
      if (pInfo->inWindow) {
310,279✔
404
        continue;  // try to find the end position
306,949✔
405
      } else {
406
        break;  // no valid start position, quit
3,330✔
407
      }
408
    }
409
  }
410

411
_return:
5,326✔
412

413
  if (code != TSDB_CODE_SUCCESS) {
13,185!
414
    qError("%s failed at line %d since %s", __func__, lino, tstrerror(code));
×
415
  }
416
  colDataDestroy(ps);
13,185✔
417
  taosMemoryFree(ps);
13,184!
418
  colDataDestroy(pe);
13,184✔
419
  taosMemoryFree(pe);
13,184!
420

421
  return code;
13,184✔
422
}
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