From 9221513d97eb077f0c25ec674301e09017d3959a Mon Sep 17 00:00:00 2001 From: wangmm0220 Date: Tue, 7 Jun 2022 18:37:35 +0800 Subject: [PATCH] fix:memory leak & memory problem & sml params --- source/client/src/clientImpl.c | 3 +-- source/common/src/tglobal.c | 4 ++-- source/libs/executor/src/executorimpl.c | 10 +++++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/source/client/src/clientImpl.c b/source/client/src/clientImpl.c index 62026dd577..58c31548b0 100644 --- a/source/client/src/clientImpl.c +++ b/source/client/src/clientImpl.c @@ -1280,8 +1280,7 @@ static int32_t doConvertUCS4(SReqResultInfo* pResultInfo, int32_t numOfRows, int int32_t length = taosUcs4ToMbs((TdUcs4*)varDataVal(jsonInnerData), varDataLen(jsonInnerData), varDataVal(dst) + CHAR_BYTES); if (length <= 0) { - tscError("charset:%s to %s. val:%s convert failed.", DEFAULT_UNICODE_ENCODEC, tsCharset, - varDataVal(jsonInnerData)); + tscError("charset:%s to %s. convert failed.", DEFAULT_UNICODE_ENCODEC, tsCharset); length = 0; } varDataSetLen(dst, length + CHAR_BYTES * 2); diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index e77c462e5a..91b740fc96 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -332,7 +332,7 @@ static int32_t taosAddClientCfg(SConfig *pCfg) { if (cfgAddBool(pCfg, "keepColumnName", tsKeepOriginalColumnName, 1) != 0) return -1; if (cfgAddInt32(pCfg, "queryPolicy", tsQueryPolicy, 1, 3, 1) != 0) return -1; if (cfgAddString(pCfg, "smlChildTableName", "", 1) != 0) return -1; - if (cfgAddString(pCfg, "smlTagNullName", tsSmlTagName, 1) != 0) return -1; + if (cfgAddString(pCfg, "smlTagName", tsSmlTagName, 1) != 0) return -1; if (cfgAddBool(pCfg, "smlDataFormat", tsSmlDataFormat, 1) != 0) return -1; tsNumOfTaskQueueThreads = tsNumOfCores / 4; @@ -532,7 +532,7 @@ static int32_t taosSetClientCfg(SConfig *pCfg) { } tstrncpy(tsSmlChildTableName, cfgGetItem(pCfg, "smlChildTableName")->str, TSDB_TABLE_NAME_LEN); - tstrncpy(tsSmlTagName, cfgGetItem(pCfg, "smlTagNullName")->str, TSDB_COL_NAME_LEN); + tstrncpy(tsSmlTagName, cfgGetItem(pCfg, "smlTagName")->str, TSDB_COL_NAME_LEN); tsSmlDataFormat = cfgGetItem(pCfg, "smlDataFormat")->bval; tsShellActivityTimer = cfgGetItem(pCfg, "shellActivityTimer")->i32; diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index b986983d0c..9e3f9fa15c 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1883,11 +1883,11 @@ void extractQualifiedTupleByFilterResult(SSDataBlock* pBlock, const int8_t* rowR ASSERT(pBlock->info.rows == numOfRows); } - if(needFree){ - SColumnInfoData tmp = *pSrc; - *pSrc = *pDst; - *pDst = tmp; - }else{ + SColumnInfoData tmp = *pSrc; + *pSrc = *pDst; + *pDst = tmp; + + if(!needFree){ if(IS_VAR_DATA_TYPE(pDst->info.type)){ // this elements do not need free pDst->varmeta.offset = NULL; }else{ -- GitLab