From e2413a062c477784aaf40062f9db7330c303177d Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Sat, 7 May 2022 14:29:50 +0800 Subject: [PATCH] fix: histogram normalized can only be 0/1 --- source/libs/function/src/builtinsimpl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 7229cf98b0..0808ec58b0 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1964,6 +1964,9 @@ bool histogramFunctionSetup(SqlFunctionCtx *pCtx, SResultRowEntryInfo *pResultIn } char* binDesc = varDataVal(pCtx->param[2].param.pz); int64_t normalized = pCtx->param[3].param.i; + if (normalized != 0 && normalized != 1) { + return false; + } if (!getHistogramBinDesc(pInfo, binDesc, binType, (bool)normalized)) { return false; } -- GitLab