1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-24601: INFORMATION_SCHEMA doesn't differentiate between column and table-level CHECK constraints

- Reviewed by: wlad@mariadb.com
This commit is contained in:
Anel Husakovic
2021-03-16 12:03:41 +01:00
parent 8cbada87f0
commit 825c0e2abe
5 changed files with 129 additions and 61 deletions

View File

@ -118,3 +118,24 @@ SELECT * FROM information_schema.check_constraints;
DROP USER foo;
DROP DATABASE db;
--echo #
--echo # MDEV-24601: INFORMATION_SCHEMA doesn't differentiate between
--echo # column and table-level CHECK constraints
--echo #
# Mix of table (>0) and field (<0) constraints
# Note that there are 2 constraints `t2` - this is not allowed MDEV-24601
use test;
create table t(check (t0>0),
t0 int,
t1 int check (t1<0),
t2 int check (t2<-1),
CONSTRAINT tc_1 check(t1 > 1),
CONSTRAINT t2 check(t2 > 1));
show create table t;
--sorted_result
select * from information_schema.table_constraints where CONSTRAINT_TYPE='CHECK';
--sorted_result
select * from information_schema.check_constraints;
drop table t;