Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL)
-
None
Description
If a column check is defined as a separate constraint (not as a part of a column definition), the column cannot be dropped:
MariaDB [test]> create table t1 (a int, b int, check(a>0)); |
Query OK, 0 rows affected (0.63 sec) |
|
MariaDB [test]> show create table t1 \G |
*************************** 1. row ***************************
|
Table: t1 |
Create Table: CREATE TABLE `t1` ( |
`a` int(11) DEFAULT NULL, |
`b` int(11) DEFAULT NULL, |
CONSTRAINT `CONSTRAINT_1` CHECK (a>0) |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
1 row in set (0.00 sec) |
|
MariaDB [test]> alter table t1 drop column a; |
ERROR 1054 (42S22): Unknown column 'a' in 'virtual column function' |
Attachments
Issue Links
- causes
-
MDEV-14738 Replication breaks when dropping a column of a combined primary key (with a confusing error message)
- Confirmed
- relates to
-
MDEV-13508 ALTER TABLE that renames columns and CHECK constraints
- Closed
-
MDEV-7563 Support CHECK constraint as in (or close to) SQL Standard
- Closed
-
MDEV-13613 Dropping column from table that is part of a key fails in 10.2.8
- Closed
-
MDEV-21097 Incorrect error message when trying to delete column which is part of unique key constraint
- Closed
-
MDEV-24690 Dropping primary key column from versioned table always fails with 1072
- Closed