From 286ba435e6bc56074d7a7207c7b11acd0a874830 Mon Sep 17 00:00:00 2001 From: zhihaop Date: Mon, 26 Sep 2022 15:39:14 +0800 Subject: [PATCH] fix(query): mirror fix on doEveryInterpolation() --- src/query/src/qExecutor.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index dc2678e8c9..707c123006 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -6874,7 +6874,11 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo break; } } - + + if (pCtx == NULL) { + goto group_finished_exit; + } + TSKEY* tsCols = NULL; if (pBlock && pBlock->pDataBlock != NULL) { SColumnInfoData* pColDataInfo = taosArrayGet(pBlock->pDataBlock, 0); @@ -6882,10 +6886,6 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo assert(tsCols[0] == pBlock->info.window.skey && tsCols[pBlock->info.rows - 1] == pBlock->info.window.ekey); } - if (pCtx == NULL || pBlock == NULL) { - return false; - } - if (pCtx->startTs == INT64_MIN) { if (pQueryAttr->range.skey == INT64_MIN) { if (NULL == tsCols) { @@ -6983,8 +6983,8 @@ static bool doEveryInterpolation(SOperatorInfo* pOperatorInfo, SSDataBlock* pBlo return false; } - - int32_t startPos = binarySearchForKey((char*)tsCols, pBlock->info.rows, pCtx->startTs, pQueryAttr->order.order); + int32_t nRows = pBlock ? pBlock->info.rows : 0; + int32_t startPos = binarySearchForKey((char*) tsCols, nRows, pCtx->startTs, pQueryAttr->order.order); if (ascQuery && pQueryAttr->fillType != TSDB_FILL_NEXT && pCtx->start.key == INT64_MIN) { if (startPos < 0) { -- GitLab