fix coverity

This commit is contained in:
Ganlin Zhao 2022-10-25 11:11:17 +08:00
parent b53a51e5e7
commit d03058aff8
1 changed files with 6 additions and 3 deletions

View File

@ -5369,9 +5369,12 @@ int32_t modeFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
}
}
ASSERT(resIndex >= 0);
SModeItem* pResItem = (SModeItem*)(pInfo->pItems + resIndex * (sizeof(SModeItem) + pInfo->colBytes));
colDataAppend(pCol, currentRow, pResItem->data, (maxCount == 0) ? true : false);
if (maxCount != 0) {
SModeItem* pResItem = (SModeItem*)(pInfo->pItems + resIndex * (sizeof(SModeItem) + pInfo->colBytes));
colDataAppend(pCol, currentRow, pResItem->data, false);
} else {
colDataAppendNULL(pCol, currentRow);
}
return pResInfo->numOfRes;
}