Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
234b8976
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
234b8976
编写于
8月 18, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix test case
上级
31872611
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
272 addition
and
272 deletion
+272
-272
tests/script/tsim/bnode/basic1.sim
tests/script/tsim/bnode/basic1.sim
+23
-23
tests/script/tsim/compress/commitlog.sim
tests/script/tsim/compress/commitlog.sim
+10
-10
tests/script/tsim/compress/compress.sim
tests/script/tsim/compress/compress.sim
+10
-10
tests/script/tsim/compress/compress2.sim
tests/script/tsim/compress/compress2.sim
+10
-10
tests/script/tsim/compress/uncompress.sim
tests/script/tsim/compress/uncompress.sim
+10
-10
tests/script/tsim/db/alter_option.sim
tests/script/tsim/db/alter_option.sim
+17
-17
tests/script/tsim/db/alter_replica_13.sim
tests/script/tsim/db/alter_replica_13.sim
+5
-5
tests/script/tsim/db/alter_replica_31.sim
tests/script/tsim/db/alter_replica_31.sim
+5
-5
tests/script/tsim/db/back_insert.sim
tests/script/tsim/db/back_insert.sim
+5
-5
tests/script/tsim/db/basic1.sim
tests/script/tsim/db/basic1.sim
+12
-12
tests/script/tsim/db/basic2.sim
tests/script/tsim/db/basic2.sim
+4
-4
tests/script/tsim/db/basic3.sim
tests/script/tsim/db/basic3.sim
+4
-4
tests/script/tsim/db/basic4.sim
tests/script/tsim/db/basic4.sim
+27
-27
tests/script/tsim/db/basic5.sim
tests/script/tsim/db/basic5.sim
+4
-4
tests/script/tsim/db/basic6.sim
tests/script/tsim/db/basic6.sim
+35
-35
tests/script/tsim/db/commit.sim
tests/script/tsim/db/commit.sim
+4
-4
tests/script/tsim/db/delete_reuse1.sim
tests/script/tsim/db/delete_reuse1.sim
+8
-8
tests/script/tsim/db/delete_reuse2.sim
tests/script/tsim/db/delete_reuse2.sim
+12
-12
tests/script/tsim/db/delete_reusevnode.sim
tests/script/tsim/db/delete_reusevnode.sim
+5
-5
tests/script/tsim/db/delete_reusevnode2.sim
tests/script/tsim/db/delete_reusevnode2.sim
+1
-1
tests/script/tsim/db/delete_writing1.sim
tests/script/tsim/db/delete_writing1.sim
+6
-6
tests/script/tsim/db/delete_writing2.sim
tests/script/tsim/db/delete_writing2.sim
+8
-8
tests/script/tsim/db/dropdnodes.sim
tests/script/tsim/db/dropdnodes.sim
+8
-8
tests/script/tsim/db/keep.sim
tests/script/tsim/db/keep.sim
+8
-8
tests/script/tsim/db/len.sim
tests/script/tsim/db/len.sim
+12
-12
tests/script/tsim/db/repeat.sim
tests/script/tsim/db/repeat.sim
+1
-1
tests/script/tsim/db/show_create_db.sim
tests/script/tsim/db/show_create_db.sim
+4
-4
tests/script/tsim/db/show_create_table.sim
tests/script/tsim/db/show_create_table.sim
+12
-12
tests/script/tsim/db/tables.sim
tests/script/tsim/db/tables.sim
+2
-2
未找到文件。
tests/script/tsim/bnode/basic1.sim
浏览文件 @
234b8976
...
@@ -7,24 +7,24 @@ sql connect
...
@@ -7,24 +7,24 @@ sql connect
print =============== select * from information_schema.ins_dnodes
print =============== select * from information_schema.ins_dnodes
sql select * from information_schema.ins_dnodes;
sql select * from information_schema.ins_dnodes;
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 1 then
if $data00 != 1 then
return -1
return -1
endi
endi
sql select * from information_schema.ins_mnodes;
sql select * from information_schema.ins_mnodes;
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 1 then
if $data00 != 1 then
return -1
return -1
endi
endi
if $data02 != leader then
if $data02 != leader then
return -1
return -1
endi
endi
...
@@ -33,62 +33,62 @@ sql create dnode $hostname port 7200
...
@@ -33,62 +33,62 @@ sql create dnode $hostname port 7200
sleep 2000
sleep 2000
sql select * from information_schema.ins_dnodes;
sql select * from information_schema.ins_dnodes;
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != 1 then
if $data00 != 1 then
return -1
return -1
endi
endi
if $data10 != 2 then
if $data10 != 2 then
return -1
return -1
endi
endi
print $data02
print $data02
if $data02 != 0 then
if $data02 != 0 then
return -1
return -1
endi
endi
if $data12 != 0 then
if $data12 != 0 then
return -1
return -1
endi
endi
if $data04 != ready then
if $data04 != ready then
return -1
return -1
endi
endi
if $data14 != ready then
if $data14 != ready then
return -1
return -1
endi
endi
sql select * from information_schema.ins_mnodes;
sql select * from information_schema.ins_mnodes;
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 1 then
if $data00 != 1 then
return -1
return -1
endi
endi
if $data02 != leader then
if $data02 != leader then
return -1
return -1
endi
endi
#print =============== create drop bnode 1
#print =============== create drop bnode 1
#sql create bnode on dnode 1
#sql create bnode on dnode 1
#sql show bnodes
#sql show bnodes
#if $rows != 1 then
#if $rows != 1 then
# return -1
# return -1
#endi
#endi
#if $data00 != 1 then
#if $data00 != 1 then
# return -1
# return -1
#endi
#endi
#sql_error create bnode on dnode 1
#sql_error create bnode on dnode 1
#
#
#sql drop bnode on dnode 1
#sql drop bnode on dnode 1
#sql show bnodes
#sql show bnodes
#if $rows != 0 then
#if $rows != 0 then
# return -1
# return -1
#endi
#endi
#sql_error drop bnode on dnode 1
#sql_error drop bnode on dnode 1
...
@@ -96,17 +96,17 @@ endi
...
@@ -96,17 +96,17 @@ endi
#print =============== create drop bnode 2
#print =============== create drop bnode 2
#sql create bnode on dnode 2
#sql create bnode on dnode 2
#sql show bnodes
#sql show bnodes
#if $rows != 1 then
#if $rows != 1 then
# return -1
# return -1
#endi
#endi
#if $data00 != 2 then
#if $data00 != 2 then
# return -1
# return -1
#endi
#endi
#sql_error create bnode on dnode 2
#sql_error create bnode on dnode 2
#
#
#sql drop bnode on dnode 2
#sql drop bnode on dnode 2
#sql show bnodes
#sql show bnodes
#if $rows != 0 then
#if $rows != 0 then
# return -1
# return -1
#endi
#endi
#sql_error drop bnode on dnode 2
#sql_error drop bnode on dnode 2
...
@@ -115,7 +115,7 @@ endi
...
@@ -115,7 +115,7 @@ endi
#sql create bnode on dnode 1
#sql create bnode on dnode 1
#sql create bnode on dnode 2
#sql create bnode on dnode 2
#sql show bnodes
#sql show bnodes
#if $rows != 2 then
#if $rows != 2 then
# return -1
# return -1
#endi
#endi
...
@@ -127,7 +127,7 @@ endi
...
@@ -127,7 +127,7 @@ endi
#
#
#sleep 2000
#sleep 2000
#sql show bnodes
#sql show bnodes
#if $rows != 2 then
#if $rows != 2 then
# return -1
# return -1
#endi
#endi
...
...
tests/script/tsim/compress/commitlog.sim
浏览文件 @
234b8976
...
@@ -25,7 +25,7 @@ while $count < $N
...
@@ -25,7 +25,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -46,7 +46,7 @@ while $count < $N
...
@@ -46,7 +46,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -67,7 +67,7 @@ while $count < $N
...
@@ -67,7 +67,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -83,7 +83,7 @@ $tb = $tbPrefix . $i
...
@@ -83,7 +83,7 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -93,18 +93,18 @@ $tb = $tbPrefix . $i
...
@@ -93,18 +93,18 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
$i = 2
$i = 2
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/compress/compress.sim
浏览文件 @
234b8976
...
@@ -25,7 +25,7 @@ while $count < $N
...
@@ -25,7 +25,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -47,7 +47,7 @@ while $count < $N
...
@@ -47,7 +47,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -69,7 +69,7 @@ while $count < $N
...
@@ -69,7 +69,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -85,7 +85,7 @@ $tb = $tbPrefix . $i
...
@@ -85,7 +85,7 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -95,18 +95,18 @@ $tb = $tbPrefix . $i
...
@@ -95,18 +95,18 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
$i = 2
$i = 2
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/compress/compress2.sim
浏览文件 @
234b8976
...
@@ -26,7 +26,7 @@ while $count < $N
...
@@ -26,7 +26,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -48,7 +48,7 @@ while $count < $N
...
@@ -48,7 +48,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -70,7 +70,7 @@ while $count < $N
...
@@ -70,7 +70,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -86,7 +86,7 @@ $tb = $tbPrefix . $i
...
@@ -86,7 +86,7 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -96,18 +96,18 @@ $tb = $tbPrefix . $i
...
@@ -96,18 +96,18 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
$i = 2
$i = 2
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/compress/uncompress.sim
浏览文件 @
234b8976
...
@@ -26,7 +26,7 @@ while $count < $N
...
@@ -26,7 +26,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -48,7 +48,7 @@ while $count < $N
...
@@ -48,7 +48,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -70,7 +70,7 @@ while $count < $N
...
@@ -70,7 +70,7 @@ while $count < $N
endw
endw
sql select * from $tb
sql select * from $tb
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -85,7 +85,7 @@ $tb = $tbPrefix . $i
...
@@ -85,7 +85,7 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
...
@@ -95,18 +95,18 @@ $tb = $tbPrefix . $i
...
@@ -95,18 +95,18 @@ $tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
$i = 2
$i = 2
$db = $dbPrefix . $i
$db = $dbPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
sql use $db
sql use $db
sql select * from $tb
sql select * from $tb
print select * from $tb ==> $rows points
print select * from $tb ==> $rows points
if $rows != $N then
if $rows != $N then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/alter_option.sim
浏览文件 @
234b8976
...
@@ -186,13 +186,13 @@ sql_error alter database db replica 0
...
@@ -186,13 +186,13 @@ sql_error alter database db replica 0
#sql alter database db replica 1
#sql alter database db replica 1
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print replica: $data4_db
#print replica: $data4_db
#if $data4_db != 1 then
#if $data4_db != 1 then
# return -1
# return -1
#endi
#endi
#sql alter database db replica 3
#sql alter database db replica 3
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print replica: $data4_db
#print replica: $data4_db
#if $data4_db != 3 then
#if $data4_db != 3 then
# return -1
# return -1
#endi
#endi
...
@@ -200,13 +200,13 @@ sql_error alter database db replica 0
...
@@ -200,13 +200,13 @@ sql_error alter database db replica 0
#sql alter database db quorum 2
#sql alter database db quorum 2
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print quorum $data5_db
#print quorum $data5_db
#if $data5_db != 2 then
#if $data5_db != 2 then
# return -1
# return -1
#endi
#endi
#sql alter database db quorum 1
#sql alter database db quorum 1
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print quorum $data5_db
#print quorum $data5_db
#if $data5_db != 1 then
#if $data5_db != 1 then
# return -1
# return -1
#endi
#endi
...
@@ -233,7 +233,7 @@ endi
...
@@ -233,7 +233,7 @@ endi
#sql alter database db keep 1000,2000
#sql alter database db keep 1000,2000
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print keep $data7_db
#print keep $data7_db
#if $data7_db != 500,500,500 then
#if $data7_db != 500,500,500 then
# return -1
# return -1
#endi
#endi
...
@@ -263,13 +263,13 @@ sql_error alter database db keep -1
...
@@ -263,13 +263,13 @@ sql_error alter database db keep -1
#sql alter database db blocks 3
#sql alter database db blocks 3
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print blocks $data9_db
#print blocks $data9_db
#if $data9_db != 3 then
#if $data9_db != 3 then
# return -1
# return -1
#endi
#endi
#sql alter database db blocks 11
#sql alter database db blocks 11
#sql select * from information_schema.ins_databases
#sql select * from information_schema.ins_databases
#print blocks $data9_db
#print blocks $data9_db
#if $data9_db != 11 then
#if $data9_db != 11 then
# return -1
# return -1
#endi
#endi
...
@@ -300,13 +300,13 @@ print ============== step wal_level
...
@@ -300,13 +300,13 @@ print ============== step wal_level
sql alter database db wal_level 1
sql alter database db wal_level 1
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print wal_level $data20_db
print wal_level $data20_db
if $data20_db != 1 then
if $data20_db != 1 then
return -1
return -1
endi
endi
sql alter database db wal_level 2
sql alter database db wal_level 2
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print wal_level $data20_db
print wal_level $data20_db
if $data20_db != 2 then
if $data20_db != 2 then
return -1
return -1
endi
endi
...
@@ -319,19 +319,19 @@ print ============== modify wal_fsync_period
...
@@ -319,19 +319,19 @@ print ============== modify wal_fsync_period
sql alter database db wal_fsync_period 2000
sql alter database db wal_fsync_period 2000
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print wal_fsync_period $data21_db
print wal_fsync_period $data21_db
if $data21_db != 2000 then
if $data21_db != 2000 then
return -1
return -1
endi
endi
sql alter database db wal_fsync_period 500
sql alter database db wal_fsync_period 500
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print wal_fsync_period $data21_db
print wal_fsync_period $data21_db
if $data21_db != 500 then
if $data21_db != 500 then
return -1
return -1
endi
endi
sql alter database db wal_fsync_period 0
sql alter database db wal_fsync_period 0
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print wal_fsync_period $data21_db
print wal_fsync_period $data21_db
if $data21_db != 0 then
if $data21_db != 0 then
return -1
return -1
endi
endi
sql_error alter database db wal_fsync_period 180001
sql_error alter database db wal_fsync_period 180001
...
@@ -351,31 +351,31 @@ print ============== modify cachelast [0, 1, 2, 3]
...
@@ -351,31 +351,31 @@ print ============== modify cachelast [0, 1, 2, 3]
sql alter database db cachemodel 'last_value'
sql alter database db cachemodel 'last_value'
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print cachelast $data18_db
print cachelast $data18_db
if $data18_db != last_value then
if $data18_db != last_value then
return -1
return -1
endi
endi
sql alter database db cachemodel 'last_row'
sql alter database db cachemodel 'last_row'
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print cachelast $data18_db
print cachelast $data18_db
if $data18_db != last_row then
if $data18_db != last_row then
return -1
return -1
endi
endi
sql alter database db cachemodel 'none'
sql alter database db cachemodel 'none'
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print cachelast $data18_db
print cachelast $data18_db
if $data18_db != none then
if $data18_db != none then
return -1
return -1
endi
endi
sql alter database db cachemodel 'last_value'
sql alter database db cachemodel 'last_value'
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print cachelast $data18_db
print cachelast $data18_db
if $data18_db != last_value then
if $data18_db != last_value then
return -1
return -1
endi
endi
sql alter database db cachemodel 'both'
sql alter database db cachemodel 'both'
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print cachelast $data18_db
print cachelast $data18_db
if $data18_db != both then
if $data18_db != both then
return -1
return -1
endi
endi
...
...
tests/script/tsim/db/alter_replica_13.sim
浏览文件 @
234b8976
...
@@ -36,10 +36,10 @@ endi
...
@@ -36,10 +36,10 @@ endi
print =============== step2: create database
print =============== step2: create database
sql create database db vgroups 1
sql create database db vgroups 1
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data(db)[4] != 1 then
if $data(db)[4] != 1 then
return -1
return -1
endi
endi
...
@@ -82,7 +82,7 @@ step3:
...
@@ -82,7 +82,7 @@ step3:
return -1
return -1
endi
endi
sql select * from information_schema.ins_dnodes
sql select * from information_schema.ins_dnodes
print ===> rows: $rows
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data20 $data21 $data22 $data23 $data24 $data25
...
@@ -115,7 +115,7 @@ step4:
...
@@ -115,7 +115,7 @@ step4:
return -1
return -1
endi
endi
sql show db.vgroups
sql show db.vgroups
print ===> rows: $rows
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data00 $data01 $data02 $data03 $data04 $data05
if $data[0][4] != leader then
if $data[0][4] != leader then
goto step4
goto step4
...
@@ -137,4 +137,4 @@ endi
...
@@ -137,4 +137,4 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/alter_replica_31.sim
浏览文件 @
234b8976
...
@@ -23,7 +23,7 @@ step1:
...
@@ -23,7 +23,7 @@ step1:
return -1
return -1
endi
endi
sql select * from information_schema.ins_dnodes
sql select * from information_schema.ins_dnodes
print ===> rows: $rows
print ===> rows: $rows
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data00 $data01 $data02 $data03 $data04 $data05
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data10 $data11 $data12 $data13 $data14 $data15
print ===> $data20 $data21 $data22 $data23 $data24 $data25
print ===> $data20 $data21 $data22 $data23 $data24 $data25
...
@@ -47,10 +47,10 @@ endi
...
@@ -47,10 +47,10 @@ endi
print =============== step2: create database
print =============== step2: create database
sql create database db vgroups 1 replica 3
sql create database db vgroups 1 replica 3
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data(db)[4] != 3 then
if $data(db)[4] != 3 then
return -1
return -1
endi
endi
...
@@ -139,7 +139,7 @@ step3:
...
@@ -139,7 +139,7 @@ step3:
return -1
return -1
endi
endi
sql show db.vgroups
sql show db.vgroups
print ===> rows: $rows
print ===> rows: $rows
if $rows != 1 then
if $rows != 1 then
goto step3
goto step3
endi
endi
...
@@ -165,4 +165,4 @@ endi
...
@@ -165,4 +165,4 @@ endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode3 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
system sh/exec.sh -n dnode4 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/back_insert.sim
浏览文件 @
234b8976
...
@@ -2,8 +2,8 @@ sql connect
...
@@ -2,8 +2,8 @@ sql connect
$x = 1
$x = 1
begin:
begin:
sql reset query cache
sql reset query cache
sleep 100
sleep 100
sql insert into db.tb values(now, $x ) -x begin
sql insert into db.tb values(now, $x ) -x begin
#print ===> insert successed $x
#print ===> insert successed $x
$x = $x + 1
$x = $x + 1
goto begin
goto begin
\ No newline at end of file
tests/script/tsim/db/basic1.sim
浏览文件 @
234b8976
...
@@ -25,15 +25,15 @@ endi
...
@@ -25,15 +25,15 @@ endi
print =============== show vgroups1
print =============== show vgroups1
sql use d1
sql use d1
sql show vgroups
sql show vgroups
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != 2 then
if $data00 != 2 then
return -1
return -1
endi
endi
if $data10 != 3 then
if $data10 != 3 then
return -1
return -1
endi
endi
...
@@ -59,11 +59,11 @@ if $rows != 2 then
...
@@ -59,11 +59,11 @@ if $rows != 2 then
return -1
return -1
endi
endi
if $data00 != 4 then
if $data00 != 4 then
return -1
return -1
endi
endi
if $data10 != 5 then
if $data10 != 5 then
return -1
return -1
endi
endi
...
@@ -73,15 +73,15 @@ if $rows != 3 then
...
@@ -73,15 +73,15 @@ if $rows != 3 then
return -1
return -1
endi
endi
if $data00 != 6 then
if $data00 != 6 then
return -1
return -1
endi
endi
if $data10 != 7 then
if $data10 != 7 then
return -1
return -1
endi
endi
if $data20 != 8 then
if $data20 != 8 then
return -1
return -1
endi
endi
...
@@ -91,19 +91,19 @@ if $rows != 4 then
...
@@ -91,19 +91,19 @@ if $rows != 4 then
return -1
return -1
endi
endi
if $data00 != 9 then
if $data00 != 9 then
return -1
return -1
endi
endi
if $data10 != 10 then
if $data10 != 10 then
return -1
return -1
endi
endi
if $data20 != 11 then
if $data20 != 11 then
return -1
return -1
endi
endi
if $data30 != 12 then
if $data30 != 12 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/db/basic2.sim
浏览文件 @
234b8976
...
@@ -27,7 +27,7 @@ sql create table t3 (ts timestamp, i int);
...
@@ -27,7 +27,7 @@ sql create table t3 (ts timestamp, i int);
sql create table t4 (ts timestamp, i int);
sql create table t4 (ts timestamp, i int);
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print rows: $rows
print rows: $rows
print $data00 $data01 $data02 $data03
print $data00 $data01 $data02 $data03
print $data10 $data11 $data12 $data13
print $data10 $data11 $data12 $data13
if $rows != 3 then
if $rows != 3 then
...
@@ -47,7 +47,7 @@ endi
...
@@ -47,7 +47,7 @@ endi
#endi
#endi
sql show tables
sql show tables
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
...
@@ -64,8 +64,8 @@ if $rows != 4 then
...
@@ -64,8 +64,8 @@ if $rows != 4 then
endi
endi
sql show tables
sql show tables
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/basic3.sim
浏览文件 @
234b8976
...
@@ -23,12 +23,12 @@ if $data22 != 2 then
...
@@ -23,12 +23,12 @@ if $data22 != 2 then
return -1
return -1
endi
endi
#if $data03 != 4 then
#if $data03 != 4 then
# return -1
# return -1
#endi
#endi
sql show d1.tables
sql show d1.tables
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
...
@@ -44,8 +44,8 @@ if $rows != 4 then
...
@@ -44,8 +44,8 @@ if $rows != 4 then
endi
endi
sql show d2.tables
sql show d2.tables
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/basic4.sim
浏览文件 @
234b8976
...
@@ -11,109 +11,109 @@ sql create table d1.t3 (ts timestamp, i int);
...
@@ -11,109 +11,109 @@ sql create table d1.t3 (ts timestamp, i int);
sql create table d1.t4 (ts timestamp, i int);
sql create table d1.t4 (ts timestamp, i int);
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data20 != d1 then
if $data20 != d1 then
return -1
return -1
endi
endi
if $data22 != 1 then
if $data22 != 1 then
return -1
return -1
endi
endi
if $data24 != 1 then
if $data24 != 1 then
return -1
return -1
endi
endi
sql show d1.tables
sql show d1.tables
if $rows != 4 then
if $rows != 4 then
return -1
return -1
endi
endi
sql show d1.vgroups
sql show d1.vgroups
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 2 then
if $data00 != 2 then
return -1
return -1
endi
endi
if $data01 != d1 then
if $data01 != d1 then
return -1
return -1
endi
endi
print =============== drop table
print =============== drop table
sql drop table d1.t1
sql drop table d1.t1
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data20 != d1 then
if $data20 != d1 then
return -1
return -1
endi
endi
if $data22 != 1 then
if $data22 != 1 then
return -1
return -1
endi
endi
if $data24 != 1 then
if $data24 != 1 then
return -1
return -1
endi
endi
sql show d1.tables
sql show d1.tables
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
sql show d1.vgroups
sql show d1.vgroups
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 2 then
if $data00 != 2 then
return -1
return -1
endi
endi
if $data01 != d1 then
if $data01 != d1 then
return -1
return -1
endi
endi
print =============== drop all table
print =============== drop all table
sql drop table d1.t2
sql drop table d1.t2
sql drop table d1.t3
sql drop table d1.t3
sql drop table d1.t4
sql drop table d1.t4
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
if $data20 != d1 then
if $data20 != d1 then
return -1
return -1
endi
endi
if $data22 != 1 then
if $data22 != 1 then
return -1
return -1
endi
endi
if $data24 != 1 then
if $data24 != 1 then
return -1
return -1
endi
endi
sql show d1.tables
sql show d1.tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
sql show d1.vgroups
sql show d1.vgroups
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != 2 then
if $data00 != 2 then
return -1
return -1
endi
endi
if $data01 != d1 then
if $data01 != d1 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/basic5.sim
浏览文件 @
234b8976
...
@@ -13,13 +13,13 @@ sql create table tb1 using st1 tags(1);
...
@@ -13,13 +13,13 @@ sql create table tb1 using st1 tags(1);
sql insert into tb1 values (now, 1);
sql insert into tb1 values (now, 1);
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
print $rows
print $rows
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
@@ -35,12 +35,12 @@ sql use db1;
...
@@ -35,12 +35,12 @@ sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags(t1 int)
sql create stable st1 (ts timestamp, f1 int) tags(t1 int)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/db/basic6.sim
浏览文件 @
234b8976
...
@@ -14,7 +14,7 @@ $st = $stPrefix . $i
...
@@ -14,7 +14,7 @@ $st = $stPrefix . $i
$tb = $tbPrefix . $i
$tb = $tbPrefix . $i
print =============== step1
print =============== step1
# quorum presicion
# quorum presicion
sql create database $db vgroups 8 replica 1 duration 2 keep 10 minrows 80 maxrows 10000 wal_level 2 wal_fsync_period 1000 comp 0 cachemodel 'last_value' precision 'us'
sql create database $db vgroups 8 replica 1 duration 2 keep 10 minrows 80 maxrows 10000 wal_level 2 wal_fsync_period 1000 comp 0 cachemodel 'last_value' precision 'us'
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07 $data08 $data09
...
@@ -46,7 +46,7 @@ endi
...
@@ -46,7 +46,7 @@ endi
#if $data29 != 12 then
#if $data29 != 12 then
# return -1
# return -1
#endi
#endi
print =============== step2
print =============== step2
sql_error create database $db
sql_error create database $db
sql create database if not exists $db
sql create database if not exists $db
...
@@ -60,7 +60,7 @@ sql drop database $db
...
@@ -60,7 +60,7 @@ sql drop database $db
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
print =============== step4
print =============== step4
sql_error drop database $db
sql_error drop database $db
...
@@ -102,22 +102,22 @@ while $i < 5
...
@@ -102,22 +102,22 @@ while $i < 5
sql create table $tb using $st tags(1)
sql create table $tb using $st tags(1)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
print $data00 $data01 $data02 $data03
print $data00 $data01 $data02 $data03
if $data00 != $st then
if $data00 != $st then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
print $data00 $data01 $data02 $data03
print $data00 $data01 $data02 $data03
if $data00 != $tb then
if $data00 != $tb then
return -1
return -1
endi
endi
...
@@ -127,8 +127,8 @@ endw
...
@@ -127,8 +127,8 @@ endw
print =============== step7
print =============== step7
$i = 0
$i = 0
while $i < 5
while $i < 5
$db = $dbPrefix . $i
$db = $dbPrefix . $i
sql drop database $db
sql drop database $db
$i = $i + 1
$i = $i + 1
endw
endw
...
@@ -143,20 +143,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
...
@@ -143,20 +143,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using $st tags(1)
sql create table $tb using $st tags(1)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $st then
if $data00 != $st then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
if $data00 != $tb then
return -1
return -1
endi
endi
...
@@ -168,12 +168,12 @@ sql create database $db
...
@@ -168,12 +168,12 @@ sql create database $db
sql use $db
sql use $db
sql show stables
sql show stables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
...
@@ -182,20 +182,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
...
@@ -182,20 +182,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using $st tags(1)
sql create table $tb using $st tags(1)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $st then
if $data00 != $st then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
if $data00 != $tb then
return -1
return -1
endi
endi
...
@@ -207,12 +207,12 @@ sql create database $db
...
@@ -207,12 +207,12 @@ sql create database $db
sql use $db
sql use $db
sql show stables
sql show stables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
...
@@ -221,20 +221,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
...
@@ -221,20 +221,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using $st tags(1)
sql create table $tb using $st tags(1)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $st then
if $data00 != $st then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
if $data00 != $tb then
return -1
return -1
endi
endi
...
@@ -245,12 +245,12 @@ sql insert into $tb values (now+4a, 3)
...
@@ -245,12 +245,12 @@ sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql insert into $tb values (now+5a, 4)
sql select * from $tb
sql select * from $tb
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
sql select * from $st
sql select * from $st
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
...
@@ -262,12 +262,12 @@ sql create database $db
...
@@ -262,12 +262,12 @@ sql create database $db
sql use $db
sql use $db
sql show stables
sql show stables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 0 then
if $rows != 0 then
return -1
return -1
endi
endi
...
@@ -276,20 +276,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
...
@@ -276,20 +276,20 @@ sql create table $st (ts timestamp, i int) tags (j int)
sql create table $tb using $st tags(1)
sql create table $tb using $st tags(1)
sql show stables
sql show stables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $st then
if $data00 != $st then
return -1
return -1
endi
endi
sql show tables
sql show tables
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != $tb then
if $data00 != $tb then
return -1
return -1
endi
endi
...
@@ -300,12 +300,12 @@ sql insert into $tb values (now+4a, 3)
...
@@ -300,12 +300,12 @@ sql insert into $tb values (now+4a, 3)
sql insert into $tb values (now+5a, 4)
sql insert into $tb values (now+5a, 4)
sql select * from $tb
sql select * from $tb
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
sql select * from $st
sql select * from $st
if $rows != 5 then
if $rows != 5 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/db/commit.sim
浏览文件 @
234b8976
...
@@ -39,9 +39,9 @@ sql create table tb (ts timestamp, i int)
...
@@ -39,9 +39,9 @@ sql create table tb (ts timestamp, i int)
$x = 1
$x = 1
while $x < 41
while $x < 41
$time = $x . m
$time = $x . m
sql insert into tb values (now + $time , $x )
sql insert into tb values (now + $time , $x )
$x = $x + 1
$x = $x + 1
endw
endw
sql select * from tb order by ts desc
sql select * from tb order by ts desc
print ===> rows $rows
print ===> rows $rows
...
@@ -71,7 +71,7 @@ if $data01 != 40 then
...
@@ -71,7 +71,7 @@ if $data01 != 40 then
return -1
return -1
endi
endi
$oldnum = $rows
$oldnum = $rows
$num = $rows + 2
$num = $rows + 2
print ======== step3 import old data
print ======== step3 import old data
...
@@ -120,4 +120,4 @@ if $data01 != 40 then
...
@@ -120,4 +120,4 @@ if $data01 != 40 then
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/delete_reuse1.sim
浏览文件 @
234b8976
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
print ======== step1
print ======== step1
sql create database d1 replica 1 vgroups 1
sql create database d1 replica 1 vgroups 1
sql create database d2 replica 1 vgroups 1
sql create database d2 replica 1 vgroups 1
sql create database d3 replica 1 vgroups 1
sql create database d3 replica 1 vgroups 1
...
@@ -47,7 +47,7 @@ step2:
...
@@ -47,7 +47,7 @@ step2:
print ========= step3
print ========= step3
sql reset query cache
sql reset query cache
sleep 50
sleep 50
sql create database d1 replica 1
sql create database d1 replica 1
sql create table d1.t1 (ts timestamp, i int)
sql create table d1.t1 (ts timestamp, i int)
...
@@ -65,20 +65,20 @@ while $x < 20
...
@@ -65,20 +65,20 @@ while $x < 20
sql insert into d1.t1 values(now, -1) -x step4
sql insert into d1.t1 values(now, -1) -x step4
return -1
return -1
step4:
step4:
sql create database d1 replica 1
sql create database d1 replica 1
sql reset query cache
sql reset query cache
sleep 50
sleep 50
sql create table d1.t1 (ts timestamp, i int)
sql create table d1.t1 (ts timestamp, i int)
sql insert into d1.t1 values(now, $x )
sql insert into d1.t1 values(now, $x )
sql select * from d1.t1
sql select * from d1.t1
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
$x = $x + 1
$x = $x + 1
print ===> loop times: $x
print ===> loop times: $x
endw
endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/delete_reuse2.sim
浏览文件 @
234b8976
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
print ======== step1
print ======== step1
sql create database d1 replica 1
sql create database d1 replica 1
sql create database d2 replica 1
sql create database d2 replica 1
sql create database d3 replica 1
sql create database d3 replica 1
...
@@ -48,7 +48,7 @@ step2:
...
@@ -48,7 +48,7 @@ step2:
print ========= step3
print ========= step3
sql create database db1 replica 1
sql create database db1 replica 1
sql reset query cache
sql reset query cache
sleep 50
sleep 50
sql create table db1.tb1 (ts timestamp, i int)
sql create table db1.tb1 (ts timestamp, i int)
sql insert into db1.tb1 values(now, 2)
sql insert into db1.tb1 values(now, 2)
...
@@ -61,7 +61,7 @@ print ========= step4
...
@@ -61,7 +61,7 @@ print ========= step4
$x = 1
$x = 1
while $x < 20
while $x < 20
$db = db . $x
$db = db . $x
$tb = tb . $x
$tb = tb . $x
sql use $db
sql use $db
sql drop database $db
sql drop database $db
...
@@ -69,14 +69,14 @@ while $x < 20
...
@@ -69,14 +69,14 @@ while $x < 20
sql insert into $tb values(now, -1) -x step4
sql insert into $tb values(now, -1) -x step4
return -1
return -1
step4:
step4:
$x = $x + 1
$x = $x + 1
$db = db . $x
$db = db . $x
$tb = tb . $x
$tb = tb . $x
sql reset query cache
sql reset query cache
sleep 50
sleep 50
sql create database $db replica 1
sql create database $db replica 1
sql use $db
sql use $db
sql create table $tb (ts timestamp, i int)
sql create table $tb (ts timestamp, i int)
...
@@ -85,8 +85,8 @@ while $x < 20
...
@@ -85,8 +85,8 @@ while $x < 20
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
print ===> loop times: $x
print ===> loop times: $x
endw
endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/delete_reusevnode.sim
浏览文件 @
234b8976
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
print ======== step1
print ======== step1
$tbPrefix = t
$tbPrefix = t
$i = 0
$i = 0
...
@@ -21,13 +21,13 @@ while $i < 30
...
@@ -21,13 +21,13 @@ while $i < 30
print times $i
print times $i
$i = $i + 1
$i = $i + 1
endw
endw
print ======== step2
print ======== step2
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
system sh/stop_dnodes.sh
system sh/stop_dnodes.sh
...
@@ -94,4 +94,4 @@ if $rows != 2 then
...
@@ -94,4 +94,4 @@ if $rows != 2 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/delete_reusevnode2.sim
浏览文件 @
234b8976
...
@@ -62,4 +62,4 @@ if $rows != 2 then
...
@@ -62,4 +62,4 @@ if $rows != 2 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/delete_writing1.sim
浏览文件 @
234b8976
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create database db
sql create database db
sql create table db.tb (ts timestamp, i int)
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
sql insert into db.tb values(now, 1)
...
@@ -11,18 +11,18 @@ print ======== start back
...
@@ -11,18 +11,18 @@ print ======== start back
run_back tsim/db/back_insert.sim
run_back tsim/db/back_insert.sim
sleep 1000
sleep 1000
print ======== step1
print ======== step1
$x = 1
$x = 1
while $x < 10
while $x < 10
print drop database times $x
print drop database times $x
sql drop database if exists db
sql drop database if exists db
sql create database db
sql create database db
sql create table db.tb (ts timestamp, i int)
sql create table db.tb (ts timestamp, i int)
sleep 1000
sleep 1000
$x = $x + 1
$x = $x + 1
endw
endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/delete_writing2.sim
浏览文件 @
234b8976
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
...
@@ -3,7 +3,7 @@ system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode1 -s start
sql connect
sql connect
sql create database db
sql create database db
sql create table db.tb (ts timestamp, i int)
sql create table db.tb (ts timestamp, i int)
sql insert into db.tb values(now, 1)
sql insert into db.tb values(now, 1)
...
@@ -11,11 +11,11 @@ sql create database db2
...
@@ -11,11 +11,11 @@ sql create database db2
sql create table db2.tb2 (ts timestamp, i int)
sql create table db2.tb2 (ts timestamp, i int)
sql insert into db2.tb2 values(now, 1)
sql insert into db2.tb2 values(now, 1)
sql create database db3
sql create database db3
sql create table db3.tb3 (ts timestamp, i int)
sql create table db3.tb3 (ts timestamp, i int)
sql insert into db3.tb3 values(now, 1)
sql insert into db3.tb3 values(now, 1)
sql create database db4
sql create database db4
sql create table db4.tb4 (ts timestamp, i int)
sql create table db4.tb4 (ts timestamp, i int)
sql insert into db4.tb4 values(now, 1)
sql insert into db4.tb4 values(now, 1)
...
@@ -23,19 +23,19 @@ print ======== start back
...
@@ -23,19 +23,19 @@ print ======== start back
run_back tsim/db/back_insert.sim
run_back tsim/db/back_insert.sim
sleep 1000
sleep 1000
print ======== step1
print ======== step1
$x = 1
$x = 1
while $x < 10
while $x < 10
print drop database times $x
print drop database times $x
sql drop database if exists db
sql drop database if exists db
sql create database db
sql create database db
sql create table db.tb (ts timestamp, i int)
sql create table db.tb (ts timestamp, i int)
sleep 1000
sleep 1000
$x = $x + 1
$x = $x + 1
endw
endw
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/dropdnodes.sim
浏览文件 @
234b8976
...
@@ -12,7 +12,7 @@ system sh/exec.sh -n dnode1 -s start
...
@@ -12,7 +12,7 @@ system sh/exec.sh -n dnode1 -s start
system sh/exec.sh -n dnode2 -s start
system sh/exec.sh -n dnode2 -s start
sleep 2000
sleep 2000
sql connect
sql connect
sql create dnode $hostname2
sql create dnode $hostname2
sleep 2000
sleep 2000
...
@@ -61,13 +61,13 @@ sql show tables
...
@@ -61,13 +61,13 @@ sql show tables
print $rows
print $rows
if $rows != 16 then
if $rows != 16 then
return -1
return -1
endi
endi
sql select * from mt
sql select * from mt
print $rows
print $rows
if $rows != 16 then
if $rows != 16 then
return -1
return -1
endi
endi
print ========== step3
print ========== step3
...
@@ -82,26 +82,26 @@ sql show tables
...
@@ -82,26 +82,26 @@ sql show tables
print $rows
print $rows
if $rows != 8 then
if $rows != 8 then
return -1
return -1
endi
endi
sql select * from mt
sql select * from mt
print $rows
print $rows
if $rows != 8 then
if $rows != 8 then
return -1
return -1
endi
endi
sql select * from db.t5
sql select * from db.t5
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
sql select * from db.t13
sql select * from db.t13
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
sql_error select * from db.t1
sql_error select * from db.t1
sql_error select * from db.t9
sql_error select * from db.t9
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/keep.sim
浏览文件 @
234b8976
...
@@ -14,7 +14,7 @@ while $x < 41
...
@@ -14,7 +14,7 @@ while $x < 41
sql insert into tb values (now - $time , $x ) -x step2
sql insert into tb values (now - $time , $x ) -x step2
step2:
step2:
$x = $x + 1
$x = $x + 1
endw
endw
sql select * from tb
sql select * from tb
print ===> rows $rows last $data01
print ===> rows $rows last $data01
...
@@ -42,10 +42,10 @@ sql alter database keepdb keep 60
...
@@ -42,10 +42,10 @@ sql alter database keepdb keep 60
sql flush database keepdb
sql flush database keepdb
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
print $data00 $data01 $data02 $data03 $data04 $data05 $data06 $data07
if $data22 != 2 then
if $data22 != 2 then
return -1
return -1
endi
endi
if $data27 != 86400m,86400m,86400m then
if $data27 != 86400m,86400m,86400m then
return -1
return -1
endi
endi
...
@@ -56,7 +56,7 @@ while $x < 81
...
@@ -56,7 +56,7 @@ while $x < 81
sql insert into tb values (now - $time , $x ) -x step4
sql insert into tb values (now - $time , $x ) -x step4
step4:
step4:
$x = $x + 1
$x = $x + 1
endw
endw
sql select * from tb
sql select * from tb
print ===> rows $rows last $data01
print ===> rows $rows last $data01
...
@@ -83,10 +83,10 @@ endi
...
@@ -83,10 +83,10 @@ endi
print ======== step6 alter db
print ======== step6 alter db
sql alter database keepdb keep 30
sql alter database keepdb keep 30
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $data22 != 2 then
if $data22 != 2 then
return -1
return -1
endi
endi
if $data27 != 43200m,43200m,43200m then
if $data27 != 43200m,43200m,43200m then
return -1
return -1
endi
endi
...
@@ -110,7 +110,7 @@ while $x < 121
...
@@ -110,7 +110,7 @@ while $x < 121
sql insert into tb values (now - $time , $x ) -x step8
sql insert into tb values (now - $time , $x ) -x step8
step8:
step8:
$x = $x + 1
$x = $x + 1
endw
endw
sql select * from tb
sql select * from tb
print ===> rows $rows last $data01
print ===> rows $rows last $data01
...
@@ -137,4 +137,4 @@ error3:
...
@@ -137,4 +137,4 @@ error3:
print ======= test success
print ======= test success
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
system sh/exec.sh -n dnode2 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/len.sim
浏览文件 @
234b8976
...
@@ -11,33 +11,33 @@ sql create database -x step1
...
@@ -11,33 +11,33 @@ sql create database -x step1
step1:
step1:
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
print =============== step2
print =============== step2
sql create database a
sql create database a
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
sql drop database a
sql drop database a
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
print =============== step3
print =============== step3
sql create database a12345678
sql create database a12345678
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
sql drop database a12345678
sql drop database a12345678
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
...
@@ -46,15 +46,15 @@ sql create database a012345678901201234567890120123456789012a0123456789012012345
...
@@ -46,15 +46,15 @@ sql create database a012345678901201234567890120123456789012a0123456789012012345
return -1
return -1
step4:
step4:
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
print =============== step5
print =============== step5
sql create database a;1
sql create database a;1
sql drop database a
sql drop database a
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
...
@@ -64,7 +64,7 @@ sql create database a'1 -x step6
...
@@ -64,7 +64,7 @@ sql create database a'1 -x step6
step6:
step6:
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
...
@@ -73,7 +73,7 @@ sql create database (a) -x step7
...
@@ -73,7 +73,7 @@ sql create database (a) -x step7
return -1
return -1
step7:
step7:
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
...
@@ -82,8 +82,8 @@ sql create database a.1 -x step8
...
@@ -82,8 +82,8 @@ sql create database a.1 -x step8
return -1
return -1
step8:
step8:
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
if $rows != 2 then
if $rows != 2 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/repeat.sim
浏览文件 @
234b8976
...
@@ -56,4 +56,4 @@ sql drop database d10
...
@@ -56,4 +56,4 @@ sql drop database d10
sql drop database d11
sql drop database d11
sql drop database d12
sql drop database d12
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
tests/script/tsim/db/show_create_db.sim
浏览文件 @
234b8976
...
@@ -7,7 +7,7 @@ print =============== step2
...
@@ -7,7 +7,7 @@ print =============== step2
sql create database db
sql create database db
sql show create database db
sql show create database db
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
@@ -15,13 +15,13 @@ print =============== step3
...
@@ -15,13 +15,13 @@ print =============== step3
sql use db
sql use db
sql show create database db
sql show create database db
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 != db then
if $data00 != db then
return -1
return -1
endi
endi
sql drop database db
sql drop database db
...
...
tests/script/tsim/db/show_create_table.sim
浏览文件 @
234b8976
...
@@ -11,14 +11,14 @@ sql create table t0 using meters tags(1,'ch')
...
@@ -11,14 +11,14 @@ sql create table t0 using meters tags(1,'ch')
sql create table normalTbl(ts timestamp, zone binary(8))
sql create table normalTbl(ts timestamp, zone binary(8))
sql use db
sql use db
sql show create table meters
sql show create table meters
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
print ===============check sub table
print ===============check sub table
sql show create table t0
sql show create table t0
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
if $data00 == 't0' then
if $data00 == 't0' then
...
@@ -27,8 +27,8 @@ endi
...
@@ -27,8 +27,8 @@ endi
print ===============check normal table
print ===============check normal table
sql show create table normalTbl
sql show create table normalTbl
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
@@ -37,8 +37,8 @@ if $data00 == 'normalTbl' then
...
@@ -37,8 +37,8 @@ if $data00 == 'normalTbl' then
endi
endi
print ===============check super table
print ===============check super table
sql show create table meters
sql show create table meters
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
@@ -49,7 +49,7 @@ endi
...
@@ -49,7 +49,7 @@ endi
print ===============check sub table with prefix
print ===============check sub table with prefix
sql show create table db.t0
sql show create table db.t0
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
@@ -58,8 +58,8 @@ if $data00 == 't0' then
...
@@ -58,8 +58,8 @@ if $data00 == 't0' then
endi
endi
print ===============check normal table with prefix
print ===============check normal table with prefix
sql show create table db.normalTbl
sql show create table db.normalTbl
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
@@ -69,8 +69,8 @@ endi
...
@@ -69,8 +69,8 @@ endi
print ===============check super table with prefix
print ===============check super table with prefix
sql show create table db.meters
sql show create table db.meters
if $rows != 1 then
if $rows != 1 then
return -1
return -1
endi
endi
...
...
tests/script/tsim/db/tables.sim
浏览文件 @
234b8976
...
@@ -8,7 +8,7 @@ sql create database db
...
@@ -8,7 +8,7 @@ sql create database db
sql select * from information_schema.ins_databases
sql select * from information_schema.ins_databases
print $rows $data07
print $rows $data07
if $rows != 3 then
if $rows != 3 then
return -1
return -1
endi
endi
...
@@ -125,4 +125,4 @@ if $data01 != 4 then
...
@@ -125,4 +125,4 @@ if $data01 != 4 then
return -1
return -1
endi
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录