Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
319cd8af
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
319cd8af
编写于
10月 24, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): refactor and fix some coverity issues.
上级
b06870f7
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
56 deletion
+18
-56
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+14
-3
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-53
未找到文件。
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
319cd8af
...
...
@@ -1910,6 +1910,10 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
if
(
minKey
==
k
.
ts
)
{
if
(
init
)
{
if
(
merge
.
pTSchema
==
NULL
)
{
return
code
;
}
tRowMerge
(
&
merge
,
pRow
);
}
else
{
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
pRow
),
pReader
,
pBlockScanInfo
->
uid
);
...
...
@@ -1964,7 +1968,7 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
tRowMerge
(
&
merge
,
&
fRow1
);
}
else
{
init
=
true
;
int32_t
code
=
tRowMergerInit
(
&
merge
,
&
fRow1
,
pReader
->
pSchema
);
code
=
tRowMergerInit
(
&
merge
,
&
fRow1
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
...
...
@@ -1975,17 +1979,24 @@ static int32_t doMergeMultiLevelRows(STsdbReader* pReader, STableBlockScanInfo*
if
(
minKey
==
key
)
{
TSDBROW
fRow
=
tsdbRowFromBlockData
(
pBlockData
,
pDumpInfo
->
rowIndex
);
if
(
!
init
)
{
int32_t
code
=
tRowMergerInit
(
&
merge
,
&
fRow
,
pReader
->
pSchema
);
code
=
tRowMergerInit
(
&
merge
,
&
fRow
,
pReader
->
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
}
}
else
{
if
(
merge
.
pTSchema
==
NULL
)
{
return
code
;
}
tRowMerge
(
&
merge
,
&
fRow
);
}
doMergeRowsInFileBlocks
(
pBlockData
,
pBlockScanInfo
,
pReader
,
&
merge
);
}
}
if
(
merge
.
pTSchema
==
NULL
)
{
return
code
;
}
code
=
tRowMergerGetRow
(
&
merge
,
&
pTSRow
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
return
code
;
...
...
@@ -3232,7 +3243,7 @@ int32_t doMergeMemIMemRows(TSDBROW* pRow, TSDBROW* piRow, STableBlockScanInfo* p
STSchema
*
pSchema
=
doGetSchemaForTSRow
(
TSDBROW_SVERSION
(
pRow
),
pReader
,
pBlockScanInfo
->
uid
);
int32_t
code
=
tRowMergerInit
(
&
merge
,
pRow
,
pSchema
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
if
(
code
!=
TSDB_CODE_SUCCESS
||
merge
.
pTSchema
==
NULL
)
{
return
code
;
}
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
319cd8af
...
...
@@ -2560,57 +2560,6 @@ int32_t aggEncodeResultRow(SOperatorInfo* pOperator, char** result, int32_t* len
return
TDB_CODE_SUCCESS
;
}
int32_t
aggDecodeResultRow
(
SOperatorInfo
*
pOperator
,
char
*
result
)
{
if
(
result
==
NULL
)
{
return
TSDB_CODE_TSC_INVALID_INPUT
;
}
SOptrBasicInfo
*
pInfo
=
(
SOptrBasicInfo
*
)(
pOperator
->
info
);
SAggSupporter
*
pSup
=
(
SAggSupporter
*
)
POINTER_SHIFT
(
pOperator
->
info
,
sizeof
(
SOptrBasicInfo
));
// int32_t size = taosHashGetSize(pSup->pResultRowHashTable);
int32_t
length
=
*
(
int32_t
*
)(
result
);
int32_t
offset
=
sizeof
(
int32_t
);
int32_t
count
=
*
(
int32_t
*
)(
result
+
offset
);
offset
+=
sizeof
(
int32_t
);
while
(
count
--
>
0
&&
length
>
offset
)
{
int32_t
keyLen
=
*
(
int32_t
*
)(
result
+
offset
);
offset
+=
sizeof
(
int32_t
);
uint64_t
tableGroupId
=
*
(
uint64_t
*
)(
result
+
offset
);
SResultRow
*
resultRow
=
getNewResultRow
(
pSup
->
pResultBuf
,
&
pSup
->
currentPageId
,
pSup
->
resultRowSize
);
if
(
!
resultRow
)
{
return
TSDB_CODE_TSC_INVALID_INPUT
;
}
// add a new result set for a new group
SResultRowPosition
pos
=
{.
pageId
=
resultRow
->
pageId
,
.
offset
=
resultRow
->
offset
};
tSimpleHashPut
(
pSup
->
pResultRowHashTable
,
result
+
offset
,
keyLen
,
&
pos
,
sizeof
(
SResultRowPosition
));
offset
+=
keyLen
;
int32_t
valueLen
=
*
(
int32_t
*
)(
result
+
offset
);
if
(
valueLen
!=
pSup
->
resultRowSize
)
{
return
TSDB_CODE_TSC_INVALID_INPUT
;
}
offset
+=
sizeof
(
int32_t
);
int32_t
pageId
=
resultRow
->
pageId
;
int32_t
pOffset
=
resultRow
->
offset
;
memcpy
(
resultRow
,
result
+
offset
,
valueLen
);
resultRow
->
pageId
=
pageId
;
resultRow
->
offset
=
pOffset
;
offset
+=
valueLen
;
pInfo
->
resultRowInfo
.
cur
=
(
SResultRowPosition
){.
pageId
=
resultRow
->
pageId
,
.
offset
=
resultRow
->
offset
};
// releaseBufPage(pSup->pResultBuf, getBufPage(pSup->pResultBuf, pageId));
}
if
(
offset
!=
length
)
{
return
TSDB_CODE_TSC_INVALID_INPUT
;
}
return
TDB_CODE_SUCCESS
;
}
int32_t
handleLimitOffset
(
SOperatorInfo
*
pOperator
,
SLimitInfo
*
pLimitInfo
,
SSDataBlock
*
pBlock
,
bool
holdDataInBuf
)
{
if
(
pLimitInfo
->
remainGroupOffset
>
0
)
{
if
(
pLimitInfo
->
currentGroupId
==
0
)
{
// it is the first group
...
...
@@ -3098,9 +3047,11 @@ _error:
destroyAggOperatorInfo
(
pInfo
);
}
if
(
pOperator
!=
NULL
)
{
cleanupExprSupp
(
&
pOperator
->
exprSupp
);
taosMemoryFreeClear
(
pOperator
);
}
taosMemoryFreeClear
(
pOperator
);
pTaskInfo
->
code
=
TSDB_CODE_OUT_OF_MEMORY
;
return
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录