From 6b09b72a63e3f1f3e7106c18eb85e096976e31dd Mon Sep 17 00:00:00 2001 From: slzhou Date: Tue, 14 Feb 2023 17:14:41 +0800 Subject: [PATCH] fix: make udfinfo temporary --- include/libs/function/taosudf.h | 9 +++------ source/libs/function/src/udfd.c | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/include/libs/function/taosudf.h b/include/libs/function/taosudf.h index 65d3a98654..eb229c24fc 100644 --- a/include/libs/function/taosudf.h +++ b/include/libs/function/taosudf.h @@ -73,6 +73,7 @@ typedef struct SUdfDataBlock { SUdfColumn **udfCols; } SUdfDataBlock; +// TODO: deprecate SUdfInterBuf.numOfResult or add isInitial to SUdfInterBuf typedef struct SUdfInterBuf { int32_t bufLen; char *buf; @@ -260,11 +261,9 @@ typedef int32_t (*TUdfAggMergeFunc)(SUdfInterBuf *inputBuf1, SUdfInterBuf *input typedef int32_t (*TUdfAggFinishFunc)(SUdfInterBuf *buf, SUdfInterBuf *resultData); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// TODO: capacity for path and -// define macro for name and path len or use dynamic allocation/shared with SUdf. typedef struct SUdfInfo { - char name[65]; + char *name; int8_t funcType; int8_t scriptType; @@ -272,11 +271,9 @@ typedef struct SUdfInfo { int32_t outputLen; int32_t bufSize; - char path[512]; + char *path; } SUdfInfo; -// TODO: deprecate SUdfInterBuf.numOfResult or add isInitial to SUdfInterBuf - typedef int32_t (*TScriptUdfScalarProcFunc)(SUdfDataBlock *block, SUdfColumn *resultCol, void *udfCtx); typedef int32_t (*TScriptUdfAggStartFunc)(SUdfInterBuf *buf, void *udfCtx); diff --git a/source/libs/function/src/udfd.c b/source/libs/function/src/udfd.c index 1f6f7902a4..b42ff1564d 100644 --- a/source/libs/function/src/udfd.c +++ b/source/libs/function/src/udfd.c @@ -414,10 +414,10 @@ void udfdProcessRequest(uv_work_t *req) { void convertUdf2UdfInfo(SUdf *udf, SUdfInfo *udfInfo) { udfInfo->bufSize = udf->bufSize; udfInfo->funcType = udf->funcType; - strncpy(udfInfo->name, udf->name, strlen(udf->name)); + udfInfo->name = udf->name; udfInfo->outputLen = udf->outputLen; udfInfo->outputType = udf->outputType; - strncpy(udfInfo->path, udf->path, strlen(udf->path)); + udfInfo->path = udf->path; udfInfo->scriptType = udf->scriptType; }