Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
0bb1dc9d
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看板
提交
0bb1dc9d
编写于
9月 14, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): reset the output buffer when results have been produced.
上级
7f03ffcd
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
18 addition
and
9 deletion
+18
-9
source/libs/executor/inc/executil.h
source/libs/executor/inc/executil.h
+1
-0
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+11
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+3
-2
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+3
-7
未找到文件。
source/libs/executor/inc/executil.h
浏览文件 @
0bb1dc9d
...
...
@@ -88,6 +88,7 @@ struct SqlFunctionCtx;
size_t
getResultRowSize
(
struct
SqlFunctionCtx
*
pCtx
,
int32_t
numOfOutput
);
void
initResultRowInfo
(
SResultRowInfo
*
pResultRowInfo
);
void
closeResultRow
(
SResultRow
*
pResultRow
);
void
resetResultRow
(
SResultRow
*
pResultRow
,
size_t
entrySize
);
struct
SResultRowEntryInfo
*
getResultEntryInfo
(
const
SResultRow
*
pRow
,
int32_t
index
,
const
int32_t
*
offset
);
...
...
source/libs/executor/src/executil.c
浏览文件 @
0bb1dc9d
...
...
@@ -33,6 +33,17 @@ void initResultRowInfo(SResultRowInfo* pResultRowInfo) {
void
closeResultRow
(
SResultRow
*
pResultRow
)
{
pResultRow
->
closed
=
true
;
}
void
resetResultRow
(
SResultRow
*
pResultRow
,
size_t
entrySize
)
{
pResultRow
->
numOfRows
=
0
;
pResultRow
->
closed
=
false
;
pResultRow
->
endInterp
=
false
;
pResultRow
->
startInterp
=
false
;
if
(
entrySize
>
0
)
{
memset
(
pResultRow
->
pEntryInfo
,
0
,
entrySize
);
}
}
// TODO refactor: use macro
SResultRowEntryInfo
*
getResultEntryInfo
(
const
SResultRow
*
pRow
,
int32_t
index
,
const
int32_t
*
offset
)
{
assert
(
index
>=
0
&&
offset
!=
NULL
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
0bb1dc9d
...
...
@@ -1293,8 +1293,9 @@ static void doCopyResultToDataBlock(SExprInfo* pExprInfo, int32_t numOfExprs, SR
}
}
int32_t
finalizeResultRows
(
SDiskbasedBuf
*
pBuf
,
SResultRowPosition
*
resultRowPosition
,
SExprSupp
*
pSup
,
SSDataBlock
*
pBlock
,
SExecTaskInfo
*
pTaskInfo
)
{
// todo refactor. SResultRow has direct pointer in miainfo
int32_t
finalizeResultRows
(
SDiskbasedBuf
*
pBuf
,
SResultRowPosition
*
resultRowPosition
,
SExprSupp
*
pSup
,
SSDataBlock
*
pBlock
,
SExecTaskInfo
*
pTaskInfo
)
{
SFilePage
*
page
=
getBufPage
(
pBuf
,
resultRowPosition
->
pageId
);
SResultRow
*
pRow
=
(
SResultRow
*
)((
char
*
)
page
+
resultRowPosition
->
offset
);
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
0bb1dc9d
...
...
@@ -4886,14 +4886,8 @@ static int32_t setSingleOutputTupleBuf(SResultRowInfo* pResultRowInfo, STimeWind
}
}
// set time window for current result
,todo extract method
// set time window for current result
(
*
pResult
)
->
win
=
(
*
win
);
(
*
pResult
)
->
numOfRows
=
0
;
(
*
pResult
)
->
closed
=
false
;
(
*
pResult
)
->
endInterp
=
false
;
(
*
pResult
)
->
startInterp
=
false
;
memset
((
*
pResult
)
->
pEntryInfo
,
0
,
pAggSup
->
resultRowSize
-
sizeof
(
SResultRow
));
setResultRowInitCtx
((
*
pResult
),
pExprSup
->
pCtx
,
pExprSup
->
numOfExprs
,
pExprSup
->
rowEntryInfoOffset
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -4916,6 +4910,7 @@ static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultR
if
(
miaInfo
->
curTs
!=
INT64_MIN
)
{
if
(
ts
!=
miaInfo
->
curTs
)
{
finalizeResultRows
(
iaInfo
->
aggSup
.
pResultBuf
,
&
pResultRowInfo
->
cur
,
pSup
,
pResultBlock
,
pTaskInfo
);
resetResultRow
(
miaInfo
->
pResultRow
,
iaInfo
->
aggSup
.
resultRowSize
-
sizeof
(
SResultRow
));
miaInfo
->
curTs
=
ts
;
}
}
else
{
...
...
@@ -4944,6 +4939,7 @@ static void doMergeAlignedIntervalAggImpl(SOperatorInfo* pOperatorInfo, SResultR
pBlock
->
info
.
rows
,
pSup
->
numOfExprs
);
finalizeResultRows
(
iaInfo
->
aggSup
.
pResultBuf
,
&
pResultRowInfo
->
cur
,
pSup
,
pResultBlock
,
pTaskInfo
);
resetResultRow
(
miaInfo
->
pResultRow
,
iaInfo
->
aggSup
.
resultRowSize
-
sizeof
(
SResultRow
));
miaInfo
->
curTs
=
tsCols
[
currPos
];
currWin
.
skey
=
miaInfo
->
curTs
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录