提交 7356bf39 编写于 作者: D dapan1121

fix union all issue

上级 72495356
...@@ -8568,6 +8568,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) { ...@@ -8568,6 +8568,7 @@ int32_t loadAllTableMeta(SSqlObj* pSql, struct SSqlInfo* pInfo) {
if (functionId < 0) { if (functionId < 0) {
struct SUdfInfo info = {0}; struct SUdfInfo info = {0};
info.name = strndup(t->z, t->n); info.name = strndup(t->z, t->n);
info.keep = true;
if (pQueryInfo->pUdfInfo == NULL) { if (pQueryInfo->pUdfInfo == NULL) {
pQueryInfo->pUdfInfo = taosArrayInit(4, sizeof(struct SUdfInfo)); pQueryInfo->pUdfInfo = taosArrayInit(4, sizeof(struct SUdfInfo));
} else if (taosArrayGetSize(pQueryInfo->pUdfInfo) > 0) { } else if (taosArrayGetSize(pQueryInfo->pUdfInfo) > 0) {
......
...@@ -51,6 +51,7 @@ typedef struct SUdfInfo { ...@@ -51,6 +51,7 @@ typedef struct SUdfInfo {
SUdfInit init; SUdfInit init;
char *content; char *content;
char *path; char *path;
bool keep;
} SUdfInfo; } SUdfInfo;
//script //script
......
...@@ -8075,10 +8075,21 @@ int32_t initUdfInfo(SUdfInfo* pUdfInfo) { ...@@ -8075,10 +8075,21 @@ int32_t initUdfInfo(SUdfInfo* pUdfInfo) {
// TODO check for failure of flush to disk // TODO check for failure of flush to disk
/*size_t t = */ fwrite(pUdfInfo->content, pUdfInfo->contLen, 1, file); /*size_t t = */ fwrite(pUdfInfo->content, pUdfInfo->contLen, 1, file);
fclose(file); fclose(file);
tfree(pUdfInfo->content); if (!pUdfInfo->keep) {
tfree(pUdfInfo->content);
}
if (pUdfInfo->path) {
unlink(pUdfInfo->path);
}
tfree(pUdfInfo->path);
pUdfInfo->path = strdup(path); pUdfInfo->path = strdup(path);
if (pUdfInfo->handle) {
taosCloseDll(pUdfInfo->handle);
}
pUdfInfo->handle = taosLoadDll(path); pUdfInfo->handle = taosLoadDll(path);
if (NULL == pUdfInfo->handle) { if (NULL == pUdfInfo->handle) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册