Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
48b9cac7
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
48b9cac7
编写于
6月 13, 2023
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: fix no data in db issue
上级
7adea357
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
9 deletion
+15
-9
source/libs/parser/src/parTranslater.c
source/libs/parser/src/parTranslater.c
+12
-6
source/libs/parser/test/parInitialCTest.cpp
source/libs/parser/test/parInitialCTest.cpp
+3
-3
未找到文件。
source/libs/parser/src/parTranslater.c
浏览文件 @
48b9cac7
...
...
@@ -6932,20 +6932,26 @@ int32_t translatePostCreateStream(SParseContext* pParseCxt, SQuery* pQuery, void
SCreateStreamStmt
*
pStmt
=
(
SCreateStreamStmt
*
)
pQuery
->
pRoot
;
STranslateContext
cxt
=
{
0
};
SInterval
interval
=
{
0
};
if
(
NULL
==
pResRow
||
NULL
==
pResRow
[
0
])
{
return
TSDB_CODE_PAR_INTERNAL_ERROR
;
}
int64_t
lastTs
=
0
;
int32_t
code
=
initTranslateContext
(
pParseCxt
,
NULL
,
&
cxt
);
if
(
TSDB_CODE_SUCCESS
==
code
)
{
code
=
buildIntervalForCreateStream
(
pStmt
,
&
interval
);
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
pResRow
&&
pResRow
[
0
])
{
lastTs
=
*
(
int64_t
*
)
pResRow
[
0
];
}
else
if
(
interval
.
interval
>
0
)
{
lastTs
=
convertTimePrecision
(
taosGetTimestampMs
(),
TSDB_TIME_PRECISION_MILLI
,
interval
.
precision
);
}
else
{
lastTs
=
taosGetTimestampMs
();
}
}
if
(
TSDB_CODE_SUCCESS
==
code
)
{
if
(
interval
.
interval
>
0
)
{
pStmt
->
pReq
->
lastTs
=
taosTimeTruncate
(
*
(
int64_t
*
)
pResRow
[
0
]
,
&
interval
);
pStmt
->
pReq
->
lastTs
=
taosTimeTruncate
(
lastTs
,
&
interval
);
}
else
{
pStmt
->
pReq
->
lastTs
=
*
(
int64_t
*
)
pResRow
[
0
]
;
pStmt
->
pReq
->
lastTs
=
lastTs
;
}
code
=
buildCmdMsg
(
&
cxt
,
TDMT_MND_CREATE_STREAM
,
(
FSerializeFunc
)
tSerializeSCMCreateStreamReq
,
pStmt
->
pReq
);
}
...
...
source/libs/parser/test/parInitialCTest.cpp
浏览文件 @
48b9cac7
...
...
@@ -885,12 +885,12 @@ TEST_F(ParserInitialCTest, createStream) {
setCreateStreamReq
(
"s1"
,
"test"
,
"create stream if not exists s1 trigger max_delay 20s watermark 10s ignore expired 0 fill_history
1
ignore "
"create stream if not exists s1 trigger max_delay 20s watermark 10s ignore expired 0 fill_history
0
ignore "
"update 1 into st3 as select count(*) from t1 interval(10s)"
,
"st3"
,
1
);
setStreamOptions
(
STREAM_CREATE_STABLE_TRUE
,
STREAM_TRIGGER_MAX_DELAY
,
20
*
MILLISECOND_PER_SECOND
,
10
*
MILLISECOND_PER_SECOND
,
0
,
1
,
1
);
run
(
"CREATE STREAM IF NOT EXISTS s1 TRIGGER MAX_DELAY 20s WATERMARK 10s IGNORE EXPIRED 0 FILL_HISTORY
1
IGNORE "
10
*
MILLISECOND_PER_SECOND
,
0
,
0
,
1
);
run
(
"CREATE STREAM IF NOT EXISTS s1 TRIGGER MAX_DELAY 20s WATERMARK 10s IGNORE EXPIRED 0 FILL_HISTORY
0
IGNORE "
"UPDATE 1 INTO st3 AS SELECT COUNT(*) FROM t1 INTERVAL(10S)"
);
clearCreateStreamReq
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录