Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
ece9cb80
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看板
未验证
提交
ece9cb80
编写于
10月 24, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
10月 24, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #17588 from taosdata/feature/TD-19745
fix(stream): stream state invalid cur
上级
b4162641
5cee271c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
7 deletion
+55
-7
source/libs/stream/src/streamState.c
source/libs/stream/src/streamState.c
+7
-2
tests/script/tsim/stream/state0.sim
tests/script/tsim/stream/state0.sim
+48
-5
未找到文件。
source/libs/stream/src/streamState.c
浏览文件 @
ece9cb80
...
...
@@ -650,10 +650,10 @@ int32_t streamStateSessionGetKey(SStreamState* pState, const SSessionKey* key, S
if
(
code
==
0
&&
sessionKeyCmpr
(
key
,
&
tmpKey
)
==
0
)
{
res
=
0
;
resKey
=
tmpKey
;
streamStateCurPrev
(
pState
,
pCur
);
}
else
{
break
;
}
streamStateCurPrev
(
pState
,
pCur
);
}
*
curKey
=
resKey
;
streamStateFreeCur
(
pCur
);
...
...
@@ -700,9 +700,14 @@ int32_t streamStateStateAddIfNotExist(SStreamState* pState, SSessionKey* key, ch
memcpy
(
tmp
,
*
pVal
,
valSize
);
goto
_end
;
}
streamStateCurNext
(
pState
,
pCur
);
}
else
{
*
key
=
tmpKey
;
streamStateFreeCur
(
pCur
);
pCur
=
streamStateSessionSeekKeyNext
(
pState
,
key
);
}
streamStateCurNext
(
pState
,
pCur
);
code
=
streamStateSessionGetKVByCur
(
pCur
,
key
,
(
const
void
**
)
pVal
,
pVLen
);
if
(
code
==
0
)
{
void
*
stateKey
=
(
char
*
)(
*
pVal
)
+
(
valSize
-
keyDataLen
);
...
...
tests/script/tsim/stream/state0.sim
浏览文件 @
ece9cb80
...
...
@@ -449,12 +449,12 @@ if $data26 != 14 then
return -1
endi
sql create database test1 vgroups 1
sql select * from information_schema.ins_databases
sql create database test1 vgroups 1
;
sql select * from information_schema.ins_databases
;
print $data00 $data01 $data02
sql use test1
sql use test1
;
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
sql create stream streams2 trigger at_once into streamt1 as select _wstart, count(*) c1, count(d) c2 , sum(a) c3 , max(a) c4, min(c) c5, max(id) c from t1 state_window(a);
...
...
@@ -498,7 +498,50 @@ if $data15 != 3 then
goto loop5
endi
sql drop database test;
sql drop database test1;
sql create database test3 vgroups 1;
sql use test3;
sql create table t1(ts timestamp, a int, b int , c int, d double, id int);
sql create stream streams3 trigger at_once into streamt3 as select _wstart, count(*) c1, sum(b) c3 from t1 state_window(a);
sql insert into t1 values(1648791212000,1,2,3,1.0,1);
sql insert into t1 values(1648791213000,2,2,3,1.0,1);
sql insert into t1 values(1648791214000,3,2,4,1.0,2);
sql insert into t1 values(1648791215000,4,2,3,1.0,1);
sql insert into t1 values(1648791211000,5,2,3,1.0,1);
sql insert into t1 values(1648791210000,6,2,4,1.0,2);
sql insert into t1 values(1648791217000,7,2,3,1.0,1);
sql insert into t1 values(1648791219000,8,2,3,1.0,1);
sql insert into t1 values(1648791209000,9,2,4,1.0,2);
sql insert into t1 values(1648791220000,10,2,4,1.0,2);
sql insert into t1 values(1648791212000,1,2,3,1.0,1);
sql insert into t1 values(1648791213000,2,2,3,1.0,1);
sql insert into t1 values(1648791214000,3,2,4,1.0,2);
sql insert into t1 values(1648791215000,4,2,3,1.0,1);
sql insert into t1 values(1648791211000,5,2,3,1.0,1);
sql insert into t1 values(1648791210000,6,2,4,1.0,2);
sql insert into t1 values(1648791217000,7,2,3,1.0,1);
sql insert into t1 values(1648791219000,8,2,3,1.0,1);
sql insert into t1 values(1648791209000,9,2,4,1.0,2);
sql insert into t1 values(1648791220000,10,2,4,1.0,2);
$loop_count = 0
loop6:
sleep 300
sql select * from streamt3;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
if $rows != 10 then
print =====rows=$rows
goto loop6
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录