From 3ba0c575b90385d616ab5fb1d911a1e85c10ddd2 Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Tue, 28 Jun 2022 17:46:37 +0800 Subject: [PATCH] fix(query): percentile second scan not call cause crash --- src/query/src/qAggMain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/query/src/qAggMain.c b/src/query/src/qAggMain.c index 33d8525263..5d3af0440b 100644 --- a/src/query/src/qAggMain.c +++ b/src/query/src/qAggMain.c @@ -2560,7 +2560,8 @@ static void percentile_finalizer(SQLFunctionCtx *pCtx) { tMemBucket * pMemBucket = ppInfo->pMemBucket; if (pMemBucket == NULL || pMemBucket->total == 0) { // check for null - assert(ppInfo->numOfElems == 0); + if (ppInfo->stage > 0) + assert(ppInfo->numOfElems == 0); setNull(pCtx->pOutput, pCtx->outputType, pCtx->outputBytes); } else { SET_DOUBLE_VAL((double *)pCtx->pOutput, getPercentile(pMemBucket, v)); -- GitLab