Bug #5574 | ALTER TABLE of InnoDB table causes data dictionary problem | ||
---|---|---|---|
Submitted: | 14 Sep 2004 16:58 | Modified: | 8 Apr 2005 21:00 |
Reporter: | Paul DuBois | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 4.0.21/4.1.5 (at least) | OS: | Any (all) |
Assigned to: | Marko Mäkelä | CPU Architecture: | Any |
[14 Sep 2004 16:58]
Paul DuBois
[16 Sep 2004 13:42]
MySQL Verification Team
Verified on the latest Bk 4.0/4.1/5.0 trees.
[7 Apr 2005 0:38]
Timothy Smith
Verified also on Windows XP & FreeBSD, 4.1.11 -- Timothy
[7 Apr 2005 5:24]
Heikki Tuuri
Marko, please prevent ALTER to MyISAM if the table is involved in FOREIGN KEY constraints. The ALTER confuses InnoDB's internal data dictionary. Regards, Heikki
[7 Apr 2005 10:03]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/internals/23747
[7 Apr 2005 10:17]
Marko Mäkelä
I've committed a fix that prevents ALTER TABLE from changing the storage engine from InnoDB if there are any foreign key constraints attached to the table.
[8 Apr 2005 21:00]
Marko Mäkelä
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release. If necessary, you can access the source repository and build the latest available version, including the bugfix, yourself. More information about accessing the source trees is available at http://www.mysql.com/doc/en/Installing_source_tree.html Additional info: The bug will be fixed in 4.1.12 and 5.0.5 or 5.0.4.
[19 May 2005 23:26]
Mark Junker
Hmm ... it seems that there is a change between 4.1.8-nt and 4.1.12-nt. It seems that a foreign key name must be (at least) unique across all tables of a single database. This restriction didn't exist in 4.1.8. Regards, Mark
[23 May 2005 13:24]
Marko Mäkelä
Mark, To my knowledge, InnoDB has always enforced <database_name>+<key_name> to be unique. If you can prove this false, please submit the test case. Please note that MySQL silently ignores foreign keys and TYPE=InnoDB or ENGINE=InnoDB if the InnoDB storage engine is not available. It's best to check the SHOW CREATE TABLE output.