From 45a625f2dc3e167677d868b2131619390b449230 Mon Sep 17 00:00:00 2001 From: kailixu Date: Sat, 18 Mar 2023 12:50:37 +0800 Subject: [PATCH] fix: add mem check --- source/libs/executor/src/sysscanoperator.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 59cb0d8426..2862d96c60 100644 --- a/source/libs/executor/src/sysscanoperator.c +++ b/source/libs/executor/src/sysscanoperator.c @@ -521,6 +521,14 @@ static SSDataBlock* sysTableScanUserCols(SOperatorInfo* pOperator) { taosHashSetFreeFp(pInfo->pSchema, tDeleteSSchemaWrapperForHash); } + if (!pInfo->pCur || !pInfo->pSchema) { + terrno = TSDB_CODE_OUT_OF_MEMORY; + qError("sysTableScanUserCols failed since %s", terrstr(terrno)); + blockDataDestroy(dataBlock); + pInfo->loadInfo.totalRows = 0; + return NULL; + } + int32_t resume = pInfo->resume; pInfo->resume = false; while (resume || ((ret = metaTbCursorNext(pInfo->pCur, TSDB_TABLE_MAX)) == 0)) { -- GitLab