pt-table-sync does not dump bit values properly with --print

Bug #1229451 reported by Jervin R on 2013-09-23
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to

Bug Description

When running pt-table-sync with --print, say I have these rows on the master I want to sync with the slave:

master [localhost] {msandbox} (test) > show create table t \G
*************************** 1. row ***************************
       Table: t
Create Table: CREATE TABLE `t` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `x` bit(1) NOT NULL,
  PRIMARY KEY (`id`)
1 row in set (0.00 sec)

master [localhost] {msandbox} (test) > insert into t (x) values ('');
Query OK, 1 row affected (0.00 sec)

master [localhost] {msandbox} (test) > select id, bin(x) from t;
| id | bin(x) |
| 1 | 0 |
1 row in set (0.00 sec)

When running pt-table-sync --print, I would get these REPLACE INTO statements:

REPLACE INTO `test`.`t`(`id`, `x`) VALUES ('1', '^@') /*percona-toolkit src_db:test src_tbl:t src_dsn:A=latin1,P=55321,h=,p=...,u=msandbox dst_db:test dst_tbl:t dst_dsn:A=latin1,P=55322,h=127.0.
0.1,p=...,u=msandbox lock:1 transaction:1 changing_src:percona.checksums replicate:percona.checksums bidirectional:0 pid:3641 user:revin*/;

As you can see form the control character, it was dumped as binary instead of translated into ASCII like '\0' like what mysqldump does. Though I also recently reported a bug upstream about another problem with mysqldump

Jervin R (revin) wrote :

This is 2.2.4 by the way.

tags: added: bit-column pt-table-sync
Changed in percona-toolkit:
status: New → Confirmed

Percona now uses JIRA for bug reports so this bug report is migrated to:

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

Other bug subscribers