Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
20e2010f
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
20e2010f
编写于
3月 23, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:memory leak
上级
6b8fd258
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
29 deletion
+36
-29
source/client/src/clientRawBlockWrite.c
source/client/src/clientRawBlockWrite.c
+36
-29
未找到文件。
source/client/src/clientRawBlockWrite.c
浏览文件 @
20e2010f
...
...
@@ -183,7 +183,7 @@ static char* buildAlterSTableJson(void* alterData, int32_t alterDataLen) {
}
string
=
cJSON_PrintUnformatted
(
json
);
end:
end:
cJSON_Delete
(
json
);
tFreeSMAltertbReq
(
&
req
);
return
string
;
...
...
@@ -205,7 +205,7 @@ static char* processCreateStb(SMqMetaRsp* metaRsp) {
}
string
=
buildCreateTableJson
(
&
req
.
schemaRow
,
&
req
.
schemaTag
,
req
.
name
,
req
.
suid
,
TSDB_SUPER_TABLE
);
uDebug
(
"processCreateStb %s"
,
string
);
_err:
_err:
tDecoderClear
(
&
coder
);
return
string
;
}
...
...
@@ -227,7 +227,7 @@ static char* processAlterStb(SMqMetaRsp* metaRsp) {
string
=
buildAlterSTableJson
(
req
.
alterOriData
,
req
.
alterOriDataLen
);
uDebug
(
"processAlterStb %s"
,
string
);
_err:
_err:
tDecoderClear
(
&
coder
);
return
string
;
}
...
...
@@ -309,7 +309,7 @@ static void buildChildElement(cJSON* json, SVCreateTbReq* pCreateReq) {
cJSON_AddItemToArray
(
tags
,
tag
);
}
end:
end:
cJSON_AddItemToObject
(
json
,
"tags"
,
tags
);
taosArrayDestroy
(
pTagVals
);
}
...
...
@@ -368,7 +368,7 @@ static char* processCreateTable(SMqMetaRsp* metaRsp) {
uDebug
(
"processCreateTable :%s"
,
string
);
}
_exit:
_exit:
for
(
int32_t
iReq
=
0
;
iReq
<
req
.
nReqs
;
iReq
++
)
{
pCreateReq
=
req
.
pReqs
+
iReq
;
taosMemoryFreeClear
(
pCreateReq
->
comment
);
...
...
@@ -408,7 +408,7 @@ static char* processAutoCreateTable(STaosxRsp* rsp) {
}
string
=
buildCreateCTableJson
(
pCreateReq
,
rsp
->
createTableNum
);
uDebug
(
"processAutoCreateTable :%s"
,
string
);
_exit:
_exit:
for
(
int
i
=
0
;
i
<
rsp
->
createTableNum
;
i
++
)
{
tDecoderClear
(
&
decoder
[
i
]);
taosMemoryFreeClear
(
pCreateReq
[
i
].
comment
);
...
...
@@ -535,7 +535,7 @@ static char* processAlterTable(SMqMetaRsp* metaRsp) {
string
=
cJSON_PrintUnformatted
(
json
);
uDebug
(
"processAlterTable :%s"
,
string
);
_exit:
_exit:
cJSON_Delete
(
json
);
tDecoderClear
(
&
decoder
);
return
string
;
...
...
@@ -569,7 +569,7 @@ static char* processDropSTable(SMqMetaRsp* metaRsp) {
string
=
cJSON_PrintUnformatted
(
json
);
uDebug
(
"processDropSTable :%s"
,
string
);
_exit:
_exit:
cJSON_Delete
(
json
);
tDecoderClear
(
&
decoder
);
return
string
;
...
...
@@ -609,7 +609,7 @@ static char* processDeleteTable(SMqMetaRsp* metaRsp) {
string
=
cJSON_PrintUnformatted
(
json
);
uDebug
(
"processDeleteTable :%s"
,
string
);
_exit:
_exit:
cJSON_Delete
(
json
);
tDecoderClear
(
&
coder
);
return
string
;
...
...
@@ -652,7 +652,7 @@ static char* processDropTable(SMqMetaRsp* metaRsp) {
string
=
cJSON_PrintUnformatted
(
json
);
uDebug
(
"processDropTable :%s"
,
string
);
_exit:
_exit:
cJSON_Delete
(
json
);
tDecoderClear
(
&
decoder
);
return
string
;
...
...
@@ -742,7 +742,7 @@ static int32_t taosCreateStb(TAOS* taos, void* meta, int32_t metaLen) {
code
=
pRequest
->
code
;
taosMemoryFree
(
pCmdMsg
.
pMsg
);
end:
end:
destroyRequest
(
pRequest
);
tFreeSMCreateStbReq
(
&
pReq
);
tDecoderClear
(
&
coder
);
...
...
@@ -839,7 +839,7 @@ static int32_t taosDropStb(TAOS* taos, void* meta, int32_t metaLen) {
code
=
pRequest
->
code
;
taosMemoryFree
(
pCmdMsg
.
pMsg
);
end:
end:
destroyRequest
(
pRequest
);
tDecoderClear
(
&
coder
);
return
code
;
...
...
@@ -901,9 +901,9 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
taosHashSetFreeFp
(
pVgroupHashmap
,
destroyCreateTbReqBatch
);
SRequestConnInfo
conn
=
{.
pTrans
=
pTscObj
->
pAppInfo
->
pTransporter
,
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
pRequest
->
tableList
=
taosArrayInit
(
req
.
nReqs
,
sizeof
(
SName
));
// loop to create table
...
...
@@ -987,7 +987,7 @@ static int32_t taosCreateTable(TAOS* taos, void* meta, int32_t metaLen) {
code
=
pRequest
->
code
;
end:
end:
for
(
int32_t
iReq
=
0
;
iReq
<
req
.
nReqs
;
iReq
++
)
{
pCreateReq
=
req
.
pReqs
+
iReq
;
taosMemoryFreeClear
(
pCreateReq
->
comment
);
...
...
@@ -1058,9 +1058,9 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
taosHashSetFreeFp
(
pVgroupHashmap
,
destroyDropTbReqBatch
);
SRequestConnInfo
conn
=
{.
pTrans
=
pTscObj
->
pAppInfo
->
pTransporter
,
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
pRequest
->
tableList
=
taosArrayInit
(
req
.
nReqs
,
sizeof
(
SName
));
// loop to create table
for
(
int32_t
iReq
=
0
;
iReq
<
req
.
nReqs
;
iReq
++
)
{
...
...
@@ -1132,7 +1132,7 @@ static int32_t taosDropTable(TAOS* taos, void* meta, int32_t metaLen) {
}
code
=
pRequest
->
code
;
end:
end:
taosHashCleanup
(
pVgroupHashmap
);
destroyRequest
(
pRequest
);
tDecoderClear
(
&
coder
);
...
...
@@ -1201,7 +1201,7 @@ static int32_t taosDeleteData(TAOS* taos, void* meta, int32_t metaLen) {
}
taos_free_result
(
res
);
end:
end:
tDecoderClear
(
&
coder
);
return
code
;
}
...
...
@@ -1249,9 +1249,9 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
}
SRequestConnInfo
conn
=
{.
pTrans
=
pTscObj
->
pAppInfo
->
pTransporter
,
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
.
requestId
=
pRequest
->
requestId
,
.
requestObjRefId
=
pRequest
->
self
,
.
mgmtEps
=
getEpSet_s
(
&
pTscObj
->
pAppInfo
->
mgmtEp
)};
SVgroupInfo
pInfo
=
{
0
};
SName
pName
=
{
0
};
...
...
@@ -1311,7 +1311,7 @@ static int32_t taosAlterTable(TAOS* taos, void* meta, int32_t metaLen) {
code
=
handleAlterTbExecRes
(
pRes
->
res
,
pCatalog
);
}
}
end:
end:
taosArrayDestroy
(
pArray
);
if
(
pVgData
)
taosMemoryFreeClear
(
pVgData
->
pData
);
taosMemoryFreeClear
(
pVgData
);
...
...
@@ -1399,7 +1399,7 @@ int taos_write_raw_block_with_fields(TAOS* taos, int rows, char* pData, const ch
launchQueryImpl
(
pRequest
,
pQuery
,
true
,
NULL
);
code
=
pRequest
->
code
;
end:
end:
taosMemoryFreeClear
(
pTableMeta
);
qDestroyQuery
(
pQuery
);
destroyRequest
(
pRequest
);
...
...
@@ -1481,7 +1481,7 @@ int taos_write_raw_block(TAOS* taos, int rows, char* pData, const char* tbname)
launchQueryImpl
(
pRequest
,
pQuery
,
true
,
NULL
);
code
=
pRequest
->
code
;
end:
end:
taosMemoryFreeClear
(
pTableMeta
);
qDestroyQuery
(
pQuery
);
destroyRequest
(
pRequest
);
...
...
@@ -1601,6 +1601,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
uError
(
"WriteRaw:rawBlockBindData failed"
);
goto
end
;
}
taosMemoryFreeClear
(
pTableMeta
);
}
code
=
smlBuildOutput
(
pQuery
,
pVgHash
);
...
...
@@ -1612,7 +1613,7 @@ static int32_t tmqWriteRawDataImpl(TAOS* taos, void* data, int32_t dataLen) {
launchQueryImpl
(
pRequest
,
pQuery
,
true
,
NULL
);
code
=
pRequest
->
code
;
end:
end:
tDeleteSMqDataRsp
(
&
rspObj
.
rsp
);
tDecoderClear
(
&
decoder
);
qDestroyQuery
(
pQuery
);
...
...
@@ -1707,6 +1708,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
tDecoderInit
(
&
decoderTmp
,
*
dataTmp
,
*
lenTmp
);
if
(
tDecodeSVCreateTbReq
(
&
decoderTmp
,
&
pCreateReq
)
<
0
)
{
tDecoderClear
(
&
decoderTmp
);
tDestroySVCreateTbReq
(
&
pCreateReq
,
TSDB_MSG_FLG_DECODE
);
uError
(
"WriteRaw: tDecodeSVCreateTbReq error"
);
code
=
TSDB_CODE_TMQ_INVALID_MSG
;
goto
end
;
...
...
@@ -1715,15 +1717,19 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
if
(
pCreateReq
.
type
!=
TSDB_CHILD_TABLE
)
{
uError
(
"WriteRaw:pCreateReq.type != TSDB_CHILD_TABLE. table name: %s"
,
tbName
);
code
=
TSDB_CODE_TSC_INVALID_VALUE
;
tDecoderClear
(
&
decoderTmp
);
tDestroySVCreateTbReq
(
&
pCreateReq
,
TSDB_MSG_FLG_DECODE
);
goto
end
;
}
if
(
strcmp
(
tbName
,
pCreateReq
.
name
)
==
0
)
{
cloneSVreateTbReq
(
&
pCreateReq
,
&
pCreateReqDst
);
// pCreateReqDst->ctb.suid = processSuid(pCreateReqDst->ctb.suid, pRequest->pDb);
tDecoderClear
(
&
decoderTmp
);
tDestroySVCreateTbReq
(
&
pCreateReq
,
TSDB_MSG_FLG_DECODE
);
break
;
}
tDecoderClear
(
&
decoderTmp
);
tDestroySVCreateTbReq
(
&
pCreateReq
,
TSDB_MSG_FLG_DECODE
);
}
SVgroupInfo
vg
;
...
...
@@ -1774,6 +1780,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
goto
end
;
}
pCreateReqDst
=
NULL
;
taosMemoryFreeClear
(
pTableMeta
);
}
code
=
smlBuildOutput
(
pQuery
,
pVgHash
);
...
...
@@ -1785,7 +1792,7 @@ static int32_t tmqWriteRawMetaDataImpl(TAOS* taos, void* data, int32_t dataLen)
launchQueryImpl
(
pRequest
,
pQuery
,
true
,
NULL
);
code
=
pRequest
->
code
;
end:
end:
tDeleteSTaosxRsp
(
&
rspObj
.
rsp
);
tDecoderClear
(
&
decoder
);
qDestroyQuery
(
pQuery
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录