未验证 提交 f9188351 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #20127 from taosdata/fix/TD-22733

fix: percentile finalize wrong error code issue
...@@ -1689,11 +1689,7 @@ int32_t percentileFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) { ...@@ -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) { ...@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册