diff --git a/source/libs/executor/src/sysscanoperator.c b/source/libs/executor/src/sysscanoperator.c index 59cb0d8426465b54e8ec7108d264eb79d2f2a585..2862d96c606fa8e6aefeba3d960427cfe960cee6 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)) {