1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-12421 Check constraint with query crashes server and renders DB unusable

parse CHECK constraint *before* Column_definition validity checks
This commit is contained in:
Sergei Golubchik
2017-04-01 15:58:29 +02:00
parent 6315426565
commit 22d8bb2706
3 changed files with 17 additions and 3 deletions

View File

@ -140,3 +140,7 @@ 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 table t1 (a int check (@b in (select user from mysql.user)));
ERROR HY000: Function or expression 'select ...' cannot be used in the CHECK clause of `a`
create table t1 (a int check (a > @b));
ERROR HY000: Function or expression '@b' cannot be used in the CHECK clause of `a`