• unknown's avatar
    BUG#11338 (logging of prepared statement w/ blob type) · 48fa74fd
    unknown authored
    In cp932, '\' character can be the second byte in a 
    multi-byte character stream. This makes it difficult to use
    mysql_escape_string. Added flag to indicate which languages allow
    '\' as second byte of multibyte sequence so that when putting a prepared
    statement into the binlog we can decide at runtime whether hex encoding
    is really needed.
    
    
    include/m_ctype.h:
      Added bool to indicate character sets which allow '\' as the second
      byte of a multibyte character set (currently only cp932). For these
      character sets, escaping with '\' is dangerous and leads to corruption
      in replication.
    include/my_sys.h:
      Add function to enocde a string as hex with no prefix (bare)
    mysys/charset.c:
      Add function to encode string as hex with no prefix (bare).
    sql/item.cc:
      Check the connection character set to see if escape_string_for_mysql
      is safe, or if character set requires unambiguous (hex) encoding
    sql/item.h:
      Pass thd to query_val_str for access to charset...
    48fa74fd
my_sys.h 31.7 KB