Bug #45163 Behavior different then expected from manual - ALTER w/ FK
| Submitted: | 28 May 2009 15:10 | Modified: | 18 Feb 2014 15:53 |
|---|---|---|---|
| Reporter: | Lig Isler-Turmelle | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
| Version: | 5.1.30, 5.0.70 | OS: | Any |
| Assigned to: | Daniel Price | CPU Architecture: | Any |
[28 May 2009 15:10]
Lig Isler-Turmelle
[17 Jan 2014 14:51]
Marko Mäkelä
Posted by developer: This seems to be a documentation issue. The ALTER TABLE...ADD/DROP FOREIGN KEY operations were overhauled in MySQL 5.6 by WL#5534 and WL#6251, which shipped with MySQL 5.6.8 or maybe a couple releases earlier. In some cases, ALTER TABLE...ALGORITHM=COPY could still issue unintuitive error messages, but the default ALGORITHM=INPLACE should work better. There are still some problems with DDL operations and FOREIGN KEY in MySQL 5.6, because the two data dictionaries can get out of sync: the InnoDB-internal one and the MySQL *.frm files. I tried the test case, and the DROP FOREIGN KEY, ADD FOREIGN KEY works with both ALGORITHM=INPLACE and ALGORITHM=COPY. This seems consistent to me.
[18 Feb 2014 15:53]
Daniel Price
The documentation has been updated to reflect that as of MySQL 5.6.6, adding and dropping a foreign key in the same ALTER TABLE statement is supported for ALTER TABLE ... ALGORITHM=INPLACE. http://dev.mysql.com/doc/refman/5.6/en/alter-table.html http://dev.mysql.com/doc/refman/5.7/en/alter-table.html While adding and dropping a foreign key in the same ALTER TABLE statement for ALGORITHM=COPY may work in some cases, it could still be problematic, and is therefore unsupported. Thank you for the bug report.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.061 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.