Merge pull request #12707 from taosdata/feature/udf

fix: set hasResult when old state has result
This commit is contained in:
shenglian-zhou 2022-05-19 18:11:40 +08:00 committed by GitHub
commit 6649018519
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}