Bug #24492 Incorrect query in binary log if one uses 0x5C character, SJIS encoding and PS
Submitted: 21 Nov 2006 23:35 Modified: 28 Nov 2006 8:52
Reporter: Sveta Smirnova Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Prepared statements Severity:S3 (Non-critical)
Version:5.0 OS:Linux (Linux)
Assigned to: Alexander Barkov CPU Architecture:Any
Tags: backport_050030SP1

[21 Nov 2006 23:35] Sveta Smirnova
If one uses in self C API or Connector/J script server side prepared statements and 0x5C character in SJIS encoding she gets incorrect query in binary log. 0x5C character is not escaped properly: one backslash before apostrof. As result replication can be got broken.

How to repeat:
Compile and run attached script, then examine binary log file.
[22 Nov 2006 6:39] Valeriy Kravchuk
Bug #24381 was marked as a duplicate of this one.
[24 Nov 2006 12:11] Sveta Smirnova
Patch for bug #23916 fixes this one.
[28 Nov 2006 8:36] McEase Tu
Bug #23916 is marked as "Not a bug". I can't see any files attached to it... Where to find the patch?
[28 Nov 2006 8:44] Tetsuro Ikeda
I think this one is a patch for this issue, and this patch seems only in private bk (not yet in public bk:)

[28 Nov 2006 8:52] Sveta Smirnova
I am sorry: I replaced numbers in self previous comment.

This comment should we written as "Patch for bug #23619 fixes this one"
[22 Dec 2006 0:37] 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:


ChangeSet@1.2310, 2006-12-22 01:37:36+01:00, msvensson@neptunus.(none) +5 -0
  Bug#23619 Incorrectly escaped multibyte characters in binary log break replication
  - Problem: when embedding a character string with introducer with charset X
    into a SQL query which is generally in character set Y, the string constants
    were escaped according to their own character set (i.e.X), then after reading
    such a "mixed" query from binlog, the string constants were unescaped
    using character set of the query (i.e. Y), instead of X, which gave wrong
    results or even syntax errors with tricky charsets (e.g. sjis)
    Fix: when embedding a string constant of charset X into a query of charset Y,
    the string constant is now escaped according to character Y, instead of
    its own character set X.
  - Also fixes BUG#24492