From ba31ce80701ac408ebea95a46f21f0dd577bb51e Mon Sep 17 00:00:00 2001 From: Alex Duan <417921451@qq.com> Date: Sat, 17 Dec 2022 10:46:13 +0800 Subject: [PATCH] feat(query): avg function check range overflow --- source/libs/function/src/detail/tavgfunction.c | 1 - 1 file changed, 1 deletion(-) diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index 04f5c99d47..1473a89bd7 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -553,7 +553,6 @@ int32_t avgFunction(SqlFunctionCtx* pCtx) { } else { for (int32_t i = pInput->startRowIndex; i < pInput->numOfRows + pInput->startRowIndex; ++i) { if (type == TSDB_DATA_TYPE_TINYINT) { - pAvgRes->sum.isum += plist[i]; CHECK_OVERFLOW_SUM_SIGNED(pAvgRes, plist[i]) } else { CHECK_OVERFLOW_SUM_UNSIGNED(pAvgRes, (uint8_t)plist[i]) -- GitLab