pt-table-checksum reports error on table with different columns collations
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Database `mydb` is fully replicated to the slaves. We have the following table with different collations for it's columns:
===
USE mydb;
CREATE TABLE `table1` (
`column1` varchar(255) CHARACTER SET latin1 NOT NULL COMMENT 'column1',
`column2` varchar(245) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'column2',
`column3` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'column3',
PRIMARY KEY (`column1`
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='None';
===
Command used: pt-table-checksum --replicate=
Errors:
===
02-26T01:55:37 Error executing EXPLAIN SELECT COUNT(*) AS cnt, COALESCE(
02-26T01:55:37 Error checksumming table mydb.table1: Error executing checksum query: DBD::mysql::st execute failed: Illegal mix of collations for operation 'concat_ws' [for Statement "REPLACE INTO `mydb`.`_checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE(
===
$ pt-table-checksum --version
pt-table-checksum 2.2.13
$ mysql -B -N -e 'show variables like "version"'
version 5.5.41-
summary: |
- pt-table-checksum reports error on tables with different columns + pt-table-checksum reports error on table with different columns collations |
Verified with PS 5.6.21.
nilnandan@ desktop: ~$ pt-table-checksum --version desktop: ~$
pt-table-checksum 2.2.14
nilnandan@
nilnandan@ desktop: ~$ pt-table-checksum --user=root --password=msandbox --socket= /tmp/mysql_ sandbox20886. sock --recursion-method dsn=h=localhost ,D=percona, t=dsns --no-check- binlog- format --check-interval=10 LOWER(CONV( BIT_XOR( CAST(CRC32( CONCAT_ WS('#', `column1`, `column2`, `column3`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`table1` /*explain checksum table*/: DBD::mysql::st execute failed: Illegal mix of collations for operation 'concat_ws' [for Statement "EXPLAIN SELECT COUNT(*) AS cnt, COALESCE( LOWER(CONV( BIT_XOR( CAST(CRC32( CONCAT_ WS('#', `column1`, `column2`, `column3`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`table1` /*explain checksum table*/"] at /usr/bin/ pt-table- checksum line 11185.
TS ERRORS DIFFS ROWS CHUNKS SKIPPED TIME TABLE
05-06T12:44:24 0 0 0 1 0 0.013 mysql.columns_priv
...
05-06T12:44:24 0 0 8 1 0 0.005 mysql.user
05-06T12:44:24 0 1 1 1 0 0.006 percona.dsns
05-06T12:44:43 0 4 16777216 24 0 19.277 test.nil
05-06T12:44:43 0 0 0 1 0 0.012 test.nil-test
05-06T12:44:43 Error executing EXPLAIN SELECT COUNT(*) AS cnt, COALESCE(
05-06T12:44:43 Error checksumming table test.table1: Error executing checksum query: DBD::mysql::st execute failed: Illegal mix of collations for operation 'concat_ws' [for Statement "REPLACE INTO `percona` .`checksums` (db, tbl, chunk, chunk_index, lower_boundary, upper_boundary, this_cnt, this_crc) SELECT ?, ?, ?, ?, ?, ?, COUNT(*) AS cnt, COALESCE( LOWER(CONV( BIT_XOR( CAST(CRC32( CONCAT_ WS('#', `column1`, `column2`, `column3`)) AS UNSIGNED)), 10, 16)), 0) AS crc FROM `test`.`table1` /*checksum table*/" with ParamValues: 0='test', 1='table1', 2=1, 3=undef, 4=undef, 5=undef] at /usr/bin/ pt-table- checksum line 10606.
05-06T12:44:43 2 0 0 1 0 0.005 test.table1 desktop: ~$
nilnandan@