From 6d63d1b5b811b38b2748bdef9f5e86504e6c4450 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Sat, 16 Jul 2022 14:07:32 +0800 Subject: [PATCH] fix count scalar function behavior --- source/libs/scalar/src/sclfunc.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/source/libs/scalar/src/sclfunc.c b/source/libs/scalar/src/sclfunc.c index 1442b5b5b5..339ea101a6 100644 --- a/source/libs/scalar/src/sclfunc.c +++ b/source/libs/scalar/src/sclfunc.c @@ -1746,20 +1746,14 @@ int32_t countScalarFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam SColumnInfoData *pOutputData = pOutput->columnData; int64_t *out = (int64_t *)pOutputData->pData; - bool hasNull = false; *out = 0; for (int32_t i = 0; i < pInput->numOfRows; ++i) { if (colDataIsNull_s(pInputData, i)) { - hasNull = true; - break; + continue; } (*out)++; } - if (hasNull) { - colDataAppendNULL(pOutputData, 0); - } - pOutput->numOfRows = 1; return TSDB_CODE_SUCCESS; }