Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d894e959
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看板
提交
d894e959
编写于
7月 14, 2022
作者:
X
Xiaoyu Wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: client module memory leak problem
上级
5a5ae23d
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
10 deletion
+15
-10
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+2
-6
source/client/src/clientMain.c
source/client/src/clientMain.c
+3
-1
source/libs/planner/src/planOptimizer.c
source/libs/planner/src/planOptimizer.c
+8
-3
source/libs/planner/test/planBasicTest.cpp
source/libs/planner/test/planBasicTest.cpp
+2
-0
未找到文件。
source/client/src/clientImpl.c
浏览文件 @
d894e959
...
...
@@ -934,7 +934,7 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM
int32_t
code
=
0
;
pRequest
->
body
.
execMode
=
pQuery
->
execMode
;
switch
(
pQuery
->
execMode
)
{
case
QUERY_EXEC_MODE_LOCAL
:
asyncExecLocalCmd
(
pRequest
,
pQuery
);
...
...
@@ -1006,10 +1006,6 @@ void launchAsyncQuery(SRequestObj* pRequest, SQuery* pQuery, SMetaData* pResultM
break
;
}
// if (!keepQuery) {
// qDestroyQuery(pQuery);
// }
if
(
NULL
!=
pRequest
&&
TSDB_CODE_SUCCESS
!=
code
)
{
pRequest
->
code
=
terrno
;
}
...
...
@@ -1479,7 +1475,7 @@ void* doAsyncFetchRows(SRequestObj* pRequest, bool setupOneRowPtr, bool convertU
tsem_wait
(
&
pParam
->
sem
);
}
if
(
pResultInfo
->
numOfRows
==
0
||
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
pResultInfo
->
numOfRows
==
0
||
pRequest
->
code
!=
TSDB_CODE_SUCCESS
)
{
return
NULL
;
}
else
{
if
(
setupOneRowPtr
)
{
...
...
source/client/src/clientMain.c
浏览文件 @
d894e959
...
...
@@ -688,8 +688,10 @@ void retrieveMetaCallback(SMetaData *pResultMeta, void *param, int32_t code) {
tscDebug
(
"0x%"
PRIx64
" analysis semantics completed, start async query, reqId:0x%"
PRIx64
,
pRequest
->
self
,
pRequest
->
requestId
);
launchAsyncQuery
(
pRequest
,
pQuery
,
pResultMeta
);
qDestroyQuery
(
pQuery
);
}
else
{
destorySqlParseWrapper
(
pWrapper
);
qDestroyQuery
(
pQuery
);
if
(
NEED_CLIENT_HANDLE_ERROR
(
code
))
{
tscDebug
(
"0x%"
PRIx64
" client retry to handle the error, code:%d - %s, tryCount:%d, reqId:0x%"
PRIx64
,
pRequest
->
self
,
code
,
tstrerror
(
code
),
pRequest
->
retry
,
pRequest
->
requestId
);
...
...
@@ -867,7 +869,7 @@ void taos_fetch_rows_a(TAOS_RES *res, __taos_async_fn_t fp, void *param) {
}
else
{
pResultInfo
->
numOfRows
=
0
;
}
pRequest
->
body
.
fetchFp
(
param
,
pRequest
,
pResultInfo
->
numOfRows
);
return
;
}
...
...
source/libs/planner/src/planOptimizer.c
浏览文件 @
d894e959
...
...
@@ -124,9 +124,11 @@ static bool scanPathOptMayBeOptimized(SLogicNode* pNode) {
QUERY_NODE_LOGIC_PLAN_PARTITION
!=
nodeType
(
pNode
->
pParent
)))
{
return
false
;
}
if
((
QUERY_NODE_LOGIC_PLAN_WINDOW
==
nodeType
(
pNode
->
pParent
)
&&
WINDOW_TYPE_INTERVAL
==
((
SWindowLogicNode
*
)
pNode
->
pParent
)
->
winType
)
||
if
((
QUERY_NODE_LOGIC_PLAN_WINDOW
==
nodeType
(
pNode
->
pParent
)
&&
WINDOW_TYPE_INTERVAL
==
((
SWindowLogicNode
*
)
pNode
->
pParent
)
->
winType
)
||
(
QUERY_NODE_LOGIC_PLAN_PARTITION
==
nodeType
(
pNode
->
pParent
)
&&
pNode
->
pParent
->
pParent
&&
QUERY_NODE_LOGIC_PLAN_WINDOW
==
nodeType
(
pNode
->
pParent
->
pParent
)
&&
WINDOW_TYPE_INTERVAL
==
((
SWindowLogicNode
*
)
pNode
->
pParent
)
->
winType
))
{
QUERY_NODE_LOGIC_PLAN_WINDOW
==
nodeType
(
pNode
->
pParent
->
pParent
)
&&
WINDOW_TYPE_INTERVAL
==
((
SWindowLogicNode
*
)
pNode
->
pParent
)
->
winType
))
{
return
true
;
}
if
(
QUERY_NODE_LOGIC_PLAN_AGG
==
nodeType
(
pNode
->
pParent
))
{
...
...
@@ -2010,7 +2012,10 @@ static int32_t lastRowScanOptimize(SOptimizeContext* pCxt, SLogicSubplan* pLogic
SFunctionNode
*
pFunc
=
(
SFunctionNode
*
)
pNode
;
int32_t
len
=
snprintf
(
pFunc
->
functionName
,
sizeof
(
pFunc
->
functionName
),
"_cache_last_row"
);
pFunc
->
functionName
[
len
]
=
'\0'
;
fmGetFuncInfo
(
pFunc
,
NULL
,
0
);
int32_t
code
=
fmGetFuncInfo
(
pFunc
,
NULL
,
0
);
if
(
TSDB_CODE_SUCCESS
!=
code
)
{
return
code
;
}
}
pAgg
->
hasLastRow
=
false
;
...
...
source/libs/planner/test/planBasicTest.cpp
浏览文件 @
d894e959
...
...
@@ -106,6 +106,8 @@ TEST_F(PlanBasicTest, lastRowFunc) {
run
(
"SELECT LAST_ROW(c1, c2) FROM t1"
);
run
(
"SELECT LAST_ROW(c1), c2 FROM t1"
);
run
(
"SELECT LAST_ROW(c1) FROM st1"
);
run
(
"SELECT LAST_ROW(c1) FROM st1 PARTITION BY TBNAME"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录