Bug #7136 Table editor ignores index prefix length on TEXT/BLOB cols in primary keys
Submitted: 9 Dec 2004 16:45 Modified: 19 Sep 2005 12:19
Reporter: Eoin Kelly Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Query Browser Severity:S3 (Non-critical)
Version:1.1.2 OS:Windows (MS Windows XP Pro SP 2)
Assigned to: Michael G. Zinner CPU Architecture:Any

[9 Dec 2004 16:45] Eoin Kelly
Description:
When I open the table editor and try to add a TEXT or BLOB column to the primary key of the table, the table editor does not use the value input by the user when generating the ALTER TABLE statement. Obviously this causes the statement to fail. 

This does not seem to affect other index types - only the primary key is affected (as far as my tests went anyway).

How to repeat:
Open the table editor on a table with a TEXT column.

Add the TEXT column to the primary key for the table. 

Double-click on the TEXT column's name in the 'Index Columns' box. This brings up a small menu 'Set Index Column Length' - enter a number into the dialog box that pops up. The column name in the 'Index Columns' box changes to show the number you typed in brackets - all is well so far. Now hit 'Apply Changes' - the SQL shown in the dialog box does not include the index prefix length so the query fails.
[9 Dec 2004 18:00] MySQL Verification Team
Thank you for the bug report.
[6 Jan 2005 16:16] Jason Schlesinger
I experienced the same bug, but for non-primary key indexes as well - a Varchar(200) field, default index type.
[6 Jan 2005 16:22] Jason Schlesinger
It seems to only occur only when I click the right-pointing arrow to bring up the submenu "Set Index Column Length"...when I double-click the field in the index column (which has the same effect), I can create the suffix column length without issue.  I was using a Varchar(200) field,  INDEX index, DEFAULT type.
[19 Sep 2005 12:19] Michael G. Zinner
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