mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -136,10 +136,6 @@ insert into t1(c1) values(1);
|
||||
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
|
||||
insert into t1(c1) values(2);
|
||||
drop table t1;
|
||||
create table t1 (a int, b int, check(a>0));
|
||||
alter table t1 drop column a;
|
||||
ERROR 42S22: Unknown column 'a' in 'CHECK'
|
||||
drop table t1;
|
||||
create or replace table t1( c1 int auto_increment primary key, check( c1 > 0 or c1 is null ) );
|
||||
ERROR HY000: Function or expression 'AUTO_INCREMENT' cannot be used in the CHECK clause of `c1`
|
||||
create table t1 (a int check (@b in (select user from mysql.user)));
|
||||
|
Reference in New Issue
Block a user