[MDEV-4264] binary data in mysqlbinlog output Created: 2013-03-11  Updated: 2020-09-08  Resolved: 2013-11-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.0.2, 5.5.30, 5.1.67, 5.2.14, 5.3.12
Fix Version/s: 5.5.34, 10.0.7

Type: Bug Priority: Minor
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: upstream

Issue Links:
Relates
relates to MDEV-4297 mysql --binary-mode Closed

 Description   

in SBR mode mysqlbinlog prints the original query string, with the C API it's easy to generate INSERT statement that contains \0 or some other binary data, and that will break mysqlbinlog|mysql restore.

See also the linked MySQL bug,

Fix: mysqlbinlog should replace binary strings with their hexadecimal representation.



 Comments   
Comment by Sergei Golubchik [ 2013-05-13 ]

this can be fixed in the mysqlbinlog — by escaping problematic characters (bad, doesn't always work with multi-byte eastern charsets), or by replacing the complete string literal with the hex notation (doesn't work for identifiers).

this can be fixed in the mysql client — by not treating problematic characters specially, when loading from a file (breaks loading sql dumps created on windows), or with a special "binary" mode (upstream fix).

Or, perhaps, in both — binary mode in the mysql client, a \B command to enable it, and mysqlbinlog putting \B in all dumps. At least the user won't need to remember the binary mode, unless she wants to apply only a part of the dump.

Comment by Sergei Golubchik [ 2013-11-20 ]

merged MySQL's --binary-mode

Generated at Thu Feb 08 06:55:04 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.