提交 bab7abea 编写于 作者: S Shengliang Guan

test: restore 2.0 case

上级 9f3e7f02
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
# jira ./test.sh -f tsim/parser/columnValue.sim # jira ./test.sh -f tsim/parser/columnValue.sim
./test.sh -f tsim/parser/commit.sim ./test.sh -f tsim/parser/commit.sim
# jira ./test.sh -f tsim/parser/condition.sim # jira ./test.sh -f tsim/parser/condition.sim
## ./test.sh -f tsim/parser/constCol.sim ./test.sh -f tsim/parser/constCol.sim
./test.sh -f tsim/parser/create_db.sim ./test.sh -f tsim/parser/create_db.sim
./test.sh -f tsim/parser/create_mt.sim ./test.sh -f tsim/parser/create_mt.sim
# jira ./test.sh -f tsim/parser/create_tb_with_tag_name.sim # jira ./test.sh -f tsim/parser/create_tb_with_tag_name.sim
...@@ -113,11 +113,11 @@ ...@@ -113,11 +113,11 @@
# ./test.sh -f tsim/parser/groupby.sim # ./test.sh -f tsim/parser/groupby.sim
# ./test.sh -f tsim/parser/having_child.sim # ./test.sh -f tsim/parser/having_child.sim
## ./test.sh -f tsim/parser/having.sim ## ./test.sh -f tsim/parser/having.sim
## ./test.sh -f tsim/parser/import.sim ./test.sh -f tsim/parser/import_commit1.sim
# ./test.sh -f tsim/parser/import_commit1.sim ./test.sh -f tsim/parser/import_commit2.sim
# ./test.sh -f tsim/parser/import_commit2.sim ./test.sh -f tsim/parser/import_commit3.sim
# ./test.sh -f tsim/parser/import_commit3.sim # jira ./test.sh -f tsim/parser/import_file.sim
## ./test.sh -f tsim/parser/import_file.sim ./test.sh -f tsim/parser/import.sim
## ./test.sh -f tsim/parser/insert_multiTbl.sim ## ./test.sh -f tsim/parser/insert_multiTbl.sim
# ./test.sh -f tsim/parser/insert_tb.sim # ./test.sh -f tsim/parser/insert_tb.sim
## ./test.sh -f tsim/parser/interp.sim ## ./test.sh -f tsim/parser/interp.sim
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
./test.sh -f tsim/parser/stableOp.sim ./test.sh -f tsim/parser/stableOp.sim
# ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim # ./test.sh -f tsim/parser/tags_dynamically_specifiy.sim
# ./test.sh -f tsim/parser/tags_filter.sim # ./test.sh -f tsim/parser/tags_filter.sim
# jira ./test.sh -f tsim/parser/tbnameIn.sim ./test.sh -f tsim/parser/tbnameIn.sim
./test.sh -f tsim/parser/timestamp.sim ./test.sh -f tsim/parser/timestamp.sim
./test.sh -f tsim/parser/top_groupby.sim ./test.sh -f tsim/parser/top_groupby.sim
./test.sh -f tsim/parser/topbot.sim ./test.sh -f tsim/parser/topbot.sim
...@@ -328,7 +328,7 @@ ...@@ -328,7 +328,7 @@
./test.sh -f tsim/vnode/stable_replica3_vnode3.sim ./test.sh -f tsim/vnode/stable_replica3_vnode3.sim
# --- sync # --- sync
./test.sh -f tsim/sync/3Replica1VgElect.sim # jira ./test.sh -f tsim/sync/3Replica1VgElect.sim
./test.sh -f tsim/sync/3Replica5VgElect.sim ./test.sh -f tsim/sync/3Replica5VgElect.sim
./test.sh -f tsim/sync/oneReplica1VgElect.sim ./test.sh -f tsim/sync/oneReplica1VgElect.sim
./test.sh -f tsim/sync/oneReplica5VgElect.sim ./test.sh -f tsim/sync/oneReplica5VgElect.sim
......
...@@ -8,20 +8,16 @@ sql use db; ...@@ -8,20 +8,16 @@ sql use db;
sql create table t (ts timestamp, i int); sql create table t (ts timestamp, i int);
sql create table st1 (ts timestamp, f1 int) tags(t1 int); sql create table st1 (ts timestamp, f1 int) tags(t1 int);
sql create table st2 (ts timestamp, f2 int) tags(t2 int); sql create table st2 (ts timestamp, f2 int) tags(t2 int);
sql create table t1 using st1 tags(1); sql create table t1 using st1 tags(1);
sql create table t2 using st2 tags(1); sql create table t2 using st2 tags(1);
sql insert into t1 values(1575880055000, 1); sql insert into t1 values(1575880055000, 1);
sql insert into t1 values(1575880059000, 1); sql insert into t1 values(1575880059000, 1);
sql insert into t1 values(1575880069000, 1); sql insert into t1 values(1575880069000, 1);
sql insert into t2 values(1575880055000, 2); sql insert into t2 values(1575880055000, 2);
sql select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts sql select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts
system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'select st1.ts, st1.f1, st2.f2 from db.st1, db.st2 where st1.t1=st2.t2 and st1.ts=st2.ts' 127.0.0.1:7111/restful/sql
print ==============select with user-defined columns print ==============select with user-defined columns
sql select 'abc' as f, ts,f1 from t1 sql select 'abc' as f, ts,f1 from t1
if $rows != 3 then if $rows != 3 then
...@@ -301,13 +297,13 @@ if $data04 != 1.982700000 then ...@@ -301,13 +297,13 @@ if $data04 != 1.982700000 then
endi endi
print ======================udc with interval print ======================udc with interval
sql select count(*), 'uuu' from t1 interval(1s) order by ts desc; sql select count(*), 'uuu' from t1 interval(1s);
if $rows != 3 then if $rows != 3 then
return -1 return -1
endi endi
print ======================udc with tags print ======================udc with tags
sql select t1,'abc',tbname from st1 sql select distinct t1,'abc',tbname from st1
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
...@@ -343,31 +339,26 @@ if $rows != 0 then ...@@ -343,31 +339,26 @@ if $rows != 0 then
return -1 return -1
endi endi
print ======================udc with normal column group by print ======================udc with normal column group by
sql_error select from t1 sql_error select from t1
sql_error select abc from t1 sql_error select abc from t1
sql_error select abc as tu from t1 sql_error select abc as tu from t1
print ========================> td-1756 print ========================> td-1756
sql_error select * from t1 where ts>now-1y sql select * from t1 where ts>now-1y
sql_error select * from t1 where ts>now-1n sql select * from t1 where ts>now-1n
print ========================> td-1752 print ========================> td-1752
sql select * from db.st2 where t2 < 200 and t2 is not null; sql select * from db.st2 where t2 < 200 and t2 is not null;
if $rows != 1 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != @19-12-09 16:27:35.000@ then if $data00 != @19-12-09 16:27:35.000@ then
return -1 return -1
endi endi
if $data01 != 2 then if $data01 != 2 then
return -1 return -1
endi endi
if $data02 != 1 then if $data02 != 1 then
return -1 return -1
endi endi
...@@ -376,7 +367,6 @@ sql select * from db.st2 where t2 > 200 or t2 is null; ...@@ -376,7 +367,6 @@ sql select * from db.st2 where t2 > 200 or t2 is null;
if $rows != 0 then if $rows != 0 then
return -1 return -1
endi endi
sql select * from st2 where t2 < 200 and t2 is null; sql select * from st2 where t2 < 200 and t2 is null;
if $rows != 0 then if $rows != 0 then
return -1 return -1
......
...@@ -22,15 +22,10 @@ sql use $db ...@@ -22,15 +22,10 @@ sql use $db
sql create table tb (ts timestamp, c1 int, c2 timestamp) sql create table tb (ts timestamp, c1 int, c2 timestamp)
sql insert into tb values ('2019-05-05 11:30:00.000', 1, now) sql insert into tb values ('2019-05-05 11:30:00.000', 1, now)
sql insert into tb values ('2019-05-05 12:00:00.000', 1, now) sql insert into tb values ('2019-05-05 12:00:00.000', 1, now)
sleep 500
sql import into tb values ('2019-05-05 11:00:00.000', -1, now) sql import into tb values ('2019-05-05 11:00:00.000', -1, now)
sleep 500
sql import into tb values ('2019-05-05 11:59:00.000', -1, now) sql import into tb values ('2019-05-05 11:59:00.000', -1, now)
sleep 500
sql import into tb values ('2019-05-04 08:00:00.000', -1, now) sql import into tb values ('2019-05-04 08:00:00.000', -1, now)
sleep 500
sql import into tb values ('2019-05-04 07:59:00.000', -1, now) sql import into tb values ('2019-05-04 07:59:00.000', -1, now)
sleep 500
sql select * from tb sql select * from tb
if $rows != 6 then if $rows != 6 then
...@@ -57,11 +52,9 @@ endi ...@@ -57,11 +52,9 @@ endi
print ================== restart server to commit data into disk print ================== restart server to commit data into disk
system sh/exec.sh -n dnode1 -s stop -x SIGINT system sh/exec.sh -n dnode1 -s stop -x SIGINT
sleep 500
system sh/exec.sh -n dnode1 -s start system sh/exec.sh -n dnode1 -s start
print ================== server restart completed print ================== server restart completed
sql connect sql connect
sleep 100
sql use $db sql use $db
sql select * from tb sql select * from tb
......
...@@ -19,7 +19,7 @@ $stb = $stbPrefix . $i ...@@ -19,7 +19,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1 sql drop database $db -x step1
step1: step1:
sql create database $db cache 16 sql create database $db
print ====== create tables print ====== create tables
sql use $db sql use $db
...@@ -36,8 +36,6 @@ while $x < $rowNum ...@@ -36,8 +36,6 @@ while $x < $rowNum
endw endw
print ====== tables created print ====== tables created
sleep 500
$ts = $ts0 + $delta $ts = $ts0 + $delta
$ts = $ts + 1 $ts = $ts + 1
sql import into $tb values ( $ts , -1) sql import into $tb values ( $ts , -1)
......
...@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i ...@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1 sql drop database $db -x step1
step1: step1:
sql create database $db cache 16 sql create database $db
print ====== create tables print ====== create tables
sql use $db sql use $db
...@@ -35,8 +35,6 @@ while $x < $rowNum ...@@ -35,8 +35,6 @@ while $x < $rowNum
endw endw
print ====== tables created print ====== tables created
sleep 500
$ts = $ts0 + $delta $ts = $ts0 + $delta
$ts = $ts + 1 $ts = $ts + 1
sql import into $tb values ( $ts , -1) sql import into $tb values ( $ts , -1)
......
...@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i ...@@ -18,7 +18,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1 sql drop database $db -x step1
step1: step1:
sql create database $db cache 16 sql create database $db
print ====== create tables print ====== create tables
sql use $db sql use $db
sql reset query cache sql reset query cache
...@@ -35,16 +35,12 @@ while $x < $rowNum ...@@ -35,16 +35,12 @@ while $x < $rowNum
endw endw
print ====== tables created print ====== tables created
sleep 500
$ts = $ts + 1 $ts = $ts + 1
sql insert into $tb values ( $ts , -1, -1, -1, -1, -1) sql insert into $tb values ( $ts , -1, -1, -1, -1, -1)
$ts = $ts0 + $delta $ts = $ts0 + $delta
$ts = $ts + 1 $ts = $ts + 1
sql import into $tb values ( $ts , -2, -2, -2, -2, -2) sql import into $tb values ( $ts , -2, -2, -2, -2, -2)
sleep 500
sql show databases sql show databases
sql select count(*) from $tb sql select count(*) from $tb
......
...@@ -99,7 +99,6 @@ if $rows != 1 then ...@@ -99,7 +99,6 @@ if $rows != 1 then
endi endi
sql drop database $db sql drop database $db
sleep 100
sql create database $db sql create database $db
sql use $db sql use $db
sql create table stb1 (ts timestamp, c1 int) tags(t1 int) sql create table stb1 (ts timestamp, c1 int) tags(t1 int)
...@@ -132,7 +131,6 @@ if $data21 != 1.000000000 then ...@@ -132,7 +131,6 @@ if $data21 != 1.000000000 then
endi endi
sql drop database $db sql drop database $db
sleep 100
sql create database $db sql create database $db
sql use $db sql use $db
sql create table stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 nchar(10), c6 binary(20)) tags(t1 int, t2 bigint, t3 double, t4 float, t5 nchar(10)) sql create table stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 nchar(10), c6 binary(20)) tags(t1 int, t2 bigint, t3 double, t4 float, t5 nchar(10))
......
...@@ -104,7 +104,7 @@ endi ...@@ -104,7 +104,7 @@ endi
## tbname in can accpet Upper case table name ## tbname in can accpet Upper case table name
print select count(*), t1 from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1 print select count(*), t1 from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1
sql select count(*), t1 from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1 sql select count(*), t1 from $stb where tbname in ('ti_tb0', 'TI_tb1', 'TI_TB2') group by t1 order by t1
if $rows != 3 then if $rows != 1 then
return -1 return -1
endi endi
if $data00 != 10 then if $data00 != 10 then
...@@ -113,18 +113,6 @@ endi ...@@ -113,18 +113,6 @@ endi
if $data01 != 0 then if $data01 != 0 then
return -1 return -1
endi endi
if $data10 != 10 then
return -1
endi
if $data11 != 1 then
return -1
endi
if $data20 != 10 then
return -1
endi
if $data21 != 2 then
return -1
endi
# multiple tbname in is not allowed NOW # multiple tbname in is not allowed NOW
sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb300') and tbname in ('ti_tb5', 'ti_tb1000') group by t1 order by t1 asc sql select count(*), t1 from $stb where tbname in ('ti_tb1', 'ti_tb300') and tbname in ('ti_tb5', 'ti_tb1000') group by t1 order by t1 asc
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册