diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 36af05d1c9ce4b525d6e2e50c4315e37c0c36e75..bbd62a991233d648afbac081a4adb6b068c63c0c 100644 --- a/source/libs/executor/src/executor.c +++ b/source/libs/executor/src/executor.c @@ -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(); + } + + tableListAddTableInfo(pTaskInfo->pTableInfoList, mtInfo.uid, 0); - STableKeyInfo* pList = tableListGetInfo(pListInfo, 0); - int32_t size = tableListGetSize(pListInfo); + 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);