提交 011cafe3 编写于 作者: C Cary Xu

[TS-995]<fix>(query): validate pTableCheckInfo when querying last/last_row

上级 545758ad
...@@ -596,11 +596,11 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon ...@@ -596,11 +596,11 @@ void tsdbResetQueryHandleForNewTable(TsdbQueryHandleT queryHandle, STsdbQueryCon
static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) { static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) {
STsdbRepo* pRepo = pQueryHandle->pTsdb; STsdbRepo* pRepo = pQueryHandle->pTsdb;
if (!pQueryHandle->pTableCheckInfo) { // if (!pQueryHandle->pTableCheckInfo) {
tsdbError("%p table check info is NULL", pQueryHandle); // tsdbError("%p table check info is NULL", pQueryHandle);
terrno = TSDB_CODE_QRY_APP_ERROR; // terrno = TSDB_CODE_QRY_APP_ERROR;
return -1; // return -1;
} // }
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
int32_t code = 0; int32_t code = 0;
...@@ -634,9 +634,10 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable ...@@ -634,9 +634,10 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable
return NULL; return NULL;
} }
if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) { lazyLoadCacheLast(pQueryHandle);
return NULL; // if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) {
}; // return NULL;
// };
int32_t code = checkForCachedLastRow(pQueryHandle, groupList); int32_t code = checkForCachedLastRow(pQueryHandle, groupList);
if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0 if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0
...@@ -658,9 +659,10 @@ TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STab ...@@ -658,9 +659,10 @@ TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STab
return NULL; return NULL;
} }
if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) { lazyLoadCacheLast(pQueryHandle);
return NULL; // if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) {
}; // return NULL;
// };
int32_t code = checkForCachedLast(pQueryHandle); int32_t code = checkForCachedLast(pQueryHandle);
if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0 if (code != TSDB_CODE_SUCCESS) { // set the numOfTables to be 0
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册