Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
45023709
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看板
提交
45023709
编写于
3月 19, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[add cases]
上级
7fc4d5d3
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
71 addition
and
55 deletion
+71
-55
tests/script/tsim/insert/basic0.sim
tests/script/tsim/insert/basic0.sim
+4
-1
tests/script/tsim/query/interval-offset.sim
tests/script/tsim/query/interval-offset.sim
+66
-53
tests/script/tsim/query/interval.sim
tests/script/tsim/query/interval.sim
+1
-1
未找到文件。
tests/script/tsim/insert/basic0.sim
浏览文件 @
45023709
...
...
@@ -26,9 +26,10 @@ endi
print =============== create child table
sql create table ct1 using stb tags(1000)
sql create table ct2 using stb tags(2000)
sql create table ct3 using stb tags(3000)
sql show tables
if $rows !=
2
then
if $rows !=
3
then
return -1
endi
...
...
@@ -45,6 +46,8 @@ sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s, 12, 2.2, 3.2)(now+3s, 1
sql_error insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4)
sql_error insert into ct1 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6) ct2 values(now+5s, -15, -2.5, -3.5)(now+6s, -16, -2.6, -3.6)
sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
#===================================================================
#===================================================================
print =============== query data from child table
...
...
tests/script/tsim/query/interval-offset.sim
浏览文件 @
45023709
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 50
sleep 50
0
sql connect
print =============== create database
sql drop database d0 -x step1
step1:
sql create database d0
sql show databases
if $rows != 1 then
return -1
endi
print $data00 $data01 $data02
sql use d0
sql create table
vehicle (ts timestamp, s
int) tags (t1 int)
print =============== create super table and child table
sql create table
stb (ts timestamp, tbcol
int) tags (t1 int)
sql show stables
print $rows $data00 $data01 $data02
if $rows != 1 then
return -1
endi
sql create table c
ar using vehicle tags(1000
)
#sql create table ct1 using vehicle tags (1000
)
sql show tables
;
if $rows != 1 then
print rows: $rows
sql create table c
t1 using stb tags ( 1
)
sql create table ct2 using stb tags ( 2
)
sql show tables
print $rows $data00 $data10 $data20
if $rows != 2 then
return -1
endi
sql insert into ct1 values('2019-01-01 00:00:00', 1)
sql insert into car values('2019-05-13 12:00:00', 1)
sql insert into car values('2019-12-31 23:59:59', 1)
sql insert into car values('2020-01-01 12:00:00', 1)
sql insert into car values('2020-01-02 12:00:00', 1)
sql insert into car values('2020-01-03 12:00:00', 1)
sql insert into car values('2020-01-04 12:00:00', 1)
sql insert into car values('2020-01-05 12:00:00', 1)
sql insert into car values('2020-01-31 12:00:00', 1)
sql insert into car values('2020-02-01 12:00:00', 1)
sql insert into car values('2020-02-02 12:00:00', 1)
sql insert into car values('2020-02-29 12:00:00', 1)
sql insert into car values('2020-03-01 12:00:00', 1)
sql insert into car values('2020-03-02 12:00:00', 1)
sql insert into car values('2020-03-15 12:00:00', 1)
sql insert into car values('2020-03-31 12:00:00', 1)
sql insert into car values('2020-05-01 12:00:00', 1)
sql select count(*) from car interval(1n, 10d)
# tdSql.checkData(0, 1, 1)
# tdSql.checkData(1, 1, 1)
# tdSql.checkData(2, 1, 6)
# tdSql.checkData(3, 1, 3)
# tdSql.checkData(4, 1, 3)
# tdSql.checkData(5, 1, 2)
# tdSql.checkData(6, 1, 1)
if $rows != 17 then
return -1
endi
if $data00 != 1 then
return -1
endi
if $data10 != 1 then
print =============== insert data into child table
sql insert into ct1 values ( '2022-01-01 01:01:01.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:06.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:10.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:16.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:20.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:26.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:30.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:36.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:40.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:46.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:50.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:01:56.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:00.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:06.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:10.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:16.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:20.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:26.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:30.000', 1 )
sql insert into ct1 values ( '2022-01-01 01:02:36.000', 1 )
sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct1 interval(10s, 2s)
print ===> select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct1 interval(10s, 2s)
print ===> $rows $data00 $data01 $data02 $data03 $data04
if $rows != 10 then
return -1
endi
if $data
20 != 6 then
endi
if $data
00 != 2 then
return -1
endi
if $data
30 != 3 then
endi
if $data
04 != 2 then
return -1
endi
if $data40 != 3 then
endi
sql insert into ct2 values ( '2022-01-01 01:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-01 12:00:01.000', 2 )
sql insert into ct2 values ( '2022-01-01 23:00:01.000', 3 )
sql insert into ct2 values ( '2022-01-02 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-03 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-04 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-05 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-06 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-07 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-08 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-09 10:00:01.000', 1 )
sql insert into ct2 values ( '2022-01-10 10:00:01.000', 1 )
sql select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct2 interval(1d, 2h)
print ===> select count(tbcol), sum(tbcol), max(tbcol), min(tbcol), count(*) from ct2 interval(1d, 2w)
print ===> rows0: $data00 $data01 $data02 $data03 $data04
print ===> rows1: $data10 $data11 $data12 $data13 $data14
print ===> rows2: $data20 $data21 $data22 $data23 $data24
if $rows != 11 then
return -1
endi
if $data
50 != 2 then
endi
if $data
00 != 1 then
return -1
endi
if $data
60 != 1 then
endi
if $data
10 != 2 then
return -1
endi
...
...
tests/script/tsim/query/interval.sim
浏览文件 @
45023709
...
...
@@ -3,7 +3,7 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c wal -v 1
system sh/exec.sh -n dnode1 -s start
sleep
20
00
sleep
5
00
sql connect
$dbPrefix = m_in_db
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录