Bug #23693 | Foreign key constraint againts inexistent table won't show meaningful error | ||
---|---|---|---|
Submitted: | 26 Oct 2006 22:01 | Modified: | 4 Sep 2019 18:54 |
Reporter: | Antonio Ognio | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S4 (Feature request) |
Version: | OS: | Any (Any) | |
Assigned to: | CPU Architecture: | Any | |
Tags: | constraint, error, foreign key |
[26 Oct 2006 22:01]
Antonio Ognio
[30 Oct 2006 14:53]
Valeriy Kravchuk
Thank you for a reasonable feature request.
[7 Mar 2007 5:51]
Valeriy Kravchuk
Bug #26848 is a duplicate of this one.
[5 Oct 2008 11:54]
Konstantin Osipov
Dmitri, could you please go over all feature requests in foreign keys and close those that are fixed by WL#148?
[4 Sep 2019 9:57]
Dmitry Lenev
Posted by developer: Hello! The error message which is emitted when we attempt to create a foreign key referencing non-existing table has been improved as part of fix for bug#25722927 "NEWDD FK: ALTER TABLE CHANGE COLUMN TYPE SHOULD CHECK FK CONSTRAINT" which was published in 8.0.14. The new error message which is emitted in this case looks like: ERROR 1824 (HY000): Failed to open the referenced table 'no_such_table' Moving this request to Documenting state to let Documentation Team to decide if any documentation/release notes need to be updated.
[4 Sep 2019 18:54]
Daniel Price
Posted by developer: Addressed by the fix for Bug#25722927. The changelog entry for Bug#25722927 (8.0.14) was revised to also mention the fix for this bug report: A check that ensures compatibility of referencing and referenced column types in a foreign key definition was moved from the storage engine layer to the SQL layer. In addition, a better error message is produced when columns are not compatible, and when a foreign key constraint references a table that does not exist.