Code review comment for lp:~percona-toolkit-dev/percona-toolkit/pt-duplicate-key-checker-skips-report-when-verbose-on-1402730

Revision history for this message
David Bennett (dbpercona) wrote :

Another edge case that fails, full column unique index duplicating partial unique column index, this should be reported.

---

cat <<EOF |
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));

EOF
mysql -B test
bin/pt-duplicate-key-checker -d test -t ai6

review: Needs Fixing

« Back to merge proposal