From e6e7a89db810ee166d9d109b3f9bf8d6243bb0e1 Mon Sep 17 00:00:00 2001 From: dapan1121 <89396746@qq.com> Date: Mon, 26 Apr 2021 17:20:02 +0800 Subject: [PATCH] fix crash issue --- src/client/inc/tsclient.h | 3 ++- src/client/src/tscUtil.c | 8 +++++++- src/query/inc/qUdf.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/client/inc/tsclient.h b/src/client/inc/tsclient.h index 5b2d598222..db3b679f93 100644 --- a/src/client/inc/tsclient.h +++ b/src/client/inc/tsclient.h @@ -262,7 +262,8 @@ typedef struct { uint8_t msgType; char reserve1[3]; // fix bus error on arm32 bool autoCreated; // create table if it is not existed during retrieve table meta in mnode - + bool subCmd; + union { int32_t count; int32_t numOfTablesInSubmit; diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 27279aaaee..a034de1714 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -497,7 +497,11 @@ void tscResetSqlCmd(SSqlCmd* pCmd, bool removeMeta) { pCmd->pTableBlockHashList = tscDestroyBlockHashTable(pCmd->pTableBlockHashList, removeMeta); pCmd->pDataBlocks = tscDestroyBlockArrayList(pCmd->pDataBlocks); - pCmd->pUdfInfo = tscDestroyUdfArrayList(pCmd->pUdfInfo); + if (pCmd->subCmd) { + pCmd->pUdfInfo = taosArrayDestroy(pCmd->pUdfInfo); + } else { + pCmd->pUdfInfo = tscDestroyUdfArrayList(pCmd->pUdfInfo); + } tscFreeQueryInfo(pCmd, removeMeta); } @@ -2281,6 +2285,8 @@ SSqlObj* createSubqueryObj(SSqlObj* pSql, int16_t tableIndex, __async_cb_func_t SSqlCmd* pnCmd = &pNew->cmd; memcpy(pnCmd, pCmd, sizeof(SSqlCmd)); + + pnCmd->subCmd = true; pnCmd->command = cmd; pnCmd->payload = NULL; diff --git a/src/query/inc/qUdf.h b/src/query/inc/qUdf.h index 26573cb743..c66ca5a21b 100644 --- a/src/query/inc/qUdf.h +++ b/src/query/inc/qUdf.h @@ -51,6 +51,8 @@ typedef struct SUdfInfo { SUdfInit init; char *content; char *path; + + bool cloned; } SUdfInfo; //script -- GitLab