alterInCurrent.sim 2.1 KB
Newer Older
D
dapan1121 已提交
1 2 3 4 5 6 7 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 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1

print ========= start dnode1 as LEADER
system sh/exec.sh -n dnode1 -s start
sql connect

print ======== drop column in normal table
sql drop database if exists db1;
sql create database db1;
sql use db1;
sql create table t1 (ts timestamp, f1 int, f2 int);
sql insert into t1 values (1591060628000, 1, 2);
sql alter table t1 drop column f2;
sql insert into t1 values (1591060628001, 2);

print ======== add column in normal table
sql drop database db1;
sql create database db1;
sql use db1;
sql create table t1 (ts timestamp, f1 int);
sql insert into t1 values (1591060628000, 1);
sql alter table t1 add column f2 int;
sql insert into t1 values (1591060628001, 2, 2);


print ======== drop column in super table
sql drop database db1;
sql create database db1;
sql use db1;
sql create stable st1 (ts timestamp, f1 int, f2 int) tags (t1 int);
sql create table t1 using st1 tags(1);
sql insert into t1 values (1591060628000, 1, 2);
sql alter table st1 drop column f2;
sql insert into t1 values (1591060628001, 2);


print ======== add column in super table
sql drop database db1;
sql create database db1;
sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags (t1 int);
sql create table t1 using st1 tags(1);
sql insert into t1 values (1591060628000, 1);
sql alter table st1 add column f2 int;
sql insert into t1 values (1591060628001, 2, 2);


print ======== add tag in super table
sql drop database db1;
sql create database db1;
sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags (t1 int);
sql create table t1 using st1 tags(1);
sql insert into t1 values (1591060628000, 1);
sql alter table st1 add tag t2 int;
sql create table t2 using st1 tags(2, 2);


print ======== drop tag in super table
sql drop database db1;
sql create database db1;
sql use db1;
sql create stable st1 (ts timestamp, f1 int) tags (t1 int, t2 int);
sql create table t1 using st1 tags(1, 1);
sql insert into t1 values (1591060628000, 1);
sql alter table st1 drop tag t2;
sql create table t2 using st1 tags(2);

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