| Bug #5784 | Unable to drop table, error 1051 | ||
|---|---|---|---|
| Submitted: | 28 Sep 2004 13:49 | Modified: | 12 Oct 2004 17:50 |
| Reporter: | Egor Egorov | ||
| Status: | Closed | ||
| Category: | Server | Severity: | S2 (Serious) |
| Version: | 4.0.21 | OS: | Linux (Linux) |
| Assigned to: | Ingo Strüwing | Target Version: | |
[28 Sep 2004 13:49]
Egor Egorov
[3 Oct 2004 0:55]
Miguel Solorzano
Tested against latest BK source on Linux and Windows.
[12 Oct 2004 17: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 17: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 17:50]
Ingo Strüwing
Fixed and pushed in 4.0.22 by Heikki Tuuri.
