Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lzh_me
TDengine
提交
81e3ec8d
TDengine
项目概览
lzh_me
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
81e3ec8d
编写于
6月 09, 2021
作者:
H
haojun Liao
提交者:
GitHub
6月 09, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #6425 from taosdata/origin/hotfix/TD-4597
Origin/hotfix/td 4597
上级
56a7b637
934265ff
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
3 deletion
+18
-3
src/os/src/detail/osString.c
src/os/src/detail/osString.c
+3
-0
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+2
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+13
-2
未找到文件。
src/os/src/detail/osString.c
浏览文件 @
81e3ec8d
...
...
@@ -59,6 +59,9 @@ bool taosMbsToUcs4(char *mbs, size_t mbsLength, char *ucs4, int32_t ucs4_max_len
iconv_close
(
cd
);
if
(
len
!=
NULL
)
{
*
len
=
(
int32_t
)(
ucs4_max_len
-
outLeft
);
if
(
*
len
<
0
)
{
return
false
;
}
}
return
true
;
...
...
src/query/inc/qExecutor.h
浏览文件 @
81e3ec8d
...
...
@@ -464,6 +464,7 @@ typedef struct SSWindowOperatorInfo {
TSKEY
prevTs
;
// previous timestamp
int32_t
numOfRows
;
// number of rows
int32_t
start
;
// start row index
bool
reptScan
;
// next round scan
}
SSWindowOperatorInfo
;
typedef
struct
SStateWindowOperatorInfo
{
...
...
@@ -473,7 +474,7 @@ typedef struct SStateWindowOperatorInfo {
int32_t
colIndex
;
// start row index
int32_t
start
;
char
*
prevData
;
// previous data
bool
reptScan
;
}
SStateWindowOperatorInfo
;
typedef
struct
SDistinctOperatorInfo
{
...
...
src/query/src/qExecutor.c
浏览文件 @
81e3ec8d
...
...
@@ -30,6 +30,7 @@
#define IS_MASTER_SCAN(runtime) ((runtime)->scanFlag == MASTER_SCAN)
#define IS_REVERSE_SCAN(runtime) ((runtime)->scanFlag == REVERSE_SCAN)
#define IS_REPEAT_SCAN(runtime) ((runtime)->scanFlag == REPEAT_SCAN)
#define SET_MASTER_SCAN_FLAG(runtime) ((runtime)->scanFlag = MASTER_SCAN)
#define SET_REVERSE_SCAN_FLAG(runtime) ((runtime)->scanFlag = REVERSE_SCAN)
...
...
@@ -1337,6 +1338,10 @@ static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSWindowOperatorInf
int64_t
gap
=
pOperator
->
pRuntimeEnv
->
pQueryAttr
->
sw
.
gap
;
pInfo
->
numOfRows
=
0
;
if
(
IS_REPEAT_SCAN
(
pRuntimeEnv
)
&&
!
pInfo
->
reptScan
)
{
pInfo
->
reptScan
=
true
;
pInfo
->
prevTs
=
INT64_MIN
;
}
TSKEY
*
tsList
=
(
TSKEY
*
)
pColInfoData
->
pData
;
for
(
int32_t
j
=
0
;
j
<
pSDataBlock
->
info
.
rows
;
++
j
)
{
...
...
@@ -1346,7 +1351,7 @@ static void doSessionWindowAggImpl(SOperatorInfo* pOperator, SSWindowOperatorInf
pInfo
->
prevTs
=
tsList
[
j
];
pInfo
->
numOfRows
=
1
;
pInfo
->
start
=
j
;
}
else
if
(
tsList
[
j
]
-
pInfo
->
prevTs
<=
gap
)
{
}
else
if
(
tsList
[
j
]
-
pInfo
->
prevTs
<=
gap
&&
(
tsList
[
j
]
-
pInfo
->
prevTs
)
>=
0
)
{
pInfo
->
curWindow
.
ekey
=
tsList
[
j
];
pInfo
->
prevTs
=
tsList
[
j
];
pInfo
->
numOfRows
+=
1
;
...
...
@@ -5178,6 +5183,10 @@ static void doStateWindowAggImpl(SOperatorInfo* pOperator, SStateWindowOperatorI
SColumnInfoData
*
pTsColInfoData
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
0
);
TSKEY
*
tsList
=
(
TSKEY
*
)
pTsColInfoData
->
pData
;
if
(
IS_REPEAT_SCAN
(
pRuntimeEnv
)
&&
!
pInfo
->
reptScan
)
{
pInfo
->
reptScan
=
true
;
tfree
(
pInfo
->
prevData
);
}
pInfo
->
numOfRows
=
0
;
for
(
int32_t
j
=
0
;
j
<
pSDataBlock
->
info
.
rows
;
++
j
)
{
...
...
@@ -5764,6 +5773,7 @@ SOperatorInfo* createTimeIntervalOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOp
SOperatorInfo
*
createStatewindowOperatorInfo
(
SQueryRuntimeEnv
*
pRuntimeEnv
,
SOperatorInfo
*
upstream
,
SExprInfo
*
pExpr
,
int32_t
numOfOutput
)
{
SStateWindowOperatorInfo
*
pInfo
=
calloc
(
1
,
sizeof
(
SStateWindowOperatorInfo
));
pInfo
->
colIndex
=
-
1
;
pInfo
->
reptScan
=
false
;
pInfo
->
binfo
.
pCtx
=
createSQLFunctionCtx
(
pRuntimeEnv
,
pExpr
,
numOfOutput
,
&
pInfo
->
binfo
.
rowCellInfoOffset
);
pInfo
->
binfo
.
pRes
=
createOutputBuf
(
pExpr
,
numOfOutput
,
pRuntimeEnv
->
resultInfo
.
capacity
);
initResultRowInfo
(
&
pInfo
->
binfo
.
resultRowInfo
,
8
,
TSDB_DATA_TYPE_INT
);
...
...
@@ -5791,7 +5801,8 @@ SOperatorInfo* createSWindowOperatorInfo(SQueryRuntimeEnv* pRuntimeEnv, SOperato
pInfo
->
binfo
.
pRes
=
createOutputBuf
(
pExpr
,
numOfOutput
,
pRuntimeEnv
->
resultInfo
.
capacity
);
initResultRowInfo
(
&
pInfo
->
binfo
.
resultRowInfo
,
8
,
TSDB_DATA_TYPE_INT
);
pInfo
->
prevTs
=
INT64_MIN
;
pInfo
->
prevTs
=
INT64_MIN
;
pInfo
->
reptScan
=
false
;
SOperatorInfo
*
pOperator
=
calloc
(
1
,
sizeof
(
SOperatorInfo
));
pOperator
->
name
=
"SessionWindowAggOperator"
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录