Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
loser646
TDengine
提交
80b2acff
T
TDengine
项目概览
loser646
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
80b2acff
编写于
10月 30, 2020
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-225] fix memory leaks.
上级
db6f936c
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
15 addition
and
11 deletion
+15
-11
src/client/src/tscSubquery.c
src/client/src/tscSubquery.c
+5
-3
src/common/src/tvariant.c
src/common/src/tvariant.c
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+2
-1
src/query/src/qTsbuf.c
src/query/src/qTsbuf.c
+7
-6
未找到文件。
src/client/src/tscSubquery.c
浏览文件 @
80b2acff
...
...
@@ -520,9 +520,10 @@ void tscBuildVgroupTableInfo(SSqlObj* pSql, STableMetaInfo* pTableMetaInfo, SArr
taosArrayPush
(
result
,
&
info
);
}
tscDebug
(
"%p tid:%d, uid:%"
PRIu64
",vgId:%d added for vnode query"
,
pSql
,
tt
->
tid
,
tt
->
uid
,
tt
->
vgId
)
STableIdInfo
item
=
{.
uid
=
tt
->
uid
,
.
tid
=
tt
->
tid
,
.
key
=
INT64_MIN
};
taosArrayPush
(
vgTables
,
&
item
);
tscDebug
(
"%p tid:%d, uid:%"
PRIu64
",vgId:%d added, total:%d"
,
pSql
,
tt
->
tid
,
tt
->
uid
,
tt
->
vgId
,
(
int32_t
)
taosArrayGetSize
(
vgTables
));
prev
=
tt
;
}
...
...
@@ -602,11 +603,11 @@ static bool checkForDuplicateTagVal(SSchema* pColSchema, SJoinSupporter* p1, SSq
}
static
int32_t
getIntersectionOfTableTuple
(
SQueryInfo
*
pQueryInfo
,
SSqlObj
*
pParentSql
,
SArray
**
s1
,
SArray
**
s2
)
{
tscDebug
(
"%p all subqueries retrieve <tid, tags> complete, do tags match"
,
pParentSql
);
SJoinSupporter
*
p1
=
pParentSql
->
pSubs
[
0
]
->
param
;
SJoinSupporter
*
p2
=
pParentSql
->
pSubs
[
1
]
->
param
;
tscDebug
(
"%p all subquery retrieve <tid, tags> complete, do tags match, %d, %d"
,
pParentSql
,
p1
->
num
,
p2
->
num
);
// sort according to the tag value
qsort
(
p1
->
pIdTagList
,
p1
->
num
,
p1
->
tagSize
,
tagValCompar
);
qsort
(
p2
->
pIdTagList
,
p2
->
num
,
p2
->
tagSize
,
tagValCompar
);
...
...
@@ -655,6 +656,7 @@ static int32_t getIntersectionOfTableTuple(SQueryInfo* pQueryInfo, SSqlObj* pPar
qsort
((
*
s1
)
->
pData
,
t1
,
size
,
tidTagsCompar
);
qsort
((
*
s2
)
->
pData
,
t2
,
size
,
tidTagsCompar
);
tscDebug
(
"%p tags match complete, result: %"
PRId64
", %"
PRId64
,
pParentSql
,
t1
,
t2
);
return
TSDB_CODE_SUCCESS
;
}
...
...
src/common/src/tvariant.c
浏览文件 @
80b2acff
...
...
@@ -108,7 +108,7 @@ void tVariantCreateFromBinary(tVariant *pVar, const char *pz, size_t len, uint32
break
;
}
case
TSDB_DATA_TYPE_BINARY
:
{
// todo refactor, extract a method
pVar
->
pz
=
calloc
(
len
,
sizeof
(
char
));
pVar
->
pz
=
calloc
(
len
+
1
,
sizeof
(
char
));
memcpy
(
pVar
->
pz
,
pz
,
len
);
pVar
->
nLen
=
(
int32_t
)
len
;
break
;
...
...
src/query/src/qExecutor.c
浏览文件 @
80b2acff
...
...
@@ -3762,6 +3762,7 @@ void destroyTableQueryInfoImpl(STableQueryInfo *pTableQueryInfo) {
return
;
}
tVariantDestroy
(
&
pTableQueryInfo
->
tag
);
cleanupTimeWindowInfo
(
&
pTableQueryInfo
->
windowResInfo
);
}
...
...
@@ -6345,7 +6346,7 @@ static SQInfo *createQInfoImpl(SQueryTableMsg *pQueryMsg, SSqlGroupbyExpr *pGrou
for
(
int32_t
j
=
0
;
j
<
s
;
++
j
)
{
STableKeyInfo
*
info
=
taosArrayGet
(
pa
,
j
);
void
*
buf
=
(
char
*
)
pQInfo
->
pBuf
+
index
*
sizeof
(
STableQueryInfo
);
void
*
buf
=
(
char
*
)
pQInfo
->
pBuf
+
index
*
sizeof
(
STableQueryInfo
);
window
.
skey
=
info
->
lastKey
;
STableQueryInfo
*
item
=
createTableQueryInfo
(
&
pQInfo
->
runtimeEnv
,
info
->
pTable
,
window
,
buf
);
...
...
src/query/src/qTsbuf.c
浏览文件 @
80b2acff
...
...
@@ -156,7 +156,8 @@ void* tsBufDestroy(STSBuf* pTSBuf) {
}
else
{
// tscDebug("tsBuf %p destroyed, tmp file:%s, remains", pTSBuf, pTSBuf->path);
}
tVariantDestroy
(
&
pTSBuf
->
block
.
tag
);
free
(
pTSBuf
);
return
NULL
;
}
...
...
@@ -284,12 +285,12 @@ static void expandBuffer(STSList* ptsData, int32_t inputSize) {
STSBlock
*
readDataFromDisk
(
STSBuf
*
pTSBuf
,
int32_t
order
,
bool
decomp
)
{
STSBlock
*
pBlock
=
&
pTSBuf
->
block
;
// clear the memory buffer
void
*
tmp
=
pBlock
->
payload
;
memset
(
pBlock
,
0
,
sizeof
(
STSBlock
))
;
pBlock
->
payload
=
tmp
;
pBlock
->
compLen
=
0
;
pBlock
->
padding
=
0
;
pBlock
->
numOfElem
=
0
;
if
(
order
==
TSDB_ORDER_DESC
)
{
/*
* set the right position for the reversed traverse, the reversed traverse is started from
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录