summaryrefslogtreecommitdiff
path: root/mysql-test/t/alter_table.test
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-02-10 14:24:15 +0200
committerMonty <monty@mariadb.org>2018-02-10 14:32:24 +0200
commit12d5307e95687e543f80aa3e8636a2ab8b96fe8d (patch)
treea319f422364e0e9ba03d18aac0d203611e1f11db /mysql-test/t/alter_table.test
parent7beaa5e34e1fc4a3987351f41b0f0ed1329aeb25 (diff)
downloadmariadb-git-12d5307e95687e543f80aa3e8636a2ab8b96fe8d.tar.gz
MDEV-13508 ALTER TABLE that renames columns and CHECK constraints
Fixed by adding Item::rename_fields_processor Signed-off-by: Monty <monty@mariadb.org>
Diffstat (limited to 'mysql-test/t/alter_table.test')
-rw-r--r--mysql-test/t/alter_table.test18
1 files changed, 18 insertions, 0 deletions
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
@@ -1883,5 +1883,23 @@ 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 #