fix(query): add null ptr check.

This commit is contained in:
Haojun Liao 2022-10-31 11:53:35 +08:00
parent 79ea4c2c79
commit c4f4e008d0
1 changed files with 7 additions and 4 deletions

View File

@ -1001,11 +1001,14 @@ int32_t qStreamPrepareScan(qTaskInfo_t tinfo, STqOffsetVal* pOffset, int8_t subT
initQueryTableDataCondForTmq(&pTaskInfo->streamInfo.tableCond, sContext, &mtInfo);
pTaskInfo->streamInfo.tableCond.twindows.skey = pOffset->ts;
STableListInfo* pListInfo = pTaskInfo->pTableInfoList;
tableListAddTableInfo(pListInfo, mtInfo.uid, 0);
if (pTaskInfo->pTableInfoList == NULL) {
pTaskInfo->pTableInfoList = tableListCreate();
}
STableKeyInfo* pList = tableListGetInfo(pListInfo, 0);
int32_t size = tableListGetSize(pListInfo);
tableListAddTableInfo(pTaskInfo->pTableInfoList, mtInfo.uid, 0);
STableKeyInfo* pList = tableListGetInfo(pTaskInfo->pTableInfoList, 0);
int32_t size = tableListGetSize(pTaskInfo->pTableInfoList);
ASSERT(size == 1);
tsdbReaderOpen(pInfo->vnode, &pTaskInfo->streamInfo.tableCond, pList, size, &pInfo->dataReader, NULL);