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

system sh/deploy.sh -n dnode1 -i 1
H
hjxilinx 已提交
4
system sh/cfg.sh -n dnode1 -c walLevel -v 0
H
hjxilinx 已提交
5
system sh/cfg.sh -n dnode1 -c tableMetaKeepTimer -v 3
S
slguan 已提交
6
system sh/exec.sh -n dnode1 -s start
H
Haojun Liao 已提交
7
sleep 500
S
slguan 已提交
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
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)

sql 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

# 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

# test end   
sql drop database $db

S
scripts  
Shengliang Guan 已提交
42
system sh/exec.sh -n dnode1 -s stop -x SIGINT