Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c419d03b
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看板
提交
c419d03b
编写于
3月 23, 2022
作者:
P
plum-lihui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[modify]
上级
1ad4440b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
183 addition
and
83 deletion
+183
-83
tests/script/tsim/insert/basic0.sim
tests/script/tsim/insert/basic0.sim
+183
-83
未找到文件。
tests/script/tsim/insert/basic0.sim
浏览文件 @
c419d03b
...
...
@@ -36,14 +36,14 @@ endi
print =============== insert data, mode1: one row one table in sql
print =============== insert data, mode1: mulit rows one table in sql
print =============== insert data, mode1: one rows mulit table in sql
print =============== insert data, mode1: mulit rows mulit table in sql
#
print =============== insert data, mode1: one rows mulit table in sql
#
print =============== insert data, mode1: mulit rows mulit table in sql
sql insert into ct1 values(now+0s, 10, 2.0, 3.0)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s,
12, 2.2, 3.2)(now+3s, 13, 2.3,
3.3)
sql insert into ct1 values(now+1s, 11, 2.1, 3.1)(now+2s,
-12, -2.2, -3.2)(now+3s, -13, -2.3, -
3.3)
sql insert into ct2 values(now+0s, 10, 2.0, 3.0)
sql insert into ct2 values(now+1s, 11, 2.1, 3.1)(now+2s,
12, 2.2, 3.2)(now+3s, 13, 2.3,
3.3)
sql insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4)
sql 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 ct2 values(now+1s, 11, 2.1, 3.1)(now+2s,
-12, -2.2, -3.2)(now+3s, -13, -2.3, -
3.3)
#
sql insert into ct1 values(now+4s, -14, -2.4, -3.4) ct2 values(now+4s, -14, -2.4, -3.4)
#
sql 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)
...
...
@@ -52,14 +52,11 @@ sql insert into ct3 values('2021-01-01 00:00:00.000', 10, 2.0, 3.0)
print =============== query data from child table
sql select * from ct1
print rows: $rows
print $data00 $data01
print $data10 $data11
print $data20 $data21
print $data30 $data31
print $data40 $data41
print $data50 $data51
print $data60 $data61
if $rows != 7 then
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
print $data20 $data21 $data22 $data23
print $data30 $data31 $data32 $data33
if $rows != 4 then
return -1
endi
if $data01 != 10 then
...
...
@@ -84,28 +81,29 @@ endi
print =============== select count(*) from child table
sql select count(*) from ct1
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
print $data00 $data01 $data02
if $data00 != 7 then
if $data00 != 4 then
return -1
endi
print =============== select count(column) from child table
sql select count(ts), count(c1), count(c2), count(c3) from ct1
print $data00 $data01 $data02 $data03
if $data00 != 7 then
print rows: $rows
print $data00 $data01 $data02 $data03
if $data00 != 4 then
return -1
endi
if $data01 !=
7
then
if $data01 !=
4
then
return -1
endi
if $data02 !=
7
then
if $data02 !=
4
then
return -1
endi
if $data03 !=
7
then
if $data03 !=
4
then
return -1
endi
...
...
@@ -115,17 +113,18 @@ endi
print =============== select min(column) from child table
sql select min(c1), min(c2), min(c3) from ct1
print $data00 $data01 $data02 $data03
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
if $data00 != -1
6
then
if $data00 != -1
3
then
return -1
endi
if $data01 != -2.
6
0000 then
if $data01 != -2.
3
0000 then
return -1
endi
if $data02 != -3.
6
00000000 then
if $data02 != -3.
3
00000000 then
return -1
endi
...
...
@@ -135,13 +134,13 @@ print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
if $data00 != 1
3
then
if $data00 != 1
1
then
return -1
endi
if $data01 != 2.
3
0000 then
if $data01 != 2.
1
0000 then
return -1
endi
if $data02 != 3.
3
00000000 then
if $data02 != 3.
1
00000000 then
return -1
endi
...
...
@@ -151,49 +150,53 @@ print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
if $data00 !=
1
then
if $data00 !=
-4
then
return -1
endi
if $data01 !=
1.09999990
5 then
if $data01 !=
-0.40000009
5 then
return -1
endi
if $data02 !=
2.1
00000000 then
if $data02 !=
-0.4
00000000 then
return -1
endi
print =============== select column, from child table
print =============== select column
without timestamp
, from child table
sql select c1, c2, c3 from ct1
print rows: $rows
print $data00 $data01 $data02
#if $rows != 4 then
# return -1
#endi
#if $data00 != 10 then
# return -1
#endi
#if $data01 != 2.00000 then
# return -1
#endi
#if $data02 != 3.000000000 then
# return -1
#endi
#if $data10 != 11 then
# return -1
#endi
#if $data11 != 2.10000 then
# return -1
#endi
#if $data12 != 3.100000000 then
# return -1
#endi
#if $data30 != 13 then
# return -1
#endi
#if $data31 != 2.30000 then
# return -1
#endi
#if $data32 != 3.300000000 then
# return -1
#endi
print $data10 $data11 $data12
print $data20 $data21 $data22
print $data30 $data31 $data32
if $rows != 4 then
return -1
endi
if $data00 != 10 then
return -1
endi
if $data01 != 2.00000 then
return -1
endi
if $data02 != 3.000000000 then
return -1
endi
if $data10 != 11 then
return -1
endi
if $data11 != 2.10000 then
return -1
endi
if $data12 != 3.100000000 then
return -1
endi
if $data30 != -13 then
return -1
endi
if $data31 != -2.30000 then
return -1
endi
if $data32 != -3.300000000 then
return -1
endi
#===================================================================
#===================================================================
...
...
@@ -237,9 +240,31 @@ print =============== stop and restart taosd, then again do query above
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s start
sleep 2000
$loop_cnt = 0
check_dnode_ready:
$loop_cnt = $loop_cnt + 1
sleep 200
if $loop_cnt == 10 then
print ====> dnode not ready!
return -1
endi
sql show dnodes
print ===> $rows $data00 $data01 $data02 $data03 $data04 $data05
if $data00 != 1 then
return -1
endi
if $data04 != ready then
goto check_dnode_ready
endi
print =============== query data from child table
sql select * from ct1
if $rows != 7 then
print rows: $rows
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
print $data20 $data21 $data22 $data23
print $data30 $data31 $data32 $data33
if $rows != 4 then
return -1
endi
if $data01 != 10 then
...
...
@@ -264,28 +289,29 @@ endi
print =============== select count(*) from child table
sql select count(*) from ct1
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
print $data00 $data01 $data02
if $data00 != 7 then
if $data00 != 4 then
return -1
endi
print =============== select count(column) from child table
sql select count(ts), count(c1), count(c2), count(c3) from ct1
print $data00 $data01 $data02 $data03
if $data00 != 7 then
print rows: $rows
print $data00 $data01 $data02 $data03
if $data00 != 4 then
return -1
endi
if $data01 !=
7
then
if $data01 !=
4
then
return -1
endi
if $data02 !=
7
then
if $data02 !=
4
then
return -1
endi
if $data03 !=
7
then
if $data03 !=
4
then
return -1
endi
...
...
@@ -295,17 +321,18 @@ endi
print =============== select min(column) from child table
sql select min(c1), min(c2), min(c3) from ct1
print $data00 $data01 $data02 $data03
print rows: $rows
print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
if $data00 != -1
6
then
if $data00 != -1
3
then
return -1
endi
if $data01 != -2.
6
0000 then
if $data01 != -2.
3
0000 then
return -1
endi
if $data02 != -3.
6
00000000 then
if $data02 != -3.
3
00000000 then
return -1
endi
...
...
@@ -315,13 +342,13 @@ print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
if $data00 != 1
3
then
if $data00 != 1
1
then
return -1
endi
if $data01 != 2.
3
0000 then
if $data01 != 2.
1
0000 then
return -1
endi
if $data02 != 3.
3
00000000 then
if $data02 != 3.
1
00000000 then
return -1
endi
...
...
@@ -331,14 +358,87 @@ print $data00 $data01 $data02 $data03
if $rows != 1 then
return -1
endi
if $data00 != 1 then
if $data00 != -4 then
return -1
endi
if $data01 != -0.400000095 then
return -1
endi
if $data02 != -0.400000000 then
return -1
endi
print =============== select column without timestamp, from child table
sql select c1, c2, c3 from ct1
print rows: $rows
print $data00 $data01 $data02
print $data10 $data11 $data12
print $data20 $data21 $data22
print $data30 $data31 $data32
if $rows != 4 then
return -1
endi
if $data00 != 10 then
return -1
endi
if $data01 != 2.00000 then
return -1
endi
if $data02 != 3.000000000 then
return -1
endi
if $data10 != 11 then
return -1
endi
if $data11 != 2.10000 then
return -1
endi
if $data12 != 3.100000000 then
return -1
endi
if $data
01 != 1.099999905
then
if $data
30 != -13
then
return -1
endi
if $data
02 != 2.10000
0000 then
if $data
31 != -2.3
0000 then
return -1
endi
if $data32 != -3.300000000 then
return -1
endi
#===================================================================
#===================================================================
#print =============== query data from stb
#sql select * from stb
#if $rows != 4 then
# return -1
#endi
#print =============== select count(*) from supter table
#sql select count(*) from stb
#if $rows != 1 then
# return -1
#endi
#
#print $data00 $data01 $data02
#if $data00 != 8 then
# return -1
#endi
#
#print =============== select count(column) from supter table
#sql select count(ts), count(c1), count(c2), count(c3) from stb
#print $data00 $data01 $data02 $data03
#if $data00 != 8 then
# return -1
#endi
#if $data01 != 8 then
# return -1
#endi
#if $data02 != 8 then
# return -1
#endi
#if $data03 != 8 then
# return -1
#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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录