From 75ddb1ff0c90e8db32536bbee4b0b3147b24fa5e Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 7 Sep 2020 14:57:04 +0800 Subject: [PATCH] [td-225] fix bugs --- src/tsdb/src/tsdbRead.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 506d185d1c..d829a85754 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -1186,7 +1186,7 @@ static void copyAllRemainRowsFromFileBlock(STsdbQueryHandle* pQueryHandle, STabl // the time window should always be ascending order: skey <= ekey cur->win = (STimeWindow) {.skey = tsArray[start], .ekey = tsArray[end]}; - cur->mixBlock = (start > 0 && end < pBlockInfo->rows - 1); + cur->mixBlock = (numOfRows != pBlockInfo->rows); cur->lastKey = tsArray[endPos] + step; cur->blockCompleted = true; @@ -1731,12 +1731,13 @@ static void changeQueryHandleForInterpQuery(TsdbQueryHandleT pHandle) { assert(pQueryHandle->window.skey == pQueryHandle->window.ekey); // starts from the buffer in case of descending timestamp order check data blocks - // todo consider the query time window, current last_row does not apply the query time window size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); int32_t i = 0; while(i < numOfTables) { STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, i); + + // the first qualified table for interpolation query if (pQueryHandle->window.skey <= pCheckInfo->pTableObj->lastKey && pCheckInfo->pTableObj->lastKey != TSKEY_INITIAL_VAL) { break; -- GitLab