Details
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.
Gliffy Diagrams
Attachments
Issue Links
- relates to
-
MDEV-4297 mysql --binary-mode
-
- Closed
-
- links to
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
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.