Bug #21119 | Parser seems to push foreign key modifications in the wrong order to InnoDB. | ||
---|---|---|---|
Submitted: | 18 Jul 2006 17:44 | Modified: | 12 Sep 2006 12:19 |
Reporter: | Tobias Asplund | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Query Browser | Severity: | S3 (Non-critical) |
Version: | Latest official | OS: | Windows (Windows) |
Assigned to: | Michael G. Zinner | CPU Architecture: | Any |
Tags: | Object Editors |
[18 Jul 2006 17:44]
Tobias Asplund
[18 Jul 2006 18:24]
Sveta Smirnova
Verified on Linux using last 5.0 and 5.1 BK sources as described with one exception - different error message: mysql> ALTER TABLE t1 DROP FOREIGN KEY t1_ibfk_1, ADD CONSTRAINT -> t1_ibfk_1 FOREIGN KEY (a) REFERENCES t1 (b) ON UPDATE CASCADE; ERROR 1005 (HY000): Can't create table './test/#sql-36a6_1.frm' (errno: 121)
[27 Jul 2006 5:40]
Heikki Tuuri
Tobias, actually this is not legal syntax for InnoDB. If you look at the InnoDB manual, this syntax of simultaneously dropping and creating foreign keys is not listed there. InnoDB should give an error of the wrong syntax. Regards, Heikki
[28 Jul 2006 11:17]
Tobias Asplund
That's fine, Heikki. I'm changing this now to a Query Browser bug, because if this is not valid syntax, the Query Browser should not try to execute queries with this syntax. It's easy to reproduce, just create a FK on a table, then modify it and add something like ON DELETE CASCADE and it will try this syntax.