pt-table-sync --print option binary columns not readable in output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Percona Toolkit moved to https://jira.percona.com/projects/PT |
Triaged
|
Undecided
|
Unassigned |
Bug Description
We have a number of columns in our application that use binary(16). These columns are printing out with garbage characters, even with the --hex-blog variable set. Is there a way to get the hex version of the binary output?
#####
http://
--[no]hex-blob¶
default: yes
HEX() BLOB, TEXT and BINARY columns.
When row data from the source is fetched to create queries to sync the data (i.e. the queries seen with --print and executed by --execute), binary columns are wrapped in HEX() so the binary data does not produce an invalid SQL statement. You can disable this option but you probably shouldn’t.
#####
MySQL version (master & slave): 5.5.17
[tungsten@master101 ~]$ pt-table-sync --version
pt-table-sync 2.2.2
Example problem column output from select:
SELECT `account_id`, HEX(contact_id), HEX(channel_id), `address`, `state`, `create_source`, `update_source`, `created_at`, `updated_at`, `deleted_at` FROM channels WHERE `account_id` = 1100373722264 AND address = '<email address hidden>';
account_id HEX(contact_id) HEX(channel_id) address state create_source update_source created_at updated_at deleted_at
------------- -------
1100373722264 463E1F409C9611E
Output from pt-table-sync - contact_id & channel_id are not readable.
[tungsten@master101 ~]$ pt-table-sync --verbose --print h=master101,
Enter password for master101:
Enter password for slave102:
# Syncing P=3306,
# DELETE REPLACE INSERT UPDATE ALGORITHM START END EXIT DATABASE.TABLE
# 0 0 0 0 Nibble 11:55:27 11:55:28 0 HMS_Contacts01.
UPDATE `HMS_Contacts01
# 0 0 0 1 Nibble 11:55:28 11:55:30 2 HMS_Contacts01.
...
--hex-blob should work, since it's not, it's a bug somewhere. There's no quick workaround I can think of; pt-table-sync is rather complex. We'll look into this and fix.