Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
10.8.3, 10.4(EOL), 10.5, 10.6, 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL)
Description
The error message we get for statements of the type "ALTER TABLE ... DROP CONSTRAINT ..., DROP col, DROP col" does not make sense. Example below.
create table t2(id int primary key); |
create table t1(id int primary key, t2_id int, constraint t1_fk_t2_id foreign key(t2_id) references t2(id)); |
Then try to drop the constraint and the t2_id column from table t1, but accidentally give two "drop t2_id" clauses.
alter table t1 drop constraint t1_fk_t2_id, drop t2_id, drop t2_id; |
ERROR 1091 (42000): Can't DROP COLUMN `t1_fk_t2_id`; check that it exists |
This not a sensible or correct error message. I would have expected the error message to refer to column t2_id rather than a non-existing column with an identical name to the constraint we're trying to drop.
I tested this on MariaDB Server 10.8.3 (with a newer mariadb client), but suspect it's present in newer versions as well.