From 2f3536bacd3f545d4417284db0ead37082922000 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Sat, 8 Oct 2022 18:28:09 +0800 Subject: [PATCH] fix(query): fix infinite interpolation results generated when sliding window is smaller than interval window in descending time order --- source/libs/executor/src/tfill.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/tfill.c b/source/libs/executor/src/tfill.c index 27b8e83a20..10a65065fc 100644 --- a/source/libs/executor/src/tfill.c +++ b/source/libs/executor/src/tfill.c @@ -583,8 +583,8 @@ int64_t getNumOfResultsAfterFillGap(SFillInfo* pFillInfo, TSKEY ekey, int32_t ma numOfRes += 1; assert(numOfRes >= numOfRows); } else { // reach the end of data - if ((ekey1 < pFillInfo->currentKey && FILL_IS_ASC_FILL(pFillInfo)) || - (ekey1 > pFillInfo->currentKey && !FILL_IS_ASC_FILL(pFillInfo))) { + if ((ekey1 <= pFillInfo->currentKey && FILL_IS_ASC_FILL(pFillInfo)) || + (ekey1 >= pFillInfo->currentKey && !FILL_IS_ASC_FILL(pFillInfo))) { return 0; } numOfRes = taosTimeCountInterval(ekey1, pFillInfo->currentKey, pFillInfo->interval.sliding,