alter_stable.sim 1.7 KB
Newer Older
S
slguan 已提交
1
system sh/stop_dnodes.sh
S
slguan 已提交
2 3

system sh/deploy.sh -n dnode1 -i 1
4
system sh/cfg.sh -n dnode1 -c walLevel -v 1
S
slguan 已提交
5
system sh/exec.sh -n dnode1 -s start
H
Haojun Liao 已提交
6
sleep 100
S
slguan 已提交
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
sql connect

print ========== alter_stable.sim

$db = demodb
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
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_error create table mtx1 (ts timestamp, c1 int) tags (123 int)

25
sql_error create table mt2 (ts timestamp, c1 int) tags (abc012345678901234567890123456789012345678901234567890123456789def int)
S
slguan 已提交
26 27 28 29 30 31 32 33 34 35 36 37
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

# case-2 set tag value
sql create table mt4 (ts timestamp, c1 int) tags (name binary(16), len int)
sql create table tb1 using mt4 tags ("beijing", 100)
sql alter table tb1 set tag name = "shanghai"
sql alter table tb1 set tag name = ""
sql alter table tb1 set tag name = "shenzhen"
sql alter table tb1 set tag len = 379

38 39 40
# 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);
S
slguan 已提交
41 42 43
# test end   
sql drop database $db

44
system sh/exec.sh -n dnode1 -s stop -x SIGINT