summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test34
1 files changed, 31 insertions, 3 deletions
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index 79a01d5e0c4..7f692f36f4e 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -269,15 +269,15 @@ drop table if exists t1, t2;
create table t1 (a int, b int, c int, d int, e int, f int, g int, h int,i int, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert ignore into t1 (a) values(1);
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X 19 X
show table status like 't1';
alter table t1 modify a int;
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X 19 X
show table status like 't1';
drop table t1;
create table t1 (a int not null, b int not null, c int not null, d int not null, e int not null, f int not null, g int not null, h int not null,i int not null, primary key (a,b,c,d,e,f,g,i,h)) engine=MyISAM;
insert ignore into t1 (a) values(1);
---replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X
+--replace_column 7 X 8 X 9 X 10 X 11 X 12 X 13 X 14 X 19 X
show table status like 't1';
drop table t1;
@@ -1882,6 +1882,34 @@ alter table t1 drop column a, drop index a;
show create table t1;
drop table t1;
+#
+# MDEV-14694 ALTER COLUMN IF EXISTS .. causes syntax error
+#
+
+create table t1 (i int);
+alter table t1 alter column if exists a set default 1;
+alter table t1 alter column if exists a drop default;
+show create table t1;
+drop table t1;
+
+--echo #
+--echo # MDEV-13508 Check that rename of columns changes defaults, virtual
+--echo # columns and constraints
+--echo #
+
+create table t1 (a int, b int, check(a>b));
+alter table t1 change column a b int, change column b a int;
+show create table t1;
+drop table t1;
+
+create table t1 (a int primary key, b int, c int default (a+b) check (a+b>0),
+ d int as (a+b),
+ key (b),
+ constraint test check (a+b > 1));
+alter table t1 change b new_b int not null, add column b char(1), add constraint new check (length(b) > 0);
+show create table t1;
+drop table t1;
+
--echo #
--echo # End of 10.2 tests
--echo #