diff --git a/include/common/tmsg.h b/include/common/tmsg.h index cde3315ffb4c045aab83d52b2737fd05f0264750..5bcee58bba27a6744595281bf508fd94d374bb58 100644 --- a/include/common/tmsg.h +++ b/include/common/tmsg.h @@ -3203,6 +3203,7 @@ int32_t tSerializeSMqHbReq(void* buf, int32_t bufLen, SMqHbReq* pReq); int32_t tDeserializeSMqHbReq(void* buf, int32_t bufLen, SMqHbReq* pReq); typedef struct { + bool isColFmt; int64_t suid; int64_t uid; int32_t sver; diff --git a/source/common/src/tmsg.c b/source/common/src/tmsg.c index 233d62b1825b54dd2ab510050d76024b5a4d754a..76127d727c3b0d493fbfa756ea6ef5261c7d3b0c 100644 --- a/source/common/src/tmsg.c +++ b/source/common/src/tmsg.c @@ -6834,18 +6834,26 @@ _exit: return code; } +void destroySSubmitTbData(SSubmitTbData *pTbData) { + if (pTbData->isColFmt) { + // todo + } else { + taosArrayDestroyP(pTbData->aRowP, (FDelete)tRowDestroy); + } +} + void tDestroySSubmitTbData(SSubmitTbData *pTbData) { - // todo + if (NULL == pTbData) { + return; + } + destroySSubmitTbData(pTbData); + taosMemoryFree(pTbData); } void tDestroySSubmitReq2(SSubmitReq2 *pReq) { if (NULL == pReq) return; - if (pReq->flag & SUBMIT_REQ_AUTO_CREATE_TABLE) { - taosArrayDestroyEx(pReq->aCreateTbReq, NULL /* todo */); - } - - taosArrayDestroyEx(pReq->aSubmitTbData, NULL /* todo */); - + taosArrayDestroyEx(pReq->aCreateTbReq, (FDelete)tdDestroySVCreateTbReq); + taosArrayDestroyEx(pReq->aSubmitTbData, (FDelete)destroySSubmitTbData); taosMemoryFree(pReq); } diff --git a/source/libs/parser/src/parInsertUtil.c b/source/libs/parser/src/parInsertUtil.c index 19a022bf31f2d7e118de891f54520b768cba89dc..eddf65fe87ab9ced40db7bca31308793b14c92e9 100644 --- a/source/libs/parser/src/parInsertUtil.c +++ b/source/libs/parser/src/parInsertUtil.c @@ -1071,6 +1071,7 @@ void insDestroyTableDataCxt(STableDataCxt* pTableCxt) { tdDestroySVCreateTbReq(pTableCxt->pCreateTblReq); taosMemoryFreeClear(pTableCxt->pCreateTblReq); tDestroySSubmitTbData(pTableCxt->pData); + taosMemoryFree(pTableCxt); } void insDestroyVgroupDataCxt(SVgroupDataCxt* pVgCxt) { @@ -1079,6 +1080,7 @@ void insDestroyVgroupDataCxt(SVgroupDataCxt* pVgCxt) { } tDestroySSubmitReq2(pVgCxt->pData); + taosMemoryFree(pVgCxt); } void insDestroyVgroupDataCxtList(SArray* pVgCxtList) { @@ -1134,6 +1136,7 @@ static int32_t fillVgroupDataCxt(STableDataCxt* pTableCxt, SVgroupDataCxt* pVgCx } } taosArrayPush(pVgCxt->pData->aCreateTbReq, pTableCxt->pCreateTblReq); + taosMemoryFreeClear(pTableCxt->pCreateTblReq); } if (NULL == pVgCxt->pData->aSubmitTbData) { @@ -1143,7 +1146,7 @@ static int32_t fillVgroupDataCxt(STableDataCxt* pTableCxt, SVgroupDataCxt* pVgCx } } taosArrayPush(pVgCxt->pData->aSubmitTbData, pTableCxt->pData); - pTableCxt->pData = NULL; + taosMemoryFreeClear(pTableCxt->pData); return TSDB_CODE_SUCCESS; }