diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index 0e6b99475f96063565f684b0cf62edc259c4b994..fac9de81ab603f5a270547ddf2f011e2cc55f13b 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -596,11 +596,11 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) { STsdbRepo* pRepo = pQueryHandle->pTsdb; - // if (!pQueryHandle->pTableCheckInfo) { - // tsdbError("%p table check info is NULL", pQueryHandle); - // terrno = TSDB_CODE_QRY_APP_ERROR; - // return -1; - // } + if (!pQueryHandle->pTableCheckInfo) { + tsdbError("%p table check info is NULL", pQueryHandle); + terrno = TSDB_CODE_QRY_APP_ERROR; + return -1; + } size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); int32_t code = 0; @@ -634,10 +634,9 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable return NULL; } - lazyLoadCacheLast(pQueryHandle); - // if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) { - // return NULL; - // }; + if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) { + return NULL; + }; int32_t code = checkForCachedLastRow(pQueryHandle, groupList); if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0 @@ -659,10 +658,9 @@ TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STab return NULL; } - lazyLoadCacheLast(pQueryHandle); - // if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) { - // return NULL; - // }; + if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) { + return NULL; + }; int32_t code = checkForCachedLast(pQueryHandle); if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0