pt-duplicate-key-checker intermitently fails to report full unique col index duplicating partial unique col index

Bug #1436399 reported by Frank Cizmich
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Triaged
Medium
Frank Cizmich

Bug Description

(originally reported by David Bennet)

to reproduce:

CREATE TABLE ai6 (
  id int(11) NOT NULL,
  c1 int(11) DEFAULT NULL,
  c2 int(11) DEFAULT NULL,
  c3 varchar(64) DEFAULT NULL,
  c4 varchar(64) DEFAULT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- OLD index entire column
CREATE UNIQUE INDEX c3_full ON ai6 (c3);

-- NEW enforce first 5 characters being unique
CREATE UNIQUE INDEX c3_partial ON ai6 (c3(5));

Consecutive runs spuriously fail to report duplicate:

$ bin/pt-duplicate-key-checker -d test -t ai6
# ########################################################################
# test.ai6
# ########################################################################

# Uniqueness of c3_full ignored because c3_part is a duplicate constraint
# c3_full is a left-prefix of c3_part
# Key definitions:
# UNIQUE KEY `c3_full` (`c3`),
# UNIQUE KEY `c3_part` (`c3`(5))
# Column types:
# `c3` varchar(64) default null
# To remove this duplicate index, execute:
ALTER TABLE `test`.`ai6` DROP INDEX `c3_full`;

# ########################################################################
# Summary of indexes
# ########################################################################

# Size Duplicate Indexes 67
# Total Duplicate Indexes 1
# Total Indexes 3
$ bin/pt-duplicate-key-checker -d test -t ai6
# ########################################################################
# Summary of indexes
# ########################################################################

# Total Indexes 3
$ bin/pt-duplicate-key-checker -d test -t ai6
# ########################################################################
# Summary of indexes
# ########################################################################

# Total Indexes 3
$ bin/pt-duplicate-key-checker -d test -t ai6
# ########################################################################
# test.ai6
# ########################################################################

# Uniqueness of c3_full ignored because c3_part is a duplicate constraint
# c3_full is a left-prefix of c3_part
# Key definitions:
# UNIQUE KEY `c3_full` (`c3`),
# UNIQUE KEY `c3_part` (`c3`(5))
# Column types:
# `c3` varchar(64) default null
# To remove this duplicate index, execute:
ALTER TABLE `test`.`ai6` DROP INDEX `c3_full`;

# ########################################################################
# Summary of indexes
# ########################################################################

# Size Duplicate Indexes 67
# Total Duplicate Indexes 1
# Total Indexes 3

Changed in percona-toolkit:
importance: Undecided → High
assignee: nobody → Frank Cizmich (frank-cizmich)
status: New → Triaged
Changed in percona-toolkit:
importance: High → Medium
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-677

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

Other bug subscribers

Remote bug watches

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