Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
08259f16
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看板
未验证
提交
08259f16
编写于
7月 11, 2022
作者:
H
Haojun Liao
提交者:
GitHub
7月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14780 from taosdata/feature/3_liaohj
fix(query): fix memory leak in query super table.
上级
a52c089d
91c1ae41
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
31 addition
and
31 deletion
+31
-31
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+30
-31
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+1
-0
未找到文件。
source/libs/executor/src/executorimpl.c
浏览文件 @
08259f16
...
@@ -3504,11 +3504,7 @@ static void destroyOperatorInfo(SOperatorInfo* pOperator) {
...
@@ -3504,11 +3504,7 @@ static void destroyOperatorInfo(SOperatorInfo* pOperator) {
pOperator
->
numOfDownstream
=
0
;
pOperator
->
numOfDownstream
=
0
;
}
}
if
(
pOperator
->
exprSupp
.
pExprInfo
!=
NULL
)
{
cleanupExprSupp
(
&
pOperator
->
exprSupp
);
destroyExprInfo
(
pOperator
->
exprSupp
.
pExprInfo
,
pOperator
->
exprSupp
.
numOfExprs
);
}
taosMemoryFreeClear
(
pOperator
->
exprSupp
.
pExprInfo
);
taosMemoryFreeClear
(
pOperator
);
taosMemoryFreeClear
(
pOperator
);
}
}
...
@@ -3587,6 +3583,25 @@ void initBasicInfo(SOptrBasicInfo* pInfo, SSDataBlock* pBlock) {
...
@@ -3587,6 +3583,25 @@ void initBasicInfo(SOptrBasicInfo* pInfo, SSDataBlock* pBlock) {
initResultRowInfo
(
&
pInfo
->
resultRowInfo
);
initResultRowInfo
(
&
pInfo
->
resultRowInfo
);
}
}
static
void
*
destroySqlFunctionCtx
(
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
)
{
if
(
pCtx
==
NULL
)
{
return
NULL
;
}
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
for
(
int32_t
j
=
0
;
j
<
pCtx
[
i
].
numOfParams
;
++
j
)
{
taosVariantDestroy
(
&
pCtx
[
i
].
param
[
j
].
param
);
}
taosMemoryFreeClear
(
pCtx
[
i
].
subsidiaries
.
pCtx
);
taosMemoryFree
(
pCtx
[
i
].
input
.
pData
);
taosMemoryFree
(
pCtx
[
i
].
input
.
pColumnDataAgg
);
}
taosMemoryFreeClear
(
pCtx
);
return
NULL
;
}
int32_t
initExprSupp
(
SExprSupp
*
pSup
,
SExprInfo
*
pExprInfo
,
int32_t
numOfExpr
)
{
int32_t
initExprSupp
(
SExprSupp
*
pSup
,
SExprInfo
*
pExprInfo
,
int32_t
numOfExpr
)
{
pSup
->
pExprInfo
=
pExprInfo
;
pSup
->
pExprInfo
=
pExprInfo
;
pSup
->
numOfExprs
=
numOfExpr
;
pSup
->
numOfExprs
=
numOfExpr
;
...
@@ -3600,6 +3615,16 @@ int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr) {
...
@@ -3600,6 +3615,16 @@ int32_t initExprSupp(SExprSupp* pSup, SExprInfo* pExprInfo, int32_t numOfExpr) {
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
}
}
void
cleanupExprSupp
(
SExprSupp
*
pSupp
)
{
destroySqlFunctionCtx
(
pSupp
->
pCtx
,
pSupp
->
numOfExprs
);
if
(
pSupp
->
pExprInfo
!=
NULL
)
{
destroyExprInfo
(
pSupp
->
pExprInfo
,
pSupp
->
numOfExprs
);
}
taosMemoryFreeClear
(
pSupp
->
pExprInfo
);
taosMemoryFree
(
pSupp
->
rowEntryInfoOffset
);
}
SOperatorInfo
*
createAggregateOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SOperatorInfo
*
createAggregateOperatorInfo
(
SOperatorInfo
*
downstream
,
SExprInfo
*
pExprInfo
,
int32_t
numOfCols
,
SSDataBlock
*
pResultBlock
,
SNode
*
pCondition
,
SExprInfo
*
pScalarExprInfo
,
SSDataBlock
*
pResultBlock
,
SNode
*
pCondition
,
SExprInfo
*
pScalarExprInfo
,
int32_t
numOfScalarExpr
,
SExecTaskInfo
*
pTaskInfo
)
{
int32_t
numOfScalarExpr
,
SExecTaskInfo
*
pTaskInfo
)
{
...
@@ -3650,25 +3675,6 @@ _error:
...
@@ -3650,25 +3675,6 @@ _error:
return
NULL
;
return
NULL
;
}
}
static
void
*
destroySqlFunctionCtx
(
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
)
{
if
(
pCtx
==
NULL
)
{
return
NULL
;
}
for
(
int32_t
i
=
0
;
i
<
numOfOutput
;
++
i
)
{
for
(
int32_t
j
=
0
;
j
<
pCtx
[
i
].
numOfParams
;
++
j
)
{
taosVariantDestroy
(
&
pCtx
[
i
].
param
[
j
].
param
);
}
taosMemoryFreeClear
(
pCtx
[
i
].
subsidiaries
.
pCtx
);
taosMemoryFree
(
pCtx
[
i
].
input
.
pData
);
taosMemoryFree
(
pCtx
[
i
].
input
.
pColumnDataAgg
);
}
taosMemoryFreeClear
(
pCtx
);
return
NULL
;
}
void
cleanupBasicInfo
(
SOptrBasicInfo
*
pInfo
)
{
void
cleanupBasicInfo
(
SOptrBasicInfo
*
pInfo
)
{
assert
(
pInfo
!=
NULL
);
assert
(
pInfo
!=
NULL
);
cleanupResultRowInfo
(
&
pInfo
->
resultRowInfo
);
cleanupResultRowInfo
(
&
pInfo
->
resultRowInfo
);
...
@@ -3710,13 +3716,6 @@ static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) {
...
@@ -3710,13 +3716,6 @@ static void destroyProjectOperatorInfo(void* param, int32_t numOfOutput) {
taosMemoryFreeClear
(
param
);
taosMemoryFreeClear
(
param
);
}
}
void
cleanupExprSupp
(
SExprSupp
*
pSupp
)
{
destroySqlFunctionCtx
(
pSupp
->
pCtx
,
pSupp
->
numOfExprs
);
destroyExprInfo
(
pSupp
->
pExprInfo
,
pSupp
->
numOfExprs
);
taosMemoryFree
(
pSupp
->
rowEntryInfoOffset
);
}
static
void
destroyIndefinitOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
static
void
destroyIndefinitOperatorInfo
(
void
*
param
,
int32_t
numOfOutput
)
{
SIndefOperatorInfo
*
pInfo
=
(
SIndefOperatorInfo
*
)
param
;
SIndefOperatorInfo
*
pInfo
=
(
SIndefOperatorInfo
*
)
param
;
cleanupBasicInfo
(
&
pInfo
->
binfo
);
cleanupBasicInfo
(
&
pInfo
->
binfo
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
08259f16
...
@@ -578,6 +578,7 @@ static void destroyTableScanOperatorInfo(void* param, int32_t numOfOutput) {
...
@@ -578,6 +578,7 @@ static void destroyTableScanOperatorInfo(void* param, int32_t numOfOutput) {
taosArrayDestroy
(
pTableScanInfo
->
pColMatchInfo
);
taosArrayDestroy
(
pTableScanInfo
->
pColMatchInfo
);
}
}
cleanupExprSupp
(
&
pTableScanInfo
->
pseudoSup
);
taosMemoryFreeClear
(
param
);
taosMemoryFreeClear
(
param
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录