From 12d5307e95687e543f80aa3e8636a2ab8b96fe8d Mon Sep 17 00:00:00 2001 From: Monty Date: Sat, 10 Feb 2018 14:24:15 +0200 Subject: MDEV-13508 ALTER TABLE that renames columns and CHECK constraints Fixed by adding Item::rename_fields_processor Signed-off-by: Monty --- mysql-test/t/alter_table.test | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'mysql-test/t/alter_table.test') diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index 79a01d5e0c4..63d24c0740d 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -1882,6 +1882,24 @@ alter table t1 drop column a, drop index a; 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 # -- cgit v1.2.1