pt-duplicate-key-checker forgets prefix lengths on suggestions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
New
|
Undecided
|
Unassigned |
Bug Description
When suggesting to remove/replace an index that contains a prefix, pt-d-k-c does not keep that length in the suggestion. In the example below, the prefix on title is 20 characters because this is a text field.
The suggestion to drop and recreate would not work as a prefix length is required for TEXT columns.
CREATE TABLE `title` (
`id` int(10) unsigned NOT NULL,
`title` text NOT NULL,
PRIMARY KEY (`id`),
KEY `title` (`title`(20)),
KEY `title_2` (`title`(20),`id`)
)
$ pt-duplicate-
...
# Key title_2 ends with a prefix of the clustered index
# Key definitions:
# KEY `title_2` (`title`(20),`id`)
# PRIMARY KEY (`id`),
# Column types:
# `title` text not null
# `id` int(10) unsigned not null
# To shorten this duplicate clustered index, execute:
ALTER TABLE `imdb`.`title` DROP INDEX `title_2`, ADD INDEX `title_2` (`title`);
Percona now uses JIRA for bug reports so this bug report is migrated to: https:/ /jira.percona. com/browse/ PT-1430