diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 790f5d03a34a6b548ff63985ac3b1b1e433f9acd..bc24f54b52d2450a12bdf9e05dc813c332216f2e 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -1577,6 +1577,11 @@ int32_t doMinMaxHelper(SqlFunctionCtx* pCtx, int32_t isMinFunc) { } } + if (numOfElems == 0) { + GET_RES_INFO(pCtx)->isNullRes = 1; + numOfElems = 1; + } + _min_max_over: return numOfElems; }