Merge pull request #12631 from taosdata/feature/udf
fix: udfc checks output type and output bytes when executing scalar f…
This commit is contained in:
commit
7655f51ff8
|
@ -1528,7 +1528,15 @@ int32_t callUdfScalarFunc(char *udfName, SScalarParam *input, int32_t numOfCols,
|
|||
if (code != 0) {
|
||||
return code;
|
||||
}
|
||||
SUdfcUvSession *session = handle;
|
||||
code = doCallUdfScalarFunc(handle, input, numOfCols, output);
|
||||
if (session->outputType != output->columnData->info.type
|
||||
|| session->outputLen != output->columnData->info.bytes) {
|
||||
fnError("udfc scalar function calculate error, session type: %d(%d), output type: %d(%d)",
|
||||
session->outputType, session->outputLen,
|
||||
output->columnData->info.type, output->columnData->info.bytes);
|
||||
code = TSDB_CODE_UDF_INVALID_OUTPUT_TYPE;
|
||||
}
|
||||
releaseUdfFuncHandle(udfName);
|
||||
return code;
|
||||
}
|
||||
|
|
|
@ -139,7 +139,7 @@ void udfdProcessRpcRsp(void *parent, SRpcMsg *pMsg, SEpSet *pEpSet) {
|
|||
SUdf* udf = msgInfo->param;
|
||||
udf->funcType = pFuncInfo->funcType;
|
||||
udf->scriptType = pFuncInfo->scriptType;
|
||||
udf->outputType = pFuncInfo->funcType;
|
||||
udf->outputType = pFuncInfo->outputType;
|
||||
udf->outputLen = pFuncInfo->outputLen;
|
||||
udf->bufSize = pFuncInfo->bufSize;
|
||||
|
||||
|
|
Loading…
Reference in New Issue