Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
98aa28ef
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
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看板
提交
98aa28ef
编写于
7月 23, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
avoid mem leak
上级
65f33f19
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
33 addition
and
22 deletion
+33
-22
source/dnode/vnode/inc/vnode.h
source/dnode/vnode/inc/vnode.h
+7
-7
source/dnode/vnode/src/meta/metaQuery.c
source/dnode/vnode/src/meta/metaQuery.c
+14
-9
source/libs/index/src/indexFilter.c
source/libs/index/src/indexFilter.c
+12
-6
未找到文件。
source/dnode/vnode/inc/vnode.h
浏览文件 @
98aa28ef
...
...
@@ -27,8 +27,8 @@
#include "wal.h"
#include "tcommon.h"
#include "tgrant.h"
#include "tfs.h"
#include "tgrant.h"
#include "tmsg.h"
#include "trow.h"
...
...
@@ -100,7 +100,7 @@ typedef struct SMetaFltParam {
}
SMetaFltParam
;
int32_t
metaFilteTableIds
(
SMeta
*
pMeta
,
SMetaFltParam
*
param
,
SArray
*
results
);
int32_t
metaFilte
r
TableIds
(
SMeta
*
pMeta
,
SMetaFltParam
*
param
,
SArray
*
results
);
#if 1 // refact APIs below (TODO)
typedef
SVCreateTbReq
STbCfg
;
...
...
@@ -117,11 +117,11 @@ int32_t metaTbCursorNext(SMTbCursor *pTbCur);
// typedef struct STsdb STsdb;
typedef
struct
STsdbReader
STsdbReader
;
#define BLOCK_LOAD_OFFSET_ORDER 1
#define BLOCK_LOAD_OFFSET_ORDER
1
#define BLOCK_LOAD_TABLESEQ_ORDER 2
#define BLOCK_LOAD_EXTERN_ORDER 3
#define BLOCK_LOAD_EXTERN_ORDER
3
#define LASTROW_RETRIEVE_TYPE_ALL 0x1
#define LASTROW_RETRIEVE_TYPE_ALL
0x1
#define LASTROW_RETRIEVE_TYPE_SINGLE 0x2
int32_t
tsdbSetTableId
(
STsdbReader
*
pReader
,
int64_t
uid
);
...
...
@@ -237,8 +237,8 @@ typedef struct {
uint64_t
groupId
;
}
STableKeyInfo
;
#define TABLE_ROLLUP_ON ((int8_t)0x1)
#define TABLE_IS_ROLLUP(FLG) (((FLG) & (TABLE_ROLLUP_ON)) != 0)
#define TABLE_ROLLUP_ON
((int8_t)0x1)
#define TABLE_IS_ROLLUP(FLG)
(((FLG) & (TABLE_ROLLUP_ON)) != 0)
#define TABLE_SET_ROLLUP(FLG) ((FLG) |= TABLE_ROLLUP_ON)
struct
SMetaEntry
{
int64_t
version
;
...
...
source/dnode/vnode/src/meta/metaQuery.c
浏览文件 @
98aa28ef
...
...
@@ -754,12 +754,14 @@ typedef struct {
int32_t
vLen
;
}
SIdxCursor
;
int32_t
metaFilteTableIds
(
SMeta
*
pMeta
,
SMetaFltParam
*
param
,
SArray
*
pUids
)
{
SIdxCursor
*
pCursor
=
NULL
;
char
*
buf
=
NULL
;
int32_t
maxSize
=
0
;
int32_t
metaFilterTableIds
(
SMeta
*
pMeta
,
SMetaFltParam
*
param
,
SArray
*
pUids
)
{
int32_t
ret
=
0
;
char
*
buf
=
NULL
;
int32_t
ret
=
0
,
valid
=
0
;
STagIdxKey
*
pKey
=
NULL
;
int32_t
nKey
=
0
;
SIdxCursor
*
pCursor
=
NULL
;
pCursor
=
(
SIdxCursor
*
)
taosMemoryCalloc
(
1
,
sizeof
(
SIdxCursor
));
pCursor
->
pMeta
=
pMeta
;
pCursor
->
suid
=
param
->
suid
;
...
...
@@ -771,9 +773,8 @@ int32_t metaFilteTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
if
(
ret
<
0
)
{
goto
END
;
}
STagIdxKey
*
pKey
=
NULL
;
int32_t
nKey
=
0
;
int32_t
maxSize
=
0
;
int32_t
nTagData
=
0
;
void
*
tagData
=
NULL
;
...
...
@@ -811,10 +812,12 @@ int32_t metaFilteTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
goto
END
;
}
void
*
entryKey
=
NULL
,
*
entryVal
=
NULL
;
int32_t
nEntryKey
,
nEntryVal
;
bool
first
=
true
;
int32_t
valid
=
0
;
while
(
1
)
{
void
*
entryKey
=
NULL
,
*
entryVal
=
NULL
;
int32_t
nEntryKey
,
nEntryVal
;
valid
=
tdbTbcGet
(
pCursor
->
pCur
,
(
const
void
**
)
&
entryKey
,
&
nEntryKey
,
(
const
void
**
)
&
entryVal
,
&
nEntryVal
);
if
(
valid
<
0
)
{
break
;
...
...
@@ -853,10 +856,12 @@ int32_t metaFilteTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
break
;
}
}
END:
if
(
pCursor
->
pMeta
)
metaULock
(
pCursor
->
pMeta
);
if
(
pCursor
->
pCur
)
tdbTbcClose
(
pCursor
->
pCur
);
taosMemoryFree
(
buf
);
taosMemoryFree
(
pKey
);
taosMemoryFree
(
pCursor
);
...
...
source/libs/index/src/indexFilter.c
浏览文件 @
98aa28ef
...
...
@@ -86,7 +86,9 @@ static void sifFreeParam(SIFParam *param) {
taosArrayDestroy
(
param
->
result
);
taosMemoryFree
(
param
->
condValue
);
param
->
condValue
=
NULL
;
taosHashCleanup
(
param
->
pFilter
);
param
->
pFilter
=
NULL
;
}
static
int32_t
sifGetOperParamNum
(
EOperatorType
ty
)
{
...
...
@@ -281,6 +283,7 @@ static int32_t sifInitOperParams(SIFParam **params, SOperatorNode *node, SIFCtx
return
TSDB_CODE_SUCCESS
;
}
_return:
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
sifFreeParam
(
&
paramList
[
i
]);
taosMemoryFree
(
paramList
);
SIF_RET
(
code
);
}
...
...
@@ -381,7 +384,7 @@ static int32_t sifDoIndex(SIFParam *left, SIFParam *right, int8_t operType, SIFP
.
reverse
=
reverse
,
.
filterFunc
=
filterFunc
};
ret
=
metaFilteTableIds
(
arg
->
metaEx
,
&
param
,
output
->
result
);
ret
=
metaFilte
r
TableIds
(
arg
->
metaEx
,
&
param
,
output
->
result
);
}
return
ret
;
}
...
...
@@ -536,6 +539,7 @@ static int32_t sifExecOper(SOperatorNode *node, SIFCtx *ctx, SIFParam *output) {
SIF_ERR_RET
(
sifInitOperParams
(
&
params
,
node
,
ctx
));
if
(
params
[
0
].
status
==
SFLT_NOT_INDEX
&&
(
nParam
>
1
&&
params
[
1
].
status
==
SFLT_NOT_INDEX
))
{
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
sifFreeParam
(
&
params
[
i
]);
output
->
status
=
SFLT_NOT_INDEX
;
return
code
;
}
...
...
@@ -545,17 +549,18 @@ static int32_t sifExecOper(SOperatorNode *node, SIFCtx *ctx, SIFParam *output) {
sif_func_t
operFn
=
sifNullFunc
;
if
(
!
ctx
->
noExec
)
{
SIF_ERR_RET
(
sifGetOperFn
(
node
->
opType
,
&
operFn
,
&
output
->
status
));
SIF_ERR_RET
(
operFn
(
&
params
[
0
],
nParam
>
1
?
&
params
[
1
]
:
NULL
,
output
));
SIF_ERR_
J
RET
(
sifGetOperFn
(
node
->
opType
,
&
operFn
,
&
output
->
status
));
SIF_ERR_
J
RET
(
operFn
(
&
params
[
0
],
nParam
>
1
?
&
params
[
1
]
:
NULL
,
output
));
}
else
{
// ugly code, refactor later
if
(
nParam
>
1
&&
params
[
1
].
status
==
SFLT_NOT_INDEX
)
{
output
->
status
=
SFLT_NOT_INDEX
;
return
code
;
}
SIF_ERR_RET
(
sifGetOperFn
(
node
->
opType
,
&
operFn
,
&
output
->
status
));
SIF_ERR_
J
RET
(
sifGetOperFn
(
node
->
opType
,
&
operFn
,
&
output
->
status
));
}
_return:
for
(
int
i
=
0
;
i
<
nParam
;
i
++
)
sifFreeParam
(
&
params
[
i
]);
taosMemoryFree
(
params
);
return
code
;
}
...
...
@@ -708,7 +713,7 @@ static int32_t sifCalculate(SNode *pNode, SIFParam *pDst) {
taosHashRemove
(
ctx
.
pRes
,
(
void
*
)
&
pNode
,
POINTER_BYTES
);
}
sifFreeRes
(
ctx
.
pRes
);
SIF_RET
(
code
);
}
...
...
@@ -738,6 +743,7 @@ static int32_t sifGetFltHint(SNode *pNode, SIdxFltStatus *status) {
sifFreeParam
(
res
);
taosHashRemove
(
ctx
.
pRes
,
(
void
*
)
&
pNode
,
POINTER_BYTES
);
taosHashCleanup
(
ctx
.
pRes
);
SIF_RET
(
code
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录