From 308639a9e333a083ee693ced95d66dbd0b014c56 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Thu, 20 May 2021 15:37:38 +0800 Subject: [PATCH] fix bug --- src/tsdb/src/tsdbRead.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 54833e5e78..cf2ab0cc3f 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -2491,7 +2491,7 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { int32_t numOfRows = 0; assert(numOfTables > 0 && tgNumOfCols > 0); - while (pQueryHandle->activeIndex < numOfTables) { + while (++pQueryHandle->activeIndex < numOfTables) { STableCheckInfo* pCheckInfo = taosArrayGet(pQueryHandle->pTableCheckInfo, pQueryHandle->activeIndex); STable* pTable = pCheckInfo->pTableObj; char* pData = NULL; @@ -2500,7 +2500,6 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { if (pTable->lastCols == NULL || pTable->lastColNum <= 0) { tsdbWarn("no last cached for table, uid:%" PRIu64 ",tid:%d", pTable->tableId.uid, pTable->tableId.tid); - pQueryHandle->activeIndex++; continue; } @@ -2595,8 +2594,6 @@ static bool loadCachedLast(STsdbQueryHandle* pQueryHandle) { j++; } - pQueryHandle->activeIndex++; - if (numOfRows > 0) { return true; } @@ -2899,7 +2896,7 @@ int32_t checkForCachedLast(STsdbQueryHandle* pQueryHandle, STableGroupInfo *grou if (pQueryHandle->cachelastrow) { pQueryHandle->window = TSWINDOW_INITIALIZER; pQueryHandle->checkFiles = false; - pQueryHandle->activeIndex = 0; // start from -1 + pQueryHandle->activeIndex = -1; // start from -1 } tfree(pRow); -- GitLab