Comment 1 for bug 1259274

Revision history for this message
Peiran Song (peiran-song) wrote : Re: pt-table-checksum --cunk-index ignores existing index

I have verified that the error was due to case sensitive comparison on the index name. When specify --chunk-index with index name that is of the same case as defined in the database, the tool does use it. Same behavior in 2.2.5 and latest 2.2.11. Since index name is not case sensitive on any platform, I think pt-table-checksum should use case-insensitive comparison to check index name.

Below is the detail of the test:
-------------------------------------------------
create table ptc_i_test
(col1 int,
col2 varchar(10),
col3 int,
key metric42294eae0e93c043fb083b1049e4fcbed9d7_idx (col1),
key metric8a56a17b007640471f0856e099e06401589f_idx (col3),
key metric8f60732102034046720ab81022c12e7c6cbf_idx (col2)
) engine = innodb;

PTDEBUG=1 ./pt-table-checksum --no-check-binlog-format --chunk-index metric8f60732102034046720ab81022c12e7c6cbf_idx --tables test.ptc_i_test --recursion-method dsn=D=percona,t=dsns h=127.0.0.1,P=13000,u=msandbox,p=msandbox >ptc.out 2>ptc.err

# NibbleIterator:6444 28172 User wants to use index metric8f60732102034046720ab81022c12e7c6cbf_idx
# NibbleIterator:6464 28172 Wanted index is a possible index
# NibbleIterator:6482 28172 No PRIMARY or unique indexes; will use index with highest cardinality
# NibbleIterator:6513 28172 SHOW INDEXES FROM `test`.`ptc_i_test` WHERE Key_name = 'metric8f60732102034046720ab81022c12e7c6cbf_idx'
# NibbleIterator:6523 28172 Index metric8f60732102034046720ab81022c12e7c6cbf_idx cardinality: 4
# NibbleIterator:6502 28172 Best index: metric8f60732102034046720ab81022c12e7c6cbf_idx