• unknown's avatar
    Bug#23619 Incorrectly escaped multibyte characters in binary log break replication · e0fc25e9
    unknown authored
    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.
    
    
    mysql-test/r/ctype_cp932_binlog.result:
      Fixing test results.
    sql/log_event.cc:
      Using character set "csinfo" instead of the string character set.
    sql/sp_head.cc:
      - adding "thd" argument to sp_get_item_value()
        to have access to thd->variables.character_set_client
      - using character_set_client for escaping, instead of
        the string character set
    mysql-test/r/rpl_charset_sjis.result:
      Adding test case
    mysql-test/t/rpl_charset_sjis.test:
      Adding test case
    e0fc25e9
log_event.cc 153 KB