Skip to content

Commit 825c0e2

Browse files
committed
MDEV-24601: INFORMATION_SCHEMA doesn't differentiate between column and table-level CHECK constraints
- Reviewed by: wlad@mariadb.com
1 parent 8cbada8 commit 825c0e2

File tree

5 files changed

+129
-61
lines changed

5 files changed

+129
-61
lines changed

mysql-test/suite/funcs_1/r/is_check_constraints.result

Lines changed: 95 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,48 @@ CREATE TABLE t0
1616
t int, check (t>32) # table constraint
1717
) ENGINE=myisam;
1818
SELECT * from information_schema.check_constraints;
19-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
20-
def foo t0 CONSTRAINT_1 `t` > 32
19+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
20+
def foo t0 CONSTRAINT_1 Table `t` > 32
2121
ALTER TABLE t0
2222
ADD CONSTRAINT CHK_t0_t CHECK(t<100);
2323
SELECT * from information_schema.check_constraints;
24-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
25-
def foo t0 CHK_t0_t `t` < 100
26-
def foo t0 CONSTRAINT_1 `t` > 32
24+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
25+
def foo t0 CHK_t0_t Table `t` < 100
26+
def foo t0 CONSTRAINT_1 Table `t` > 32
2727
ALTER TABLE t0
2828
DROP CONSTRAINT CHK_t0_t;
2929
SELECT * from information_schema.check_constraints;
30-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
31-
def foo t0 CONSTRAINT_1 `t` > 32
30+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
31+
def foo t0 CONSTRAINT_1 Table `t` > 32
3232
ALTER TABLE t0
3333
ADD CONSTRAINT CHECK(t<50);
3434
SELECT * from information_schema.check_constraints;
35-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
36-
def foo t0 CONSTRAINT_1 `t` > 32
37-
def foo t0 CONSTRAINT_2 `t` < 50
35+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
36+
def foo t0 CONSTRAINT_1 Table `t` > 32
37+
def foo t0 CONSTRAINT_2 Table `t` < 50
3838
CREATE TABLE t1
3939
( t int CHECK(t>2), # field constraint
4040
tt int,
4141
CONSTRAINT CHECK (tt > 32), CONSTRAINT CHECK (tt <50),# autogenerated names table constraints
4242
CONSTRAINT CHK_tt CHECK(tt<100) # named table constraint
4343
) ENGINE=InnoDB;
4444
SELECT * from information_schema.check_constraints;
45-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
46-
def foo t0 CONSTRAINT_1 `t` > 32
47-
def foo t0 CONSTRAINT_2 `t` < 50
48-
def foo t1 CHK_tt `tt` < 100
49-
def foo t1 CONSTRAINT_1 `tt` > 32
50-
def foo t1 CONSTRAINT_2 `tt` < 50
51-
def foo t1 t `t` > 2
45+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
46+
def foo t0 CONSTRAINT_1 Table `t` > 32
47+
def foo t0 CONSTRAINT_2 Table `t` < 50
48+
def foo t1 CHK_tt Table `tt` < 100
49+
def foo t1 CONSTRAINT_1 Table `tt` > 32
50+
def foo t1 CONSTRAINT_2 Table `tt` < 50
51+
def foo t1 t Column `t` > 2
5252
ALTER TABLE t1
5353
DROP CONSTRAINT CHK_tt;
5454
SELECT * from information_schema.check_constraints;
55-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
56-
def foo t0 CONSTRAINT_1 `t` > 32
57-
def foo t0 CONSTRAINT_2 `t` < 50
58-
def foo t1 CONSTRAINT_1 `tt` > 32
59-
def foo t1 CONSTRAINT_2 `tt` < 50
60-
def foo t1 t `t` > 2
55+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
56+
def foo t0 CONSTRAINT_1 Table `t` > 32
57+
def foo t0 CONSTRAINT_2 Table `t` < 50
58+
def foo t1 CONSTRAINT_1 Table `tt` > 32
59+
def foo t1 CONSTRAINT_2 Table `tt` < 50
60+
def foo t1 t Column `t` > 2
6161
CREATE TABLE t2
6262
(
6363
name VARCHAR(30) CHECK(CHAR_LENGTH(name)>2), #field constraint
@@ -66,26 +66,26 @@ end_date DATE,
6666
CONSTRAINT CHK_dates CHECK(start_date IS NULL) #table constraint
6767
)ENGINE=Innodb;
6868
SELECT * from information_schema.check_constraints;
69-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
70-
def foo t0 CONSTRAINT_1 `t` > 32
71-
def foo t0 CONSTRAINT_2 `t` < 50
72-
def foo t1 CONSTRAINT_1 `tt` > 32
73-
def foo t1 CONSTRAINT_2 `tt` < 50
74-
def foo t1 t `t` > 2
75-
def foo t2 CHK_dates `start_date` is null
76-
def foo t2 name char_length(`name`) > 2
69+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
70+
def foo t0 CONSTRAINT_1 Table `t` > 32
71+
def foo t0 CONSTRAINT_2 Table `t` < 50
72+
def foo t1 CONSTRAINT_1 Table `tt` > 32
73+
def foo t1 CONSTRAINT_2 Table `tt` < 50
74+
def foo t1 t Column `t` > 2
75+
def foo t2 CHK_dates Table `start_date` is null
76+
def foo t2 name Column char_length(`name`) > 2
7777
ALTER TABLE t1
7878
ADD CONSTRAINT CHK_new_ CHECK(t>tt);
7979
SELECT * from information_schema.check_constraints;
80-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
81-
def foo t0 CONSTRAINT_1 `t` > 32
82-
def foo t0 CONSTRAINT_2 `t` < 50
83-
def foo t1 CHK_new_ `t` > `tt`
84-
def foo t1 CONSTRAINT_1 `tt` > 32
85-
def foo t1 CONSTRAINT_2 `tt` < 50
86-
def foo t1 t `t` > 2
87-
def foo t2 CHK_dates `start_date` is null
88-
def foo t2 name char_length(`name`) > 2
80+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
81+
def foo t0 CONSTRAINT_1 Table `t` > 32
82+
def foo t0 CONSTRAINT_2 Table `t` < 50
83+
def foo t1 CHK_new_ Table `t` > `tt`
84+
def foo t1 CONSTRAINT_1 Table `tt` > 32
85+
def foo t1 CONSTRAINT_2 Table `tt` < 50
86+
def foo t1 t Column `t` > 2
87+
def foo t2 CHK_dates Table `start_date` is null
88+
def foo t2 name Column char_length(`name`) > 2
8989
CREATE TABLE t3
9090
(
9191
a int,
@@ -95,22 +95,22 @@ CONSTRAINT b check (b>10), # table constraint
9595
CONSTRAINT b1 check (b<123456789012345678901234567890123456789012345678901234567890123456789)
9696
) ENGINE=InnoDB;
9797
SELECT * from information_schema.check_constraints;
98-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
99-
def foo t0 CONSTRAINT_1 `t` > 32
100-
def foo t0 CONSTRAINT_2 `t` < 50
101-
def foo t1 CHK_new_ `t` > `tt`
102-
def foo t1 CONSTRAINT_1 `tt` > 32
103-
def foo t1 CONSTRAINT_2 `tt` < 50
104-
def foo t1 t `t` > 2
105-
def foo t2 CHK_dates `start_date` is null
106-
def foo t2 name char_length(`name`) > 2
107-
def foo t3 b `b` > 0
108-
def foo t3 b `b` > 10
109-
def foo t3 b1 `b` < 123456789012345678901234567890123456789012345678901234567890123456789
98+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
99+
def foo t0 CONSTRAINT_1 Table `t` > 32
100+
def foo t0 CONSTRAINT_2 Table `t` < 50
101+
def foo t1 CHK_new_ Table `t` > `tt`
102+
def foo t1 CONSTRAINT_1 Table `tt` > 32
103+
def foo t1 CONSTRAINT_2 Table `tt` < 50
104+
def foo t1 t Column `t` > 2
105+
def foo t2 CHK_dates Table `start_date` is null
106+
def foo t2 name Column char_length(`name`) > 2
107+
def foo t3 b Column `b` > 0
108+
def foo t3 b Table `b` > 10
109+
def foo t3 b1 Table `b` < 123456789012345678901234567890123456789012345678901234567890123456789
110110
disconnect con1;
111111
CONNECT con2, localhost, boo2,, test;
112112
SELECT * from information_schema.check_constraints;
113-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
113+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
114114
disconnect con2;
115115
CONNECT con1, localhost, boo1,,foo;
116116
DROP TABLE t0;
@@ -136,16 +136,54 @@ Grants for foo@%
136136
GRANT USAGE ON *.* TO `foo`@`%`
137137
GRANT SELECT (a) ON `db`.`t1` TO `foo`@`%`
138138
SELECT * FROM information_schema.check_constraints;
139-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
140-
def db t1 CONSTRAINT_1 `b` > 0
141-
def mysql global_priv Priv json_valid(`Priv`)
139+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
140+
def db t1 CONSTRAINT_1 Table `b` > 0
141+
def mysql global_priv Priv Column json_valid(`Priv`)
142142
CONNECT con1,localhost, foo,, db;
143143
SELECT a FROM t1;
144144
a
145145
1
146146
2
147147
SELECT * FROM information_schema.check_constraints;
148-
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME CHECK_CLAUSE
148+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
149149
connection default;
150150
DROP USER foo;
151151
DROP DATABASE db;
152+
#
153+
# MDEV-24601: INFORMATION_SCHEMA doesn't differentiate between
154+
# column and table-level CHECK constraints
155+
#
156+
use test;
157+
create table t(check (t0>0),
158+
t0 int,
159+
t1 int check (t1<0),
160+
t2 int check (t2<-1),
161+
CONSTRAINT tc_1 check(t1 > 1),
162+
CONSTRAINT t2 check(t2 > 1));
163+
show create table t;
164+
Table Create Table
165+
t CREATE TABLE `t` (
166+
`t0` int(11) DEFAULT NULL,
167+
`t1` int(11) DEFAULT NULL CHECK (`t1` < 0),
168+
`t2` int(11) DEFAULT NULL CHECK (`t2` < -1),
169+
CONSTRAINT `CONSTRAINT_1` CHECK (`t0` > 0),
170+
CONSTRAINT `tc_1` CHECK (`t1` > 1),
171+
CONSTRAINT `t2` CHECK (`t2` > 1)
172+
) ENGINE=MyISAM DEFAULT CHARSET=latin1
173+
select * from information_schema.table_constraints where CONSTRAINT_TYPE='CHECK';
174+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
175+
def mysql Priv mysql global_priv CHECK
176+
def test CONSTRAINT_1 test t CHECK
177+
def test t1 test t CHECK
178+
def test t2 test t CHECK
179+
def test t2 test t CHECK
180+
def test tc_1 test t CHECK
181+
select * from information_schema.check_constraints;
182+
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA TABLE_NAME CONSTRAINT_NAME LEVEL CHECK_CLAUSE
183+
def mysql global_priv Priv Column json_valid(`Priv`)
184+
def test t CONSTRAINT_1 Table `t0` > 0
185+
def test t t1 Column `t1` < 0
186+
def test t t2 Column `t2` < -1
187+
def test t t2 Table `t2` > 1
188+
def test t tc_1 Table `t1` > 1
189+
drop table t;

