提交 77e481c7 编写于 作者: S Shengliang Guan

test: restore 2.0 case

上级 af57edcc
...@@ -91,24 +91,23 @@ ...@@ -91,24 +91,23 @@
./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim ./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim
./test.sh -f tsim/parser/between_and.sim ./test.sh -f tsim/parser/between_and.sim
./test.sh -f tsim/parser/binary_escapeCharacter.sim ./test.sh -f tsim/parser/binary_escapeCharacter.sim
# nojira ./test.sh -f tsim/parser/col_arithmetic_operation.sim # jira ./test.sh -f tsim/parser/col_arithmetic_operation.sim
# nojira ./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
## ./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_db__for_community_version.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
# ./test.sh -f tsim/parser/create_tb.sim ./test.sh -f tsim/parser/create_tb.sim
## ./test.sh -f tsim/parser/create_tb_with_tag_name.sim ./test.sh -f tsim/parser/dbtbnameValidate.sim
# ./test.sh -f tsim/parser/dbtbnameValidate.sim ./test.sh -f tsim/parser/distinct.sim
##./test.sh -f tsim/parser/distinct.sim # jira ./test.sh -f tsim/parser/fill_stb.sim
# ./test.sh -f tsim/parser/fill.sim ./test.sh -f tsim/parser/fill_us.sim
# ./test.sh -f tsim/parser/fill_stb.sim ./test.sh -f tsim/parser/fill.sim
## ./test.sh -f tsim/parser/fill_us.sim ./test.sh -f tsim/parser/first_last.sim
# ./test.sh -f tsim/parser/first_last.sim
./test.sh -f tsim/parser/fourArithmetic-basic.sim ./test.sh -f tsim/parser/fourArithmetic-basic.sim
## ./test.sh -f tsim/parser/function.sim # jira ./test.sh -f tsim/parser/function.sim
./test.sh -f tsim/parser/groupby-basic.sim ./test.sh -f tsim/parser/groupby-basic.sim
# ./test.sh -f tsim/parser/groupby.sim # ./test.sh -f tsim/parser/groupby.sim
## ./test.sh -f tsim/parser/having.sim ## ./test.sh -f tsim/parser/having.sim
......
...@@ -20,7 +20,7 @@ $stb = $stbPrefix . $i ...@@ -20,7 +20,7 @@ $stb = $stbPrefix . $i
sql drop database $db -x step1 sql drop database $db -x step1
step1: step1:
sql create database $db maxrows 255 ctime 3600 sql create database $db maxrows 255
print ====== create tables print ====== create tables
sql use $db sql use $db
sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int) sql create table $stb (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int)
...@@ -78,12 +78,9 @@ endw ...@@ -78,12 +78,9 @@ endw
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
sleep 100
print ================== server restart completed print ================== server restart completed
sql connect sql connect
sleep 100
print ====== select from table and check num of rows returned print ====== select from table and check num of rows returned
sql use $db sql use $db
......
...@@ -2,11 +2,11 @@ system sh/stop_dnodes.sh ...@@ -2,11 +2,11 @@ system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1 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 drop database if exists cdb sql drop database if exists cdb
sql create database if not exists cdb sql create database if not exists cdb
sql use cdb sql use cdb
sql create table stb1 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(10), t3 double) sql create table stb1 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(10), t3 double)
sql create table tb1 using stb1 tags(1,'1',1.0) sql create table tb1 using stb1 tags(1,'1',1.0)
sql create table tb2 using stb1 tags(2,'2',2.0) sql create table tb2 using stb1 tags(2,'2',2.0)
sql create table tb3 using stb1 tags(3,'3',3.0) sql create table tb3 using stb1 tags(3,'3',3.0)
...@@ -45,7 +45,6 @@ sql insert into tb6 values ('2021-05-05 18:19:27',64,64.0,64,64,64,64.0,false,'6 ...@@ -45,7 +45,6 @@ sql insert into tb6 values ('2021-05-05 18:19:27',64,64.0,64,64,64,64.0,false,'6
sql insert into tb6 values ('2021-05-05 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) sql insert into tb6 values ('2021-05-05 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
sql create table stb2 (ts timestamp, u1 int unsigned, u2 bigint unsigned, u3 smallint unsigned, u4 tinyint unsigned, ts2 timestamp) TAGS(t1 int unsigned, t2 bigint unsigned, t3 timestamp, t4 int) sql create table stb2 (ts timestamp, u1 int unsigned, u2 bigint unsigned, u3 smallint unsigned, u4 tinyint unsigned, ts2 timestamp) TAGS(t1 int unsigned, t2 bigint unsigned, t3 timestamp, t4 int)
sql create table tb2_1 using stb2 tags(1,1,'2021-05-05 18:38:38',1) sql create table tb2_1 using stb2 tags(1,1,'2021-05-05 18:38:38',1)
sql create table tb2_2 using stb2 tags(2,2,'2021-05-05 18:58:58',2) sql create table tb2_2 using stb2 tags(2,2,'2021-05-05 18:58:58',2)
...@@ -67,7 +66,6 @@ sql insert into tb2_2 values ('2021-05-05 18:19:14',8,2,3,4,'2021-05-05 18:28:15 ...@@ -67,7 +66,6 @@ sql insert into tb2_2 values ('2021-05-05 18:19:14',8,2,3,4,'2021-05-05 18:28:15
sql insert into tb2_2 values ('2021-05-05 18:19:15',5,6,7,8,'2021-05-05 18:28:16') sql insert into tb2_2 values ('2021-05-05 18:19:15',5,6,7,8,'2021-05-05 18:28:16')
sql create table stb3 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(10), t3 double) sql create table stb3 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9)) TAGS(t1 int, t2 binary(10), t3 double)
sql create table tb3_1 using stb3 tags(1,'1',1.0) sql create table tb3_1 using stb3 tags(1,'1',1.0)
sql create table tb3_2 using stb3 tags(2,'2',2.0) sql create table tb3_2 using stb3 tags(2,'2',2.0)
...@@ -78,7 +76,6 @@ sql insert into tb3_1 values ('2021-04-05 18:19:03',4,4.0,4,4,4,4.0,false,'4','4 ...@@ -78,7 +76,6 @@ sql insert into tb3_1 values ('2021-04-05 18:19:03',4,4.0,4,4,4,4.0,false,'4','4
sql insert into tb3_1 values ('2021-05-05 18:19:28',5,NULL,5,NULL,5,NULL,true,NULL,'5') sql insert into tb3_1 values ('2021-05-05 18:19:28',5,NULL,5,NULL,5,NULL,true,NULL,'5')
sql insert into tb3_1 values ('2021-06-05 18:19:28',NULL,6.0,NULL,6,NULL,6.0,NULL,'6',NULL) sql insert into tb3_1 values ('2021-06-05 18:19:28',NULL,6.0,NULL,6,NULL,6.0,NULL,'6',NULL)
sql insert into tb3_1 values ('2021-07-05 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) sql insert into tb3_1 values ('2021-07-05 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
sql insert into tb3_2 values ('2021-01-06 18:19:00',11,11.0,11,11,11,11.0,true ,'11','11') sql insert into tb3_2 values ('2021-01-06 18:19:00',11,11.0,11,11,11,11.0,true ,'11','11')
sql insert into tb3_2 values ('2021-02-06 18:19:01',12,12.0,12,12,12,12.0,true ,'12','12') sql insert into tb3_2 values ('2021-02-06 18:19:01',12,12.0,12,12,12,12.0,true ,'12','12')
sql insert into tb3_2 values ('2021-03-06 18:19:02',13,13.0,13,13,13,13.0,false,'13','13') sql insert into tb3_2 values ('2021-03-06 18:19:02',13,13.0,13,13,13,13.0,false,'13','13')
...@@ -87,9 +84,7 @@ sql insert into tb3_2 values ('2021-05-06 18:19:28',15,NULL,15,NULL,15,NULL,true ...@@ -87,9 +84,7 @@ sql insert into tb3_2 values ('2021-05-06 18:19:28',15,NULL,15,NULL,15,NULL,true
sql insert into tb3_2 values ('2021-06-06 18:19:28',NULL,16.0,NULL,16,NULL,16.0,NULL,'16',NULL) sql insert into tb3_2 values ('2021-06-06 18:19:28',NULL,16.0,NULL,16,NULL,16.0,NULL,'16',NULL)
sql insert into tb3_2 values ('2021-07-06 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL) sql insert into tb3_2 values ('2021-07-06 18:19:28',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL)
sql create table stb4 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9),c10 binary(16300)) TAGS(t1 int, t2 binary(10), t3 double) sql create table stb4 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool, c8 binary(10), c9 nchar(9),c10 binary(16300)) TAGS(t1 int, t2 binary(10), t3 double)
sql create table tb4_0 using stb4 tags(0,'0',0.0) sql create table tb4_0 using stb4 tags(0,'0',0.0)
sql create table tb4_1 using stb4 tags(1,'1',1.0) sql create table tb4_1 using stb4 tags(1,'1',1.0)
sql create table tb4_2 using stb4 tags(2,'2',2.0) sql create table tb4_2 using stb4 tags(2,'2',2.0)
...@@ -128,19 +123,13 @@ while $i < $blockNum ...@@ -128,19 +123,13 @@ while $i < $blockNum
$ts0 = $ts0 + 259200000 $ts0 = $ts0 + 259200000
endw endw
sleep 100
sql connect
run tsim/parser/condition_query.sim run tsim/parser/condition_query.sim
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 100
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
run tsim/parser/condition_query.sim run tsim/parser/condition_query.sim
...@@ -11,14 +11,14 @@ if $rows != 28 then ...@@ -11,14 +11,14 @@ if $rows != 28 then
return -1 return -1
endi endi
sql_error select * from stb1 where c8 > 0 sql select * from stb1 where c8 > 0
sql_error select * from stb1 where c7 in (0,2,3,1); sql select * from stb1 where c7 in (0,2,3,1);
sql_error select * from stb1 where c8 in (true); sql select * from stb1 where c8 in (true);
sql_error select * from stb1 where c8 in (1,2); sql select * from stb1 where c8 in (1,2);
sql_error select * from stb1 where t2 in (3.0); sql select * from stb1 where t2 in (3.0);
sql_error select ts,c1,c7 from stb1 where c7 > false sql select ts,c1,c7 from stb1 where c7 > false
sql_error select * from stb1 where c1 > NULL; sql select * from stb1 where c1 > NULL;
sql_error select * from stb1 where c1 = NULL; sql select * from stb1 where c1 = NULL;
sql_error select * from stb1 where c1 LIKE '%1'; sql_error select * from stb1 where c1 LIKE '%1';
sql_error select * from stb1 where c2 LIKE '%1'; sql_error select * from stb1 where c2 LIKE '%1';
sql_error select * from stb1 where c3 LIKE '%1'; sql_error select * from stb1 where c3 LIKE '%1';
...@@ -26,20 +26,20 @@ sql_error select * from stb1 where c4 LIKE '%1'; ...@@ -26,20 +26,20 @@ sql_error select * from stb1 where c4 LIKE '%1';
sql_error select * from stb1 where c5 LIKE '%1'; sql_error select * from stb1 where c5 LIKE '%1';
sql_error select * from stb1 where c6 LIKE '%1'; sql_error select * from stb1 where c6 LIKE '%1';
sql_error select * from stb1 where c7 LIKE '%1'; sql_error select * from stb1 where c7 LIKE '%1';
sql_error select * from stb1 where c1 = 'NULL'; sql select * from stb1 where c1 = 'NULL';
sql_error select * from stb1 where c2 > 'NULL'; sql select * from stb1 where c2 > 'NULL';
sql_error select * from stb1 where c3 <> 'NULL'; sql select * from stb1 where c3 <> 'NULL';
sql_error select * from stb1 where c4 != 'null'; sql select * from stb1 where c4 != 'null';
sql_error select * from stb1 where c5 >= 'null'; sql select * from stb1 where c5 >= 'null';
sql_error select * from stb1 where c6 <= 'null'; sql select * from stb1 where c6 <= 'null';
sql_error select * from stb1 where c7 < 'nuLl'; sql select * from stb1 where c7 < 'nuLl';
sql_error select * from stb1 where c8 < 'nuLl'; sql select * from stb1 where c8 < 'nuLl';
sql_error select * from stb1 where c9 > 'nuLl'; sql select * from stb1 where c9 > 'nuLl';
sql_error select * from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b; sql_error select * from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b;
sql_error select a.ts,a.c1,a.c8 from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b where a.ts=b.ts and a.c1 > 50 or b.c1 < 60; sql_error select a.ts,a.c1,a.c8 from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b where a.ts=b.ts and a.c1 > 50 or b.c1 < 60;
sql_error select a.ts,a.c1,a.c8 from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b where a.ts=b.ts and ((a.c1 > 50 and a.c1 < 60) or (b.c2 > 60)); sql_error select a.ts,a.c1,a.c8 from (select * from stb1 where c7=true) a, (select * from stb1 where c1 > 30) b where a.ts=b.ts and ((a.c1 > 50 and a.c1 < 60) or (b.c2 > 60));
sql_error select * from stb1 where 'c2' is null; sql select * from stb1 where 'c2' is null;
sql_error select * from stb1 where 'c2' is not null; sql select * from stb1 where 'c2' is not null;
sql select * from stb1 where c2 > 3.0 or c2 < 60; sql select * from stb1 where c2 > 3.0 or c2 < 60;
if $rows != 28 then if $rows != 28 then
...@@ -173,7 +173,6 @@ if $data32 != 0 then ...@@ -173,7 +173,6 @@ if $data32 != 0 then
return -1 return -1
endi endi
sql select ts,c1,c7 from stb1 where c7 = true sql select ts,c1,c7 from stb1 where c7 = true
if $rows != 14 then if $rows != 14 then
return -1 return -1
......
...@@ -69,7 +69,8 @@ sql_error create table $mt (ts $i_ts , col int) tags (tag1 int) ...@@ -69,7 +69,8 @@ sql_error create table $mt (ts $i_ts , col int) tags (tag1 int)
sql_error create table $mt (ts timestamp, col $i_binary ) tags (tag1 int) sql_error create table $mt (ts timestamp, col $i_binary ) tags (tag1 int)
sql_error create table $mt (ts timestamp, col $i_bigint ) tags (tag1 int) sql_error create table $mt (ts timestamp, col $i_bigint ) tags (tag1 int)
sql_error create table $mt (ts timestamp, col $i_smallint ) tags (tag1 int) sql_error create table $mt (ts timestamp, col $i_smallint ) tags (tag1 int)
sql_error create table $mt (ts timestamp, col $i_binary2 ) tags (tag1 int) sql create table $mt (ts timestamp, col $i_binary2 ) tags (tag1 int)
sql drop table $mt
sql_error create table $mt (ts timestamp, col $i_tinyint ) tags (tag1 int) sql_error create table $mt (ts timestamp, col $i_tinyint ) tags (tag1 int)
sql_error create table $mt (ts timestamp, col $i_nchar ) tags (tag1 int) sql_error create table $mt (ts timestamp, col $i_nchar ) tags (tag1 int)
...@@ -101,7 +102,8 @@ sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_binary ) ...@@ -101,7 +102,8 @@ sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_binary )
sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_bigint ) sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_bigint )
sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_smallint ) sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_smallint )
sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_tinyint ) sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_tinyint )
sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_binary2 ) sql create table $mt (ts timestamp, col int) tags (tag1 $i_binary2 )
sql drop table $mt
sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_bool ) sql_error create table $mt (ts timestamp, col int) tags (tag1 $i_bool )
sql_error create table $mt (ts timestamp, col int) tags (tag1 $nchar ) sql_error create table $mt (ts timestamp, col int) tags (tag1 $nchar )
# correct use of nchar in tags # correct use of nchar in tags
...@@ -144,7 +146,8 @@ sql_error create table $mt (ts timestamp, col1 int) tags ( $ses int) ...@@ -144,7 +146,8 @@ sql_error create table $mt (ts timestamp, col1 int) tags ( $ses int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $int int) sql_error create table $mt (ts timestamp, col1 int) tags ( $int int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $bint int) sql_error create table $mt (ts timestamp, col1 int) tags ( $bint int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $binary int) sql_error create table $mt (ts timestamp, col1 int) tags ( $binary int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $str int) sql create table $mt (ts timestamp, col1 int) tags ( $str int)
sql drop table $mt
sql_error create table $mt (ts timestamp, col1 int) tags ( $tag int) sql_error create table $mt (ts timestamp, col1 int) tags ( $tag int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $tags int) sql_error create table $mt (ts timestamp, col1 int) tags ( $tags int)
sql_error create table $mt (ts timestamp, col1 int) tags ( $sint int) sql_error create table $mt (ts timestamp, col1 int) tags ( $sint int)
...@@ -162,8 +165,8 @@ sql create table $tb using $mt tags (-1) ...@@ -162,8 +165,8 @@ sql create table $tb using $mt tags (-1)
# -x ng_tag_v # -x ng_tag_v
# return -1 # return -1
#ng_tag_v: #ng_tag_v:
sql select tg from $tb sql show tags from $tb
if $data00 != -1 then if $data05 != -1 then
return -1 return -1
endi endi
sql drop table $tb sql drop table $tb
...@@ -172,28 +175,21 @@ sql drop table $tb ...@@ -172,28 +175,21 @@ sql drop table $tb
print create_mt.sim unmatched_tag_types print create_mt.sim unmatched_tag_types
sql reset query cache sql reset query cache
sql create table $tb using $mt tags ('123') sql create table $tb using $mt tags ('123')
sql select tg from $tb sql show tags from $tb
print data00 = $data00 print data05 = $data05
if $data00 != 123 then if $data05 != 123 then
return -1 return -1
endi endi
sql drop table $tb sql drop table $tb
sql_error create table $tb using $mt tags (abc) sql_error create table $tb using $mt tags (abc)
#the case below might need more consideration #the case below might need more consideration
sql_error create table $tb using $mt tags ('abc') sql_error create table $tb using $mt tags ('abc')
sql drop table if exists $tb sql drop table if exists $tb
sql reset query cache sql reset query cache
sql create table $tb using $mt tags (1e1) sql_error create table $tb using $mt tags (1e1)
sql select tg from $tb
if $data00 != 10 then sql_error create table $tb using $mt tags ('1e1')
return -1
endi
sql drop table $tb
sql create table $tb using $mt tags ('1e1')
sql select tg from $tb
if $data00 != 10 then
return -1
endi
sql_error create table $tb using $mt tags (2147483649) sql_error create table $tb using $mt tags (2147483649)
## case: chinese_char_in_metric ## case: chinese_char_in_metric
...@@ -245,7 +241,7 @@ print chinese_char_in_metrics test passed ...@@ -245,7 +241,7 @@ print chinese_char_in_metrics test passed
sql drop database $db sql drop database $db
sql show databases sql show databases
if $rows != 0 then if $rows != 2 then
return -1 return -1
endi endi
......
...@@ -66,7 +66,8 @@ sql_error create table $tb (ts timestamp, col $i_binary ) ...@@ -66,7 +66,8 @@ sql_error create table $tb (ts timestamp, col $i_binary )
sql_error create table $tb (ts timestamp, col $i_bigint ) sql_error create table $tb (ts timestamp, col $i_bigint )
sql_error create table $tb (ts timestamp, col $i_smallint ) sql_error create table $tb (ts timestamp, col $i_smallint )
sql_error create table $tb (ts timestamp, col $i_tinyint ) sql_error create table $tb (ts timestamp, col $i_tinyint )
sql_error create table $tb (ts timestamp, col $i_binary2 ) sql create table $tb (ts timestamp, col $i_binary2 )
sql drop table $tb
sql_error create table $tb (ts timestamp, col $nchar ) sql_error create table $tb (ts timestamp, col $nchar )
sql create table $tb (ts timestamp, col nchar(20)) sql create table $tb (ts timestamp, col nchar(20))
sql show tables sql show tables
...@@ -105,7 +106,8 @@ sql_error create table $tb (ts timestamp, $ses int) ...@@ -105,7 +106,8 @@ sql_error create table $tb (ts timestamp, $ses int)
sql_error create table $tb (ts timestamp, $int int) sql_error create table $tb (ts timestamp, $int int)
sql_error create table $tb (ts timestamp, $bint int) sql_error create table $tb (ts timestamp, $bint int)
sql_error create table $tb (ts timestamp, $binary int) sql_error create table $tb (ts timestamp, $binary int)
sql_error create table $tb (ts timestamp, $str int) sql create table $tb (ts timestamp, $str int)
sql drop table $tb
sql_error create table $tb (ts timestamp, $tag int) sql_error create table $tb (ts timestamp, $tag int)
sql_error create table $tb (ts timestamp, $tags int) sql_error create table $tb (ts timestamp, $tags int)
sql_error create table $tb (ts timestamp, $sint int) sql_error create table $tb (ts timestamp, $sint int)
...@@ -157,7 +159,7 @@ print chinese_char_in_table_support test passed ...@@ -157,7 +159,7 @@ print chinese_char_in_table_support test passed
print ========== create_tb.sim case6: table_already_exists print ========== create_tb.sim case6: table_already_exists
sql create table tbs (ts timestamp, col int) sql create table tbs (ts timestamp, col int)
sql insert into tbs values (now, 1) sql insert into tbs values (now, 1)
sql create table tbs (ts timestamp, col bool) sql_error create table tbs (ts timestamp, col bool)
#sql_error create table tb (ts timestamp, col bool) #sql_error create table tb (ts timestamp, col bool)
print table_already_exists test passed print table_already_exists test passed
...@@ -179,7 +181,7 @@ print table_already_exists test passed ...@@ -179,7 +181,7 @@ print table_already_exists test passed
sql drop database $db sql drop database $db
sql show databases sql show databases
if $rows != 0 then if $rows != 2 then
return -1 return -1
endi endi
......
...@@ -5,77 +5,72 @@ sql connect ...@@ -5,77 +5,72 @@ sql connect
print ========== db name and table name check in create and drop, describe print ========== db name and table name check in create and drop, describe
sql create database abc keep 36500 sql create database abc keep 36500
sql create database 'abc123' sql_error create database 'abc123'
sql create database '_ab1234' sql_error create database '_ab1234'
sql create database 'ABC123' sql_error create database 'ABC123'
sql create database '_ABC123' sql_error create database '_ABC123'
sql_error create database 'aABb123 ' sql_error create database 'aABb123 '
sql_error create database ' xyz ' sql_error create database ' xyz '
sql_error create database ' XYZ ' sql_error create database ' XYZ '
sql use 'abc123' sql_error use 'abc123'
sql use '_ab1234' sql_error use '_ab1234'
sql use 'ABC123' sql_error use 'ABC123'
sql use '_ABC123' sql_error use '_ABC123'
sql_error use 'aABb123' sql_error use 'aABb123'
sql_error use ' xyz ' sql_error use ' xyz '
sql_error use ' XYZ ' sql_error use ' XYZ '
sql drop database 'abc123' sql_error drop database if exists 'abc123'
sql drop database '_ab1234' sql_error drop database if exists '_ab1234'
sql_error drop database 'ABC123' sql_error drop database if exists 'ABC123'
sql drop database '_ABC123' sql_error drop database if exists '_ABC123'
sql_error drop database 'aABb123' sql_error drop database if exists 'aABb123'
sql_error drop database ' xyz ' sql_error drop database if exists ' xyz '
sql_error drop database ' XYZ ' sql_error drop database if exists ' XYZ '
sql use abc sql use abc
sql create table abc.cc (ts timestamp, c int) sql create table abc.cc (ts timestamp, c int)
sql create table 'abc.Dd' (ts timestamp, c int) sql_error create table 'abc.Dd' (ts timestamp, c int)
sql create table 'abc'.ee (ts timestamp, c int) sql_error create table 'abc'.ee (ts timestamp, c int)
sql create table 'abc'.'FF' (ts timestamp, c int) sql_error create table 'abc'.'FF' (ts timestamp, c int)
sql create table abc.'gG' (ts timestamp, c int) sql_error create table abc.'gG' (ts timestamp, c int)
sql_error create table table.'a1' (ts timestamp, c int) sql_error create table table.'a1' (ts timestamp, c int)
sql_error create table 'table'.'b1' (ts timestamp, c int) sql_error create table 'table'.'b1' (ts timestamp, c int)
sql_error create table 'table'.'b1' (ts timestamp, c int) sql_error create table 'table'.'b1' (ts timestamp, c int)
sql create table mt (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 nchar(20), t3 binary(20), t4 bigint, t5 smallint, t6 double) sql create table mt (ts timestamp, c1 int, c2 bigint, c3 float, c4 double, c5 smallint, c6 tinyint, c7 bool, c8 binary(10), c9 nchar(10)) tags(t1 int, t2 nchar(20), t3 binary(20), t4 bigint, t5 smallint, t6 double)
sql create table sub_001 using mt tags ( 1 , 'tag_nchar' , 'tag_bianry' , 4 , 5 , 6.1 ) sql create table sub_001 using mt tags ( 1 , 'tag_nchar' , 'tag_bianry' , 4 , 5 , 6.1 )
sql_error create table sub_002 using mt tags( 2 , tag_nchar , tag_bianry , 4 , 5 , 6.2 ) sql_error create table sub_002 using mt tags( 2 , tag_nchar , tag_bianry , 4 , 5 , 6.2 )
sql insert into sub_dy_tbl using mt tags ( 3 , 'tag_nchar' , 'tag_bianry' , 4 , 5 , 6.3 ) values (now, 1, 2, 3.01, 4.02, 5, 6, true, 'binary_8', 'nchar_9') sql insert into sub_dy_tbl using mt tags ( 3 , 'tag_nchar' , 'tag_bianry' , 4 , 5 , 6.3 ) values (now, 1, 2, 3.01, 4.02, 5, 6, true, 'binary_8', 'nchar_9')
sql describe abc.cc sql describe abc.cc
sql describe 'abc.Dd' sql_error describe 'abc.Dd'
sql describe 'abc'.ee sql_error describe 'abc'.ee
sql describe 'abc'.'FF' sql_error describe 'abc'.'FF'
sql describe abc.'gG' sql_error describe abc.'gG'
sql describe cc sql describe cc
sql describe 'Dd' sql_error describe 'Dd'
sql describe ee sql_error describe ee
sql describe 'FF' sql_error describe 'FF'
sql describe 'gG' sql_error describe 'gG'
sql describe mt sql describe mt
sql describe sub_001 sql describe sub_001
sql describe sub_dy_tbl sql describe sub_dy_tbl
sql describe Dd sql_error describe Dd
sql describe FF sql_error describe FF
sql describe gG sql_error describe gG
sql drop table abc.cc sql drop table abc.cc
sql drop table 'abc.Dd' sql_error drop table 'abc.Dd'
sql drop table 'abc'.ee sql_error drop table 'abc'.ee
sql drop table 'abc'.'FF' sql_error drop table 'abc'.'FF'
sql drop table abc.'gG' sql_error drop table abc.'gG'
sql drop table sub_001 sql drop table sub_001
sql drop table sub_dy_tbl sql drop table sub_dy_tbl
sql drop table mt sql drop table mt
......
...@@ -73,11 +73,10 @@ if $rows != 6 then ...@@ -73,11 +73,10 @@ if $rows != 6 then
return -1 return -1
endi endi
### select distinct ### select distinct
sql drop database $db sql drop database $db
sql show databases sql show databases
if $rows != 0 then if $rows != 2 then
return -1 return -1
endi endi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册