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

Bug #1229451 reported by Jervin R
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Confirmed
Undecided
Unassigned

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`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1
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=127.0.0.1,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 host:forge.dotmanila.com*/;

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 http://bugs.mysql.com/bug.php?id=70404

Revision history for this message
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
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-1155

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.