Bug #18351 mysqlbinlog does not set default charset?
Submitted: 20 Mar 2006 11:17 Modified: 5 Jun 2006 20:02
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.1.12a OS:Windows (windows)
Assigned to: Ramil Kalimullin CPU Architecture:Any

[20 Mar 2006 11:17] Hartmut Holzgraefe
Description:
Customer ran into a problem when trying to do point in time
recovery from a binary log using

  mysqlbinlog binlog_name | mysql 

with latin1 being set as the default client/connection charset
as mysqlbinlog produces UTF8 output but does not set the
character set at the beginning of its output (or at least not
always?)

so UTF8 data produced by mysqlbinlog was interpreted as
latin1, leading to foreign key violations as the data read from
the binlog did not match the data already restored from a 
backup

How to repeat:
see the output created by mysqlbinlog

Suggested fix:
always start mysqlbinlog output with "SET NAMES UTF8"?
[4 May 2006 10:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5939
[23 May 2006 12:19] Iggy Galarza
5939 looks good.
[24 May 2006 13:06] Ramil Kalimullin
fixed in 4.1.21
[5 Jun 2006 20:02] Paul DuBois
Noted in 4.1.21, 5.0.23, 5.1.12 changelogs.

Added the --set-charset option to mysqlbinlog to allow the character
set to be specified for processing binary log files.

Also updated the option list for the mysqlbinlog section.