Bug #5784 | Unable to drop table, error 1051 | ||
---|---|---|---|
Submitted: | 28 Sep 2004 11:49 | Modified: | 12 Oct 2004 15:50 |
Reporter: | Egor Egorov | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 4.0.21 | OS: | Linux (Linux) |
Assigned to: | Ingo Strüwing | CPU Architecture: | Any |
[28 Sep 2004 11:49]
Egor Egorov
[2 Oct 2004 22:55]
MySQL Verification Team
Tested against latest BK source on Linux and Windows.
[12 Oct 2004 15:18]
Ingo Strüwing
The innodb table handler converts the innobase error code DB_CANNOT_DROP_CONSTRAINT to the MySQL error code HA_ERR_CANNOT_ADD_FOREIGN. This code is not handled in the DROP code and mapped to ER_BAD_TABLE_ERROR. Changing the handler conversion to HA_ERR_ROW_IS_REFERENCED makes the DROP code noticing the constraint. But the eror message is now: ERROR 1217: Cannot delete or update a parent row: a foreign key constraint fails. This is better, but may still be confusing. I need feedback on this from the bug reporter.
[12 Oct 2004 15:20]
Egor Egorov
In my personal opinion, if this error gives gives a clue on what to look at (and it does!) - it is okay. Here it is clear that the problem is in constraints. The error messages directs user to look at them.
[12 Oct 2004 15:50]
Ingo Strüwing
Fixed and pushed in 4.0.22 by Heikki Tuuri.