Bug #17906 | Allow FOREIGN KEYs without an index | ||
---|---|---|---|
Submitted: | 3 Mar 2006 20:19 | Modified: | 16 Mar 2006 13:03 |
Reporter: | Andre Timmer | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | 5.0.18 | OS: | Any (all) |
Assigned to: | Assigned Account | CPU Architecture: | Any |
[3 Mar 2006 20:19]
Andre Timmer
[4 Mar 2006 17:02]
Valeriy Kravchuk
Thank you for a problem report. Everything works just as you described. I agree that there are cases when unindexed foreign keys should be allowed. That is why, say, Oracle creates them as such by default. But I think this is not really a bug, but a documented behaviour. Read the manual (http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html): "In the referencing table, there must be an index where the foreign key columns are listed as the first columns in the same order. Such an index is created on the referencing table automatically if it does not exist." So, it is a feture request. At least, for proper error message in such cases, as well as for the real feature (unindexed foreign keys). I am not sure the later feature will be added, though.
[16 Mar 2006 13:03]
Heikki Tuuri
Duplicate of http://bugs.mysql.com/bug.php?id=12658