Bug #60633 | Error too generic when using a fk name which exists | ||
---|---|---|---|
Submitted: | 25 Mar 2011 10:31 | Modified: | 4 Sep 2019 18:06 |
Reporter: | Cyril SCETBON | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 5.5.9 | OS: | Linux (ubuntu lucid x86) |
Assigned to: | CPU Architecture: | Any | |
Tags: | fk, innodb |
[25 Mar 2011 10:31]
Cyril SCETBON
[25 Mar 2011 12:15]
Sveta Smirnova
Thank you for the report. Verified as described. Can be considered as feature request though.
[14 Apr 2011 9:38]
Cyril SCETBON
I don't really think it can be considered as a feature request. It should be part of the error handling code
[4 Sep 2019 11:20]
Dmitry Lenev
Posted by developer: Hello! Situation with error code and message reported when one tries to create foreign key with an existing name has been somewhat improved in 5.6 and 5.7 versions of server. Depending on situation errors like: 1823: Failed to add the foreign key constraint 'test/c' to system tables 1022: Can't write; duplicate key in table 't3' 1826: Duplicate foreign key constraint name 'test/c' are reported in them. In MySQL 8.0 we store information about foreign keys in SQL-layer data-dictionary and do much of foreign key handling in DDL statements on SQL-layer as well. So we now consistently use: 1826 : Duplicate foreign key constraint name 'c' error message in such situations. Taking into account the above I am closing these request as fulfilled in 8.0.3. Moving it to Documenting state to let Documentation Team to decide if anything needs to be updated in our manual.
[4 Sep 2019 18:06]
Daniel Price
Posted by developer: Fixed as of the upcoming 8.0.3 release, and here's the changelog entry: The error messages reported when attempting to use an existing foreign key constraint name were inconsistent and did not always provide sufficient information.