mysql-test/suite/funcs_1/r/is_columns_is.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 N
2424
def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) select NEVER NULL
2525
def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) select NEVER NULL
2626
def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) select NEVER NULL
27-
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select NEVER NULL
27+
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext select NEVER NULL
2828
def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) select NEVER NULL
2929
def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
3030
def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
31+
def information_schema CHECK_CONSTRAINTS LEVEL 5 '' NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) select NEVER NULL
3132
def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) select NEVER NULL
3233
def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
3334
def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) select NEVER NULL
@@ -572,6 +573,7 @@ NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(
572573
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
573574
3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
574575
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
576+
3.0000 information_schema CHECK_CONSTRAINTS LEVEL varchar 6 18 utf8 utf8_general_ci varchar(6)
575577
1.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
576578
3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64)
577579
NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)

mysql-test/suite/funcs_1/r/is_columns_is_embedded.result

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@ def information_schema CHARACTER_SETS CHARACTER_SET_NAME 1 '' NO varchar 32 96 N
2424
def information_schema CHARACTER_SETS DEFAULT_COLLATE_NAME 2 '' NO varchar 32 96 NULL NULL NULL utf8 utf8_general_ci varchar(32) NEVER NULL
2525
def information_schema CHARACTER_SETS DESCRIPTION 3 '' NO varchar 60 180 NULL NULL NULL utf8 utf8_general_ci varchar(60) NEVER NULL
2626
def information_schema CHARACTER_SETS MAXLEN 4 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(3) NEVER NULL
27-
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 5 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext NEVER NULL
27+
def information_schema CHECK_CONSTRAINTS CHECK_CLAUSE 6 '' NO longtext 4294967295 4294967295 NULL NULL NULL utf8 utf8_general_ci longtext NEVER NULL
2828
def information_schema CHECK_CONSTRAINTS CONSTRAINT_CATALOG 1 '' NO varchar 512 1536 NULL NULL NULL utf8 utf8_general_ci varchar(512) NEVER NULL
2929
def information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME 4 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
3030
def information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA 2 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
31+
def information_schema CHECK_CONSTRAINTS LEVEL 5 '' NO varchar 6 18 NULL NULL NULL utf8 utf8_general_ci varchar(6) NEVER NULL
3132
def information_schema CHECK_CONSTRAINTS TABLE_NAME 3 '' NO varchar 64 192 NULL NULL NULL utf8 utf8_general_ci varchar(64) NEVER NULL
3233
def information_schema CLIENT_STATISTICS ACCESS_DENIED 22 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
3334
def information_schema CLIENT_STATISTICS BINLOG_BYTES_WRITTEN 9 0 NO bigint NULL NULL 19 0 NULL NULL NULL bigint(21) NEVER NULL
@@ -572,6 +573,7 @@ NULL information_schema CHARACTER_SETS MAXLEN bigint NULL NULL NULL NULL bigint(
572573
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_SCHEMA varchar 64 192 utf8 utf8_general_ci varchar(64)
573574
3.0000 information_schema CHECK_CONSTRAINTS TABLE_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
574575
3.0000 information_schema CHECK_CONSTRAINTS CONSTRAINT_NAME varchar 64 192 utf8 utf8_general_ci varchar(64)
576+
3.0000 information_schema CHECK_CONSTRAINTS LEVEL varchar 6 18 utf8 utf8_general_ci varchar(6)
575577
1.0000 information_schema CHECK_CONSTRAINTS CHECK_CLAUSE longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
576578
3.0000 information_schema CLIENT_STATISTICS CLIENT varchar 64 192 utf8 utf8_general_ci varchar(64)
577579
NULL information_schema CLIENT_STATISTICS TOTAL_CONNECTIONS bigint NULL NULL NULL NULL bigint(21)

mysql-test/suite/funcs_1/t/is_check_constraints.test

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,24 @@ SELECT * FROM information_schema.check_constraints;
118118

119119
DROP USER foo;
120120
DROP DATABASE db;
121+
122+
--echo #
123+
--echo # MDEV-24601: INFORMATION_SCHEMA doesn't differentiate between
124+
--echo # column and table-level CHECK constraints
125+
--echo #
126+
127+
# Mix of table (>0) and field (<0) constraints
128+
# Note that there are 2 constraints `t2` - this is not allowed MDEV-24601
129+
use test;
130+
create table t(check (t0>0),
131+
t0 int,
132+
t1 int check (t1<0),
133+
t2 int check (t2<-1),
134+
CONSTRAINT tc_1 check(t1 > 1),
135+
CONSTRAINT t2 check(t2 > 1));
136+
show create table t;
137+
--sorted_result
138+
select * from information_schema.table_constraints where CONSTRAINT_TYPE='CHECK';
139+
--sorted_result
140+
select * from information_schema.check_constraints;
141+
drop table t;

sql/sql_show.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6932,10 +6932,14 @@ static int get_check_constraints_record(THD *thd, TABLE_LIST *tables,
69326932
table->field[0]->store(STRING_WITH_LEN("def"), system_charset_info);
69336933
table->field[3]->store(check->name.str, check->name.length,
69346934
system_charset_info);
6935+
const char *tmp_buff;
6936+
tmp_buff= (check->get_vcol_type() == VCOL_CHECK_FIELD ?
6937+
"Column" : "Table");
6938+
table->field[4]->store(tmp_buff, strlen(tmp_buff), system_charset_info);
69356939
/* Make sure the string is empty between each print. */
69366940
str.length(0);
69376941
check->print(&str);
6938-
table->field[4]->store(str.ptr(), str.length(), system_charset_info);
6942+
table->field[5]->store(str.ptr(), str.length(), system_charset_info);
69396943
if (schema_table_store_record(thd, table))
69406944
DBUG_RETURN(1);
69416945
}
@@ -9508,6 +9512,7 @@ ST_FIELD_INFO check_constraints_fields_info[]=
95089512
Column("CONSTRAINT_SCHEMA", Name(), NOT_NULL, OPEN_FULL_TABLE),
95099513
Column("TABLE_NAME", Name(), NOT_NULL, OPEN_FULL_TABLE),
95109514
Column("CONSTRAINT_NAME", Name(), NOT_NULL, OPEN_FULL_TABLE),
9515+
Column("LEVEL", Varchar(6),NOT_NULL, OPEN_FULL_TABLE),
95119516
Column("CHECK_CLAUSE", Longtext(MAX_FIELD_VARCHARLENGTH),
95129517
NOT_NULL, OPEN_FULL_TABLE),
95139518
CEnd()
@@ -9524,7 +9529,7 @@ extern ST_FIELD_INFO optimizer_trace_info[];
95249529
} //namespace Show
95259530

95269531
/*
9527-
Description of ST_FIELD_INFO in table.h
9532+
Description of ST_FIELD_INFO in sql_i_s.h
95289533
95299534
Make sure that the order of schema_tables and enum_schema_tables are the same.
95309535

0 commit comments

Comments
 (0)