Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2(EOL)
Description
If a column is renamed, CHECK constraint isn't changed to use the new column name. But UNIQUE constraint is.
create table t1 (a int, b int, check(a>b)); |
alter table t1 change column a b int, change column b a int; |
show create table t1; |
Compare with
create table t1 (a int, b int, unique(a,b)); |
alter table t1 change column a b int, change column b a int; |
show create table t1; |
Attachments
Issue Links
- is duplicated by
-
MDEV-16161 Syntax error reserverd keyword
-
- Closed
-
- relates to
-
MDEV-11114 Cannot drop column referenced by CHECK constraint
-
- Closed
-
-
MDEV-22881 Unexpected errors, corrupt output, Valgrind / ASAN errors in Item_ident::print or append_identifier
-
- Closed
-
note also as in
MDEV-11114this prevents the column from being renamed in most cases:MariaDB [test]> create table t1 (a int, check (a in (0, 1)));
Query OK, 0 rows affected (0.03 sec)
MariaDB [test]> alter table t1 change column a b int;
ERROR 1054 (42S22): Unknown column 'a' in 'CHECK'