pt-online-schema-change: typo for finding usable indexes

Bug #1002448 reported by Paul Golownia
14
This bug affects 2 people
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','bbb','ccc','ddd') NOT NULL DEFAULT 'update',
  `value` varchar(64) NOT NULL DEFAULT '',
  UNIQUE KEY `site` (`site`,`update_name`,`user`,`value`),
  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->{tbl_struct}->{keys}; # brevity
---
> my $indexes = $orig_tbl->{tbl_struct}->{indexes}; # brevity

Related branches

Revision history for this message
Paul Golownia (zi) wrote :
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Good catch, thank you.

Changed in percona-toolkit:
status: New → Confirmed
milestone: none → 2.1.2
importance: Undecided → Medium
tags: added: pt-online-schema-change typo
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

Also reported as bug 1002849.

Changed in percona-toolkit:
assignee: nobody → Brian Fraser (fraserbn)
Brian Fraser (fraserbn)
Changed in percona-toolkit:
status: Confirmed → Fix Committed
Changed in percona-toolkit:
status: Fix Committed → Fix Released
Revision history for this message
Shahriyar Rzayev (rzayev-sehriyar) wrote :

Percona now uses JIRA for bug reports so this bug report is migrated to: https://jira.percona.com/browse/PT-533

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.