Bug #67385 | Alter table to add FK fails when table has specific name | ||
---|---|---|---|
Submitted: | 26 Oct 2012 13:58 | Modified: | 12 Apr 2019 15:11 |
Reporter: | Jonathan Amend | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
Version: | 5.5.28, 5.5.29, 5.7.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[26 Oct 2012 13:58]
Jonathan Amend
[26 Oct 2012 14:13]
Peter Laursen
Repeatable for me on Win7. Replacing table identifier 'agency' with 'agent' resolves the problem. Peter (not a MySQL/Oracle person)
[13 Nov 2012 20:23]
Sveta Smirnova
Thank you for the report. Verified as described.
[28 Nov 2012 9:19]
Jimmy Yang
The "ALTER TABLE agency ADD FOREIGN KEY FK_agency_country_Name(defaultCountry) REFERENCES country(name);" will generate a constraint ID of "test/agency_ibfk_1", which conflicts with the constraint name already existed in table agency. This is partly explained in: 121026 9:38:32 InnoDB: Error; possible reasons: InnoDB: 1) Table rename would cause two FOREIGN KEY constraints InnoDB: to have the same internal name in case-insensitive comparison.
[12 Apr 2019 14:46]
Dmitry Lenev
Posted by developer: Hello! After investigation I think that this bug has the same root as bug #19156435 / #72751 "CREATING FOREIGN KEY FAILS ON CASE-INSENSITIVE FILESYSTEM IN SOME CASES". Since the latter bug has a bit more explanations about why the problem occurs as well as another duplicate report associated with it I marking this bug as a duplicate of bug #19156435.