fix: return null when there are no input stream blocks for priority queue sort

This commit is contained in:
slzhou 2023-07-25 13:08:37 +08:00
parent a205eba2ab
commit ca2ad71bb8
1 changed files with 3 additions and 0 deletions

View File

@ -1405,6 +1405,9 @@ static int32_t tsortOpenForPQSort(SSortHandle* pHandle) {
}
static STupleHandle* tsortPQSortNextTuple(SSortHandle* pHandle) {
if (pHandle->pDataBlock == NULL) { // when no input stream datablock
return NULL;
}
blockDataCleanup(pHandle->pDataBlock);
blockDataEnsureCapacity(pHandle->pDataBlock, 1);
// abandon the top tuple if queue size bigger than max size