Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
47477417
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
47477417
编写于
2月 29, 2020
作者:
H
hjxilinx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix memory leaks;
上级
2cc5b99b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
27 deletion
+10
-27
src/inc/tresultBuf.h
src/inc/tresultBuf.h
+1
-1
src/system/detail/src/vnodeQueryImpl.c
src/system/detail/src/vnodeQueryImpl.c
+8
-25
src/util/src/tresultBuf.c
src/util/src/tresultBuf.c
+1
-1
未找到文件。
src/inc/tresultBuf.h
浏览文件 @
47477417
...
...
@@ -88,7 +88,7 @@ int32_t getNumOfResultBufGroupId(SQueryDiskbasedResultBuf* pResultBuf);
* destroy result buffer
* @param pResultBuf
*/
void
destroyResultBuf
(
SQueryDiskbasedResultBuf
*
pResultBuf
);
void
destroy
Diskbased
ResultBuf
(
SQueryDiskbasedResultBuf
*
pResultBuf
);
/**
*
...
...
src/system/detail/src/vnodeQueryImpl.c
浏览文件 @
47477417
...
...
@@ -585,7 +585,7 @@ static void setExecParams(SQuery *pQuery, SQLFunctionCtx *pCtx, int64_t StartQue
void
createQueryResultInfo
(
SQuery
*
pQuery
,
SWindowResult
*
pResultRow
,
bool
isSTableQuery
,
SPosInfo
*
posInfo
);
static
void
destroyTimeWindowRes
(
SWindowResult
*
p
OneOutput
Res
,
int32_t
nOutputCols
);
static
void
destroyTimeWindowRes
(
SWindowResult
*
p
Window
Res
,
int32_t
nOutputCols
);
static
int32_t
binarySearchForBlockImpl
(
SCompBlock
*
pBlock
,
int32_t
numOfBlocks
,
TSKEY
skey
,
int32_t
order
)
{
int32_t
firstSlot
=
0
;
...
...
@@ -2020,10 +2020,6 @@ static bool needToLoadDataBlock(SQuery *pQuery, SField *pField, SQLFunctionCtx *
int32_t
initWindowResInfo
(
SWindowResInfo
*
pWindowResInfo
,
SQueryRuntimeEnv
*
pRuntimeEnv
,
int32_t
size
,
int32_t
threshold
,
int16_t
type
)
{
if
(
size
<
threshold
)
{
size
=
threshold
;
}
pWindowResInfo
->
capacity
=
size
;
pWindowResInfo
->
threshold
=
threshold
;
...
...
@@ -2037,7 +2033,7 @@ int32_t initWindowResInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRun
// use the pointer arraylist
pWindowResInfo
->
pResult
=
calloc
(
threshold
,
sizeof
(
SWindowResult
));
for
(
int32_t
i
=
0
;
i
<
threshold
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pWindowResInfo
->
capacity
;
++
i
)
{
SPosInfo
posInfo
=
{
-
1
,
-
1
};
createQueryResultInfo
(
pRuntimeEnv
->
pQuery
,
&
pWindowResInfo
->
pResult
[
i
],
pRuntimeEnv
->
stableQuery
,
&
posInfo
);
}
...
...
@@ -2051,7 +2047,7 @@ void cleanupTimeWindowInfo(SWindowResInfo *pWindowResInfo, SQueryRuntimeEnv *pRu
return
;
}
for
(
int32_t
i
=
0
;
i
<
pWindowResInfo
->
size
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pWindowResInfo
->
capacity
;
++
i
)
{
SWindowResult
*
pResult
=
&
pWindowResInfo
->
pResult
[
i
];
destroyTimeWindowRes
(
pResult
,
pRuntimeEnv
->
pQuery
->
numOfOutputCols
);
}
...
...
@@ -2905,7 +2901,8 @@ static void teardownQueryRuntimeEnv(SQueryRuntimeEnv *pRuntimeEnv) {
tfree
(
pRuntimeEnv
->
pInterpoBuf
);
}
destroyDiskbasedResultBuf
(
pRuntimeEnv
->
pResultBuf
);
pRuntimeEnv
->
pTSBuf
=
tsBufDestory
(
pRuntimeEnv
->
pTSBuf
);
}
...
...
@@ -4516,19 +4513,19 @@ static void allocMemForInterpo(STableQuerySupportObj *pSupporter, SQuery *pQuery
static
int32_t
getInitialPageNum
(
STableQuerySupportObj
*
pSupporter
)
{
SQuery
*
pQuery
=
pSupporter
->
runtimeEnv
.
pQuery
;
int32_t
INITIAL_RESULT_ROWS_VALUE
=
16
;
int32_t
num
=
0
;
if
(
isGroupbyNormalCol
(
pQuery
->
pGroupbyExpr
))
{
num
=
128
;
}
else
if
(
isIntervalQuery
(
pQuery
))
{
// time window query, allocate one page for each table
num
=
pSupporter
->
numOfMeters
;
num
=
MAX
(
pSupporter
->
numOfMeters
,
INITIAL_RESULT_ROWS_VALUE
)
;
}
else
{
// for super table query, one page for each subset
num
=
pSupporter
->
pSidSet
->
numOfSubSet
;
}
assert
(
num
>
0
);
return
num
;
}
...
...
@@ -4828,20 +4825,6 @@ void vnodeQueryFreeQInfoEx(SQInfo *pQInfo) {
pSupporter
->
pMetersHashTable
=
NULL
;
}
if
(
pSupporter
->
pSidSet
!=
NULL
||
isGroupbyNormalCol
(
pQInfo
->
query
.
pGroupbyExpr
)
||
isIntervalQuery
(
pQuery
))
{
int32_t
size
=
0
;
if
(
isGroupbyNormalCol
(
pQInfo
->
query
.
pGroupbyExpr
)
||
isIntervalQuery
(
pQuery
))
{
size
=
10000
;
}
else
if
(
pSupporter
->
pSidSet
!=
NULL
)
{
size
=
pSupporter
->
pSidSet
->
numOfSubSet
;
}
for
(
int32_t
i
=
0
;
i
<
size
;
++
i
)
{
// destroyTimeWindowRes(&pSupporter->pResult[i], pQInfo->query.numOfOutputCols);
}
}
tSidSetDestroy
(
&
pSupporter
->
pSidSet
);
if
(
pSupporter
->
pMeterDataInfo
!=
NULL
)
{
...
...
src/util/src/tresultBuf.c
浏览文件 @
47477417
...
...
@@ -189,7 +189,7 @@ SIDList getDataBufPagesIdList(SQueryDiskbasedResultBuf* pResultBuf, int32_t grou
}
}
void
destroyResultBuf
(
SQueryDiskbasedResultBuf
*
pResultBuf
)
{
void
destroy
Diskbased
ResultBuf
(
SQueryDiskbasedResultBuf
*
pResultBuf
)
{
if
(
pResultBuf
==
NULL
)
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录