提交 0af0cc0f 编写于 作者: C Cary Xu

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

上级 a305656f
...@@ -598,7 +598,8 @@ static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) { ...@@ -598,7 +598,8 @@ static int32_t lazyLoadCacheLast(STsdbQueryHandle* pQueryHandle) {
if (!pQueryHandle->pTableCheckInfo) { if (!pQueryHandle->pTableCheckInfo) {
tsdbError("%p table check info is NULL", pQueryHandle); tsdbError("%p table check info is NULL", pQueryHandle);
return TSDB_CODE_QRY_APP_ERROR; terrno = TSDB_CODE_QRY_APP_ERROR;
return -1;
} }
size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo); size_t numOfTables = taosArrayGetSize(pQueryHandle->pTableCheckInfo);
...@@ -633,13 +634,11 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable ...@@ -633,13 +634,11 @@ TsdbQueryHandleT tsdbQueryLastRow(STsdbRepo *tsdb, STsdbQueryCond *pCond, STable
return NULL; return NULL;
} }
int32_t code = lazyLoadCacheLast(pQueryHandle); if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) {
if (code != TSDB_CODE_SUCCESS) {
terrno = code;
return NULL; return NULL;
} }
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
terrno = code; terrno = code;
return NULL; return NULL;
...@@ -659,13 +658,11 @@ TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STab ...@@ -659,13 +658,11 @@ TsdbQueryHandleT tsdbQueryCacheLast(STsdbRepo *tsdb, STsdbQueryCond *pCond, STab
return NULL; return NULL;
} }
int32_t code = lazyLoadCacheLast(pQueryHandle); if (lazyLoadCacheLast(pQueryHandle) != TSDB_CODE_SUCCESS) {
if (code != TSDB_CODE_SUCCESS) {
terrno = code;
return NULL; return NULL;
} }
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
terrno = code; terrno = code;
return NULL; return NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册