diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index a416df4546..13a6a8855c 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2323,7 +2323,11 @@ SSDataBlock* doTableMergeScan(SOperatorInfo* pOperator) { size_t tableListSize = taosArrayGetSize(pInfo->tableListInfo->pTableList); if (!pInfo->hasGroupId) { pInfo->hasGroupId = true; - + + if (tableListSize == 0) { + doSetOperatorCompleted(pOperator); + return NULL; + } pInfo->tableStartIndex = 0; pInfo->groupId = ((STableKeyInfo*)taosArrayGet(pInfo->tableListInfo->pTableList, pInfo->tableStartIndex))->groupId; startGroupTableMergeScan(pOperator);