From a9ca820b06964c683ae4e1a27c88e19f5c82f190 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 27 May 2024 22:23:01 +0800 Subject: [PATCH] fix(query): check if pSliceIno->pPrevGroupKey is initialized or not. --- source/libs/executor/src/timesliceoperator.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 9a84127be6..9f421d6de3 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -511,7 +511,6 @@ static int32_t initPrevRowsKeeper(STimeSliceOperatorInfo* pInfo, SSDataBlock* pB } pInfo->isPrevRowSet = false; - return TSDB_CODE_SUCCESS; } @@ -825,8 +824,12 @@ static void genInterpAfterDataBlock(STimeSliceOperatorInfo* pSliceInfo, SOperato SSDataBlock* pResBlock = pSliceInfo->pRes; SInterval* pInterval = &pSliceInfo->interval; - while (pSliceInfo->current <= pSliceInfo->win.ekey && pSliceInfo->fillType != TSDB_FILL_NEXT && - pSliceInfo->fillType != TSDB_FILL_LINEAR) { + if (pSliceInfo->fillType == TSDB_FILL_NEXT || pSliceInfo->fillType == TSDB_FILL_LINEAR || + pSliceInfo->pPrevGroupKey == NULL) { + return; + } + + while (pSliceInfo->current <= pSliceInfo->win.ekey) { genInterpolationResult(pSliceInfo, &pOperator->exprSupp, pResBlock, NULL, index, false); pSliceInfo->current = taosTimeAdd(pSliceInfo->current, pInterval->interval, pInterval->intervalUnit, pInterval->precision); @@ -1068,6 +1071,8 @@ SOperatorInfo* createTimeSliceOperatorInfo(SOperatorInfo* downstream, SPhysiNode blockDataEnsureCapacity(pInfo->pRes, pOperator->resultInfo.capacity); +// int32_t code = initKeeperInfo(pSliceInfo, pBlock, &pOperator->exprSupp); + code = appendDownstream(pOperator, &downstream, 1); return pOperator;