pt-table-sync --hex-blob option should also be used for geo and bit

Bug #1150477 reported by Daniël van Eeden
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Percona Toolkit moved to https://jira.percona.com/projects/PT
Triaged
Undecided
Unassigned

Bug Description

The --hex-blob option works for BLOB's (and TEXT and BINARY according to the manpage). However it does not work for BIT, GEOMETRY, POINT and probably some other spatial types.

Please implement an option to use HEX() also for these types.

This is not a bug, it's a feature request.

Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

We can call it a bug since it should work but doesn't. :-) We just have never tested with spatial column types.

tags: added: pt-table-sync spatial
Changed in percona-toolkit:
status: New → Triaged
Revision history for this message
Daniël van Eeden (dveeden) wrote :

It might as well be a bug instead of just a feature request.
If a BIT column contains zero's it can break the generated SQL.

--------------
REPLACE INTO `test`.`btest`(`i`, `b`) VALUES ('6', '
--------------

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1

00000850 2f 3b 0a 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 |/;.REPLACE INTO |
00000860 60 74 65 73 74 60 2e 60 62 74 65 73 74 60 28 60 |`test`.`btest`(`|
00000870 69 60 2c 20 60 62 60 29 20 56 41 4c 55 45 53 20 |i`, `b`) VALUES |
00000880 28 27 36 27 2c 20 27 00 27 29 20 2f 2a 70 65 72 |('6', '.') /*per|
00000890 63 6f 6e 61 2d 74 6f 6f 6c 6b 69 74 20 73 72 63 |cona-toolkit src|
000008a0 5f 64 62 3a 74 65 73 74 20 73 72 63 5f 74 62 6c |_db:test src_tbl|
000008b0 3a 62 74 65 73 74 20 73 72 63 5f 64 73 6e 3a 50 |:btest src_dsn:P|
000008c0 3d 32 32 33 38 34 2c 68 3d 31 32 37 2e 30 2e 30 |=22384,h=127.0.0|
000008d0 2e 31 2c 70 3d 2e 2e 2e 2c 75 3d 72 6f 6f 74 20 |.1,p=...,u=root |
000008e0 64 73 74 5f 64 62 3a 74 65 73 74 20 64 73 74 5f |dst_db:test dst_|
000008f0 74 62 6c 3a 62 74 65 73 74 20 64 73 74 5f 64 73 |tbl:btest dst_ds|
00000900 6e 3a 50 3d 32 32 33 38 35 2c 68 3d 31 32 37 2e |n:P=22385,h=127.|
00000910 30 2e 30 2e 31 2c 70 3d 2e 2e 2e 2c 75 3d 72 6f |0.0.1,p=...,u=ro|
00000920 6f 74 20 6c 6f 63 6b 3a 31 20 74 72 61 6e 73 61 |ot lock:1 transa|
00000930 63 74 69 6f 6e 3a 31 20 63 68 61 6e 67 69 6e 67 |ction:1 changing|
00000940 5f 73 72 63 3a 70 65 72 63 6f 6e 61 2e 63 68 65 |_src:percona.che|
00000950 63 6b 73 75 6d 73 20 72 65 70 6c 69 63 61 74 65 |cksums replicate|
00000960 3a 70 65 72 63 6f 6e 61 2e 63 68 65 63 6b 73 75 |:percona.checksu|
00000970 6d 73 20 62 69 64 69 72 65 63 74 69 6f 6e 61 6c |ms bidirectional|
00000980 3a 30 20 70 69 64 3a 31 32 31 32 33 20 75 73 65 |:0 pid:12123 use|
00000990 72 3a 64 76 65 65 64 65 6e 20 68 6f 73 74 3a 64 |r:dveeden host:d|
000009a0 61 6e 69 65 6c 2d 74 68 69 6e 6b 70 61 64 2a 2f |aniel-thinkpad*/|
000009b0 3b 0a 52 45 50 4c 41 43 45 20 49 4e 54 4f 20 60 |;.REPLACE INTO `|

00000880 28 27 36 27 2c 20 27 --> 00<-- 27 29 20 2f 2a 70 65 72 |('6', -->'.'<--) /*per|

Revision history for this message
Daniël van Eeden (dveeden) wrote :

It fails with "--print", redirect to file and then source the file with the mysql commandline client.

It does seem to work with "--execute".

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-1088

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.