1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

MDEV-11114 Cannot drop column referenced by CHECK constraint

SQL Standard behavior for DROP COLUMN xxx RESTRICT:
* If a constraint (UNIQUE or CHECK) uses only the dropped column,
  it's automatically dropped too. If it uses many columns - an error.
This commit is contained in:
Sergei Golubchik
2017-08-12 18:52:38 +02:00
parent 28ddc9b3bb
commit 04b288ae47
17 changed files with 121 additions and 200 deletions

View File

@@ -79,14 +79,6 @@ insert into t1(c1) values(1);
insert into t1(c1) values(2);
drop table t1;
#
# MDEV-11114 Cannot drop column referenced by CHECK constraint: Unknown column 'a' in 'virtual column function'
#
create table t1 (a int, b int, check(a>0));
--error ER_BAD_FIELD_ERROR
alter table t1 drop column a;
drop table t1;
#
# MDEV-11117 CHECK constraint fails on intermediate step of ALTER
#