Bug #84579 Not possible to specify length on index column for combined indexes
Submitted: 20 Jan 2017 11:03 Modified: 9 Apr 2017 19:28
Reporter: Jonas Stenberg Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Workbench: Modeling Severity:S2 (Serious)
Version:6.3.6 OS:Linux (Ubuntu 16.04.1 LTS)
Assigned to: CPU Architecture:Any
Tags: INDEX, WBBugReporter

[20 Jan 2017 11:03] Jonas Stenberg
Description:
When having a combined index on a table, it is not possible to specify max index length on any other columns than the first column of the index. If I synchronize changes back to WorkBench model from a database that already have a max index length on any other columns than the first column, the length restriction is moved to the first column.

How to repeat:
Create the following table in a database:

CREATE TABLE `mytable` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) COLLATE utf8_swedish_ci NOT NULL,
  `value` text COLLATE utf8_swedish_ci,
  `distribution_id` bigint(20) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_name` (`distribution_id`,`name`,`value`(10))) 
ENGINE=InnoDB AUTO_INCREMENT=3060872 DEFAULT CHARSET=utf8 COLLATE=utf8_swedish_ci;

...and try to synchronize this back to a model file. You will see that for the index ix_name the max length (10) of the value column will have moved to the distribution_id column in the workbench model and when synchronizing again, the change is propagated down to the database, thus corrupting my index.

Suggested fix:
Make sure that it is possible to specify max length of any column in a combined index.
[9 Mar 2017 19:28] MySQL Verification Team
Please try version 6.3.9. Thanks.
[10 Apr 2017 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".