[MDEV-17579] DROP CONSTRAINT implementation is incomplete Created: 2018-10-31  Updated: 2019-03-04  Resolved: 2019-03-04

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Fix Version/s: 10.2.22, 10.3.13

Type: Task Priority: Minor
Reporter: Federico Razzoli Assignee: Alexey Botchkov
Resolution: Fixed Votes: 0
Labels: CONSTRAINT, SQL

Issue Links:
Duplicate
is duplicated by MDEV-17599 ALTER TABLE DROP CONSTRAINT does not ... Closed

 Description   

In ALTER TABLE, the ADD CONSTRAINT clause can be used to add unique indexes, foreign keys and checks, associating a constraint name to those objects. DROP CONSTRAINT can only drop checks.

If I try to drop a constraint which is a unique index or a foreign key, the error message suggests that it may not exist, and doesn't suggest that I may need to use a different syntax to drop that constraint:

ERROR 1091 (42000): Can't DROP CONSTRAINT `unq_title`; check that it exists

While historical users may know that DROP CONSTRAINT syntax didn't exist in the past and has been implemented for checks, for new users this is confusing and will surely look like a bug.


Generated at Thu Feb 08 08:37:32 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.