Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
80808766
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看板
提交
80808766
编写于
7月 19, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix memory leak
上级
3e2ded39
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
7 deletion
+12
-7
source/client/inc/clientStmt.h
source/client/inc/clientStmt.h
+1
-1
source/client/src/clientStmt.c
source/client/src/clientStmt.c
+10
-6
source/libs/parser/src/parInsertData.c
source/libs/parser/src/parInsertData.c
+1
-0
未找到文件。
source/client/inc/clientStmt.h
浏览文件 @
80808766
...
...
@@ -72,7 +72,6 @@ typedef struct SStmtBindInfo {
typedef
struct
SStmtExecInfo
{
int32_t
affectedRows
;
SRequestObj
*
pRequest
;
SHashObj
*
pVgHash
;
SHashObj
*
pBlockHash
;
bool
autoCreateTbl
;
}
SStmtExecInfo
;
...
...
@@ -88,6 +87,7 @@ typedef struct SStmtSQLInfo {
SArray
*
nodeList
;
SStmtQueryResInfo
queryRes
;
bool
autoCreateTbl
;
SHashObj
*
pVgHash
;
}
SStmtSQLInfo
;
typedef
struct
STscStmt
{
...
...
source/client/src/clientStmt.c
浏览文件 @
80808766
...
...
@@ -160,7 +160,7 @@ int32_t stmtUpdateBindInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags,
int32_t
stmtUpdateExecInfo
(
TAOS_STMT
*
stmt
,
SHashObj
*
pVgHash
,
SHashObj
*
pBlockHash
,
bool
autoCreateTbl
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
pStmt
->
exec
.
pVgHash
=
pVgHash
;
pStmt
->
sql
.
pVgHash
=
pVgHash
;
pStmt
->
exec
.
pBlockHash
=
pBlockHash
;
pStmt
->
exec
.
autoCreateTbl
=
autoCreateTbl
;
...
...
@@ -182,7 +182,7 @@ int32_t stmtUpdateInfo(TAOS_STMT* stmt, STableMeta* pTableMeta, void* tags, char
int32_t
stmtGetExecInfo
(
TAOS_STMT
*
stmt
,
SHashObj
**
pVgHash
,
SHashObj
**
pBlockHash
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
*
pVgHash
=
pStmt
->
exec
.
pVgHash
;
*
pVgHash
=
pStmt
->
sql
.
pVgHash
;
*
pBlockHash
=
pStmt
->
exec
.
pBlockHash
;
return
TSDB_CODE_SUCCESS
;
...
...
@@ -313,6 +313,8 @@ int32_t stmtCleanSQLInfo(STscStmt* pStmt) {
taosMemoryFree
(
pStmt
->
sql
.
sqlStr
);
qDestroyQuery
(
pStmt
->
sql
.
pQuery
);
taosArrayDestroy
(
pStmt
->
sql
.
nodeList
);
taosHashCleanup
(
pStmt
->
sql
.
pVgHash
);
pStmt
->
sql
.
pVgHash
=
NULL
;
void
*
pIter
=
taosHashIterate
(
pStmt
->
sql
.
pTableCache
,
NULL
);
while
(
pIter
)
{
...
...
@@ -345,7 +347,7 @@ int32_t stmtRebuildDataBlock(STscStmt* pStmt, STableDataBlocks* pDataBlock, STab
STMT_ERR_RET
(
catalogGetTableHashVgroup
(
pStmt
->
pCatalog
,
&
conn
,
&
pStmt
->
bInfo
.
sname
,
&
vgInfo
));
STMT_ERR_RET
(
taosHashPut
(
pStmt
->
exec
.
pVgHash
,
(
const
char
*
)
&
vgInfo
.
vgId
,
sizeof
(
vgInfo
.
vgId
),
(
char
*
)
&
vgInfo
,
sizeof
(
vgInfo
)));
taosHashPut
(
pStmt
->
sql
.
pVgHash
,
(
const
char
*
)
&
vgInfo
.
vgId
,
sizeof
(
vgInfo
.
vgId
),
(
char
*
)
&
vgInfo
,
sizeof
(
vgInfo
)));
STMT_ERR_RET
(
qRebuildStmtDataBlock
(
newBlock
,
pDataBlock
,
uid
,
vgInfo
.
vgId
));
...
...
@@ -685,6 +687,7 @@ int stmtBindBatch(TAOS_STMT* stmt, TAOS_MULTI_BIND* bind, int32_t colIdx) {
if
(
pStmt
->
sql
.
pQuery
->
haveResultSet
)
{
setResSchemaInfo
(
&
pStmt
->
exec
.
pRequest
->
body
.
resInfo
,
pStmt
->
sql
.
pQuery
->
pResSchema
,
pStmt
->
sql
.
pQuery
->
numOfResCols
);
taosMemoryFreeClear
(
pStmt
->
sql
.
pQuery
->
pResSchema
);
setResPrecision
(
&
pStmt
->
exec
.
pRequest
->
body
.
resInfo
,
pStmt
->
sql
.
pQuery
->
precision
);
}
...
...
@@ -809,7 +812,7 @@ int stmtExec(TAOS_STMT* stmt) {
if
(
STMT_TYPE_QUERY
==
pStmt
->
sql
.
type
)
{
launchQueryImpl
(
pStmt
->
exec
.
pRequest
,
pStmt
->
sql
.
pQuery
,
true
,
NULL
);
}
else
{
STMT_ERR_RET
(
qBuildStmtOutput
(
pStmt
->
sql
.
pQuery
,
pStmt
->
exec
.
pVgHash
,
pStmt
->
exec
.
pBlockHash
));
STMT_ERR_RET
(
qBuildStmtOutput
(
pStmt
->
sql
.
pQuery
,
pStmt
->
sql
.
pVgHash
,
pStmt
->
exec
.
pBlockHash
));
launchQueryImpl
(
pStmt
->
exec
.
pRequest
,
pStmt
->
sql
.
pQuery
,
true
,
(
autoCreateTbl
?
(
void
**
)
&
pRsp
:
NULL
));
}
...
...
@@ -852,9 +855,10 @@ _return:
int
stmtClose
(
TAOS_STMT
*
stmt
)
{
STscStmt
*
pStmt
=
(
STscStmt
*
)
stmt
;
STMT_RET
(
stmtCleanSQLInfo
(
pStmt
));
stmtCleanSQLInfo
(
pStmt
);
taosMemoryFree
(
stmt
);
return
TSDB_CODE_SUCCESS
;
}
const
char
*
stmtErrstr
(
TAOS_STMT
*
stmt
)
{
...
...
source/libs/parser/src/parInsertData.c
浏览文件 @
80808766
...
...
@@ -678,6 +678,7 @@ void qFreeStmtDataBlock(void* pDataBlock) {
return
;
}
taosMemoryFreeClear
(((
STableDataBlocks
*
)
pDataBlock
)
->
pTableMeta
);
taosMemoryFreeClear
(((
STableDataBlocks
*
)
pDataBlock
)
->
pData
);
taosMemoryFreeClear
(
pDataBlock
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录