pt-online-schema-change: typo for finding usable indexes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Fix Released
|
Medium
|
Brian Fraser |
Bug Description
show create table_name;
CREATE TABLE ` table_name` (
`site` varchar(20) NOT NULL DEFAULT '',
`update_name` varchar(32) NOT NULL DEFAULT '',
`user` varchar(64) NOT NULL DEFAULT '',
`time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`type` enum('aaa'
`value` varchar(64) NOT NULL DEFAULT '',
UNIQUE KEY `site` (`site`
KEY `user` (`user`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
Error:
The original table `db`.`table_name` does not have a PRIMARY KEY or a unique index which is required for the DELETE trigger.
This appears to be a typo when looking for unique or primary keys in the table def. should be keys NOT indexes
Fixed with the following patch:
6184c6184
< my $indexes = $orig_tbl-
---
> my $indexes = $orig_tbl-
Related branches
- Brian Fraser (community): Approve
- Daniel Nichter: Approve
-
Diff: 68 lines (+33/-2)3 files modifiedbin/pt-online-schema-change (+1/-1)
t/pt-online-schema-change/bugs.t (+18/-1)
t/pt-online-schema-change/samples/bug-1002448.sql (+14/-0)
Changed in percona-toolkit: | |
status: | Confirmed → Fix Committed |
Changed in percona-toolkit: | |
status: | Fix Committed → Fix Released |
Good catch, thank you.