• unknown's avatar
    Bug#25815 Data truncated for column TEXT · fb33da5f
    unknown authored
    Problem: "Data truncated" warning was incorrectly generated
    when storing a Japanese character encoded in utf8
    into a cp932 column.
    Reason: Incorrect wrong warning condition
    compared the original length of the character in bytes
    (which is 3 in utf8) to the converted length of the
    character in bytes (which is 2 in cp932).
    Fix: use "how many bytes were scanned from input" instead
    of "how many bytes were put to the column" in the condition.
    
    
    mysql-test/r/ctype_cp932.result:
      Adding test case
    mysql-test/t/ctype_cp932.test:
      Adding test case
    sql/field.cc:
      Change warning condition from:
      "if number of bytes written to destination is less than full source length"
      to
      "if number of bytes read from source is less than full source length"
    fb33da5f
field.cc 249 KB