Bug #8429 | Can't create foreign keys on TINYTEXT fields | ||
---|---|---|---|
Submitted: | 11 Feb 2005 0:34 | Modified: | 25 Feb 2005 18:09 |
Reporter: | Eric Schwartz | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S2 (Serious) |
Version: | 4.1.9 | OS: | Linux (Debian unstable ('sid')) |
Assigned to: | Paul DuBois | CPU Architecture: | Any |
[11 Feb 2005 0:34]
Eric Schwartz
[11 Feb 2005 1:55]
Jorge del Conde
SQLSTATE 42962 doesn't allow blob fields to be part of foreign keys. I changed the category of this bug to documentation.
[25 Feb 2005 18:09]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant product(s). Additional info: I've updated http://dev.mysql.com/doc/mysql/en/innodb-foreign-key-constraints.html to point out explicitly that BLOB/TEXT columns can't be included in foreign keys. (The reason is that FK columns cannot have an index prefix, and BLOB/TEXT must include an index prefix.) It appears in one of the examples in this bug report that it was possible to include a column with an index prefix in the FK definition. But what was really happening is that the prefix was being lost because it was the same as the column length. As a result, the column appeared not to have a prefix. I have filed a bug report about this: http://bugs.mysql.com/bug.php?id=8814
[8 Jun 2005 10:51]
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/25750