From c4f4e008d0c820d04d56f7c55cdd65a178187e0f Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Mon, 31 Oct 2022 11:53:35 +0800 Subject: [PATCH] fix(query): add null ptr check. --- source/libs/executor/src/executor.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/libs/executor/src/executor.c b/source/libs/executor/src/executor.c index 36af05d1c9..bbd62a9912 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); -- GitLab