From 5a3f6b11e7993f3af9747855d408323149a1c2da Mon Sep 17 00:00:00 2001 From: slzhou Date: Thu, 19 May 2022 17:48:34 +0800 Subject: [PATCH] fix: set hasResult when old state has result --- source/libs/function/test/udf2.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/libs/function/test/udf2.c b/source/libs/function/test/udf2.c index 6410af2a4b..101595e866 100644 --- a/source/libs/function/test/udf2.c +++ b/source/libs/function/test/udf2.c @@ -64,7 +64,11 @@ int32_t udf2(SUdfDataBlock* block, SUdfInterBuf *interBuf, SUdfInterBuf *newInte *(double*)(newInterBuf->buf) = sumSquares; newInterBuf->bufLen = sizeof(double); } - newInterBuf->numOfResult = numOutput; + if (interBuf->numOfResult == 0 && numOutput == 0) { + newInterBuf->numOfResult = 0; + } else { + newInterBuf->numOfResult = 1; + } return 0; }