fix: percentile finalize wrong error code issue

This commit is contained in:
dapan1121 2023-02-23 17:03:21 +08:00
parent 33843226bf
commit 5d5aad9ad7
1 changed files with 34 additions and 37 deletions

View File

@ -1689,11 +1689,7 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
double v = 0; double v = 0;
tMemBucket* pMemBucket = ppInfo->pMemBucket; tMemBucket* pMemBucket = ppInfo->pMemBucket;
if (pMemBucket == NULL || pMemBucket->total == 0) { // check for null if (pMemBucket != NULL && pMemBucket->total > 0) { // check for null
code = TSDB_CODE_FAILED;
goto _fin_error;
}
if (pCtx->numOfParams > 2) { if (pCtx->numOfParams > 2) {
char buf[512] = {0}; char buf[512] = {0};
size_t len = 1; size_t len = 1;
@ -1737,6 +1733,7 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
tMemBucketDestroy(pMemBucket); tMemBucketDestroy(pMemBucket);
return functionFinalize(pCtx, pBlock); return functionFinalize(pCtx, pBlock);
} }
}
_fin_error: _fin_error: