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

test: restore some 2.0 cases

上级 742fb1e5
......@@ -82,11 +82,11 @@
./test.sh -f tsim/insert/update0.sim
# ---- parser
# ./test.sh -f tsim/parser/alter.sim
# ./test.sh -f tsim/parser/alter1.sim
## ./test.sh -f tsim/parser/alter__for_community_version.sim
## ./test.sh -f tsim/parser/alter_column.sim
# ./test.sh -f tsim/parser/alter_stable.sim
./test.sh -f tsim/parser/alter.sim
# nojira ./test.sh -f tsim/parser/alter1.sim
./test.sh -f tsim/parser/alter__for_community_version.sim
./test.sh -f tsim/parser/alter_column.sim
./test.sh -f tsim/parser/alter_stable.sim
# ./test.sh -f tsim/parser/auto_create_tb.sim
# ./test.sh -f tsim/parser/auto_create_tb_drop_tb.sim
# ./test.sh -f tsim/parser/between_and.sim
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
$dbPrefix = m_alt_db
......@@ -40,62 +37,61 @@ sql_error alter database $db keep 20,20,20,20
sql_error alter database $db keep 365001,365001,365001
sql alter database $db keep 21
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 21,21,21 then
if $data27 != 30240m,30240m,30240m then
return -1
endi
sql alter database $db keep 11,12
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 11,12,12 then
if $data27 != 15840m,17280m,17280m then
return -1
endi
sql alter database $db keep 20,20,20
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 20,20,20 then
if $data27 != 28800m,28800m,28800m then
return -1
endi
sql alter database $db keep 10,10,10
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 10,10,10 then
if $data27 != 14400m,14400m,14400m then
return -1
endi
sql alter database $db keep 10,10,11
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 10,10,11 then
if $data27 != 14400m,14400m,15840m then
return -1
endi
sql alter database $db keep 11,12,13
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 11,12,13 then
if $data27 != 15840m,17280m,18720m then
return -1
endi
sql alter database $db keep 365000,365000,365000
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 365000,365000,365000 then
if $data27 != 525600000m,525600000m,525600000m then
return -1
endi
##### alter table test, simeplest case
sql create table tb (ts timestamp, c1 int, c2 int, c3 int)
sql insert into tb values (now, 1, 1, 1)
......@@ -187,7 +183,6 @@ endi
sql drop table tb
sql drop table mt
sleep 100
### ALTER TABLE WHILE STREAMING [TBASE271]
#sql create table tb1 (ts timestamp, c1 int, c2 nchar(5), c3 int)
#sql create table strm as select count(*), avg(c1), first(c2), sum(c3) from tb1 interval(2s)
......@@ -195,9 +190,9 @@ sleep 100
#if $rows != 0 then
# return -1
#endi
##sleep 12000
#sql insert into tb1 values (now, 1, 'taos', 1)
#sleep 20000
#sql select * from strm
#print rows = $rows
#if $rows != 1 then
......@@ -207,9 +202,9 @@ sleep 100
# return -1
#endi
#sql alter table tb1 drop column c3
#sleep 500
#sql insert into tb1 values (now, 2, 'taos')
#sleep 30000
#sql select * from strm
#if $rows != 2 then
# return -1
......@@ -218,9 +213,9 @@ sleep 100
# return -1
#endi
#sql alter table tb1 add column c3 int
#sleep 500
#sql insert into tb1 values (now, 3, 'taos', 3);
#sleep 100
#sql select * from strm
#if $rows != 3 then
# return -1
......@@ -259,7 +254,7 @@ sql create database $db
sql use $db
sql create table mt (ts timestamp, c1 int, c2 nchar(7), c3 int) tags (t1 int)
sql create table tb using mt tags(1)
sleep 100
sql insert into tb values ('2018-11-01 16:30:00.000', 1, 'insert', 1)
sql alter table mt drop column c3
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
sql reset query cache
$dbPrefix = alt1_db
......@@ -87,9 +83,8 @@ if $data13 != NULL then
return -1
endi
sleep 100
print ================== insert values into table
sql insert into car1 values (now, 1, 1,1 ) (now +1s, 2,2,2,) car2 values (now, 1,3,3)
sql insert into car1 values (now, 1, 1,1 ) (now +1s, 2,2,2) car2 values (now, 1,3,3)
sql select c1+speed from stb where c1 > 0
if $rows != 3 then
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
$dbPrefix = m_alt_db
......@@ -23,10 +20,10 @@ sql drop database if exists $db
sql create database $db duration 10 keep 20
sql use $db
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 20 then
if $data27 != 28800m,28800m,28800m then
return -1
endi
......@@ -47,44 +44,44 @@ sql_error alter database $db keep 20,19,18
sql_error alter database $db keep 20,20,20,20
sql_error alter database $db keep 365001,365001,365001
sql_error alter database $db keep 365001
sql alter database $db keep 20
sql_error alter database $db keep 20
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 20 then
if $data27 != 28800m,28800m,28800m then
return -1
endi
sql alter database $db keep 10
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 10 then
if $data27 != 14400m,14400m,14400m then
return -1
endi
sql alter database $db keep 11
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 11 then
if $data27 != 15840m,15840m,15840m then
return -1
endi
sql alter database $db keep 13
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 13 then
if $data27 != 18720m,18720m,18720m then
return -1
endi
sql alter database $db keep 365000
sql show databases
if $rows != 1 then
if $rows != 3 then
return -1
endi
if $data07 != 365000 then
if $data27 != 525600000m,525600000m,525600000m then
return -1
endi
......@@ -180,7 +177,6 @@ endi
sql drop table tb
sql drop table mt
sleep 100
### ALTER TABLE WHILE STREAMING [TBASE271]
#sql create table tb1 (ts timestamp, c1 int, c2 nchar(5), c3 int)
#sql create table strm as select count(*), avg(c1), first(c2), sum(c3) from tb1 interval(2s)
......@@ -188,9 +184,7 @@ sleep 100
#if $rows != 0 then
# return -1
#endi
##sleep 12000
#sql insert into tb1 values (now, 1, 'taos', 1)
#sleep 20000
#sql select * from strm
#print rows = $rows
#if $rows != 1 then
......@@ -200,9 +194,7 @@ sleep 100
# return -1
#endi
#sql alter table tb1 drop column c3
#sleep 500
#sql insert into tb1 values (now, 2, 'taos')
#sleep 30000
#sql select * from strm
#if $rows != 2 then
# return -1
......@@ -211,9 +203,7 @@ sleep 100
# return -1
#endi
#sql alter table tb1 add column c3 int
#sleep 500
#sql insert into tb1 values (now, 3, 'taos', 3);
#sleep 100
#sql select * from strm
#if $rows != 3 then
# return -1
......@@ -252,7 +242,6 @@ sql create database $db
sql use $db
sql create table mt (ts timestamp, c1 int, c2 nchar(7), c3 int) tags (t1 int)
sql create table tb using mt tags(1)
sleep 100
sql insert into tb values ('2018-11-01 16:30:00.000', 1, 'insert', 1)
sql alter table mt drop column c3
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
$dbPrefix = m_alt_db
......@@ -26,51 +23,20 @@ sql use $db
sql create table tb (ts timestamp, c1 int, c2 binary(10), c3 nchar(10))
sql insert into tb values (now, 1, "1", "1")
sql alter table tb modify column c2 binary(20);
if $rows != 0 then
return -1
endi
sql alter table tb modify column c3 nchar(20);
if $rows != 0 then
return -1
endi
sql create stable stb (ts timestamp, c1 int, c2 binary(10), c3 nchar(10)) tags(id1 int, id2 binary(10), id3 nchar(10))
sql create table tb1 using stb tags(1, "a", "b")
sql insert into tb1 values (now, 1, "1", "1")
sql alter stable stb modify column c2 binary(20);
if $rows != 0 then
return -1
endi
sql alter table stb modify column c2 binary(30);
if $rows != 0 then
return -1
endi
sql alter stable stb modify column c3 nchar(20);
if $rows != 0 then
return -1
endi
sql alter table stb modify column c3 nchar(30);
if $rows != 0 then
return -1
endi
sql alter table stb modify tag id2 binary(11);
if $rows != 0 then
return -1
endi
sql alter stable stb modify tag id2 binary(11);
if $rows != 0 then
return -1
endi
sql_error alter stable stb modify tag id2 binary(11);
sql alter table stb modify tag id3 nchar(11);
if $rows != 0 then
return -1
endi
sql alter stable stb modify tag id3 nchar(11);
if $rows != 0 then
return -1
endi
sql_error alter stable stb modify tag id3 nchar(11);
##### ILLEGAL OPERATIONS
......@@ -82,14 +48,14 @@ sql_error alter table tb modify column c2 binary(10);
sql_error alter table tb modify column c2 binary(9);
sql_error alter table tb modify column c2 binary(-9);
sql_error alter table tb modify column c2 binary(0);
sql_error alter table tb modify column c2 binary(17000);
sql alter table tb modify column c2 binary(17000);
sql_error alter table tb modify column c2 nchar(30);
sql_error alter table tb modify column c3 double;
sql_error alter table tb modify column c3 nchar(10);
sql_error alter table tb modify column c3 nchar(0);
sql_error alter table tb modify column c3 nchar(-1);
sql_error alter table tb modify column c3 binary(80);
sql_error alter table tb modify column c3 nchar(17000);
sql alter table tb modify column c3 nchar(17000);
sql_error alter table tb modify column c3 nchar(100), c2 binary(30);
sql_error alter table tb modify column c1 nchar(100), c2 binary(30);
sql_error alter stable tb modify column c2 binary(30);
......
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/cfg.sh -n dnode1 -c walLevel -v 1
system sh/exec.sh -n dnode1 -s start
sleep 100
sql connect
print ========== alter_stable.sim
......@@ -13,19 +10,19 @@ sql drop database if exists $db
sql create database $db
sql use $db
##### alter stable test : change tag name
# case-1 change tag name: new name inclue old name
##### alter stable test : rename tag name
# case-1 rename tag name: new name inclue old name
sql create table mt1 (ts timestamp, c1 int) tags (a int)
sql alter table mt1 change tag a abcd
sql alter table mt1 change tag abcd a
sql_error alter table mt1 change tag a 1
sql alter table mt1 rename tag a abcd
sql alter table mt1 rename tag abcd a
sql_error alter table mt1 rename tag a 1
sql_error create table mtx1 (ts timestamp, c1 int) tags (123 int)
sql_error create table mt2 (ts timestamp, c1 int) tags (abc012345678901234567890123456789012345678901234567890123456789def int)
sql create table mt3 (ts timestamp, c1 int) tags (abc012345678901234567890123456789012345678901234567890123456789 int)
sql_error alter table mt3 change tag abc012345678901234567890123456789012345678901234567890123456789 abcdefg012345678901234567890123456789012345678901234567890123456789
sql alter table mt3 change tag abc012345678901234567890123456789012345678901234567890123456789 abcdefg0123456789012345678901234567890123456789
sql_error alter table mt3 rename tag abc012345678901234567890123456789012345678901234567890123456789 abcdefg012345678901234567890123456789012345678901234567890123456789
sql alter table mt3 rename tag abc012345678901234567890123456789012345678901234567890123456789 abcdefg0123456789012345678901234567890123456789
# case-2 set tag value
sql create table mt4 (ts timestamp, c1 int) tags (name binary(16), len int)
......@@ -37,7 +34,7 @@ sql alter table tb1 set tag len = 379
# case TD-5594
sql create stable st5520(ts timestamp, f int) tags(t0 bool, t1 nchar(4093), t2 nchar(1))
sql_error alter stable st5520 modify tag t2 nchar(2);
sql alter stable st5520 modify tag t2 nchar(2);
# test end
sql drop database $db
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册