summaryrefslogtreecommitdiff
path: root/sql/field.cc
diff options
context:
space:
mode:
authorbar@mysql.com <>2007-01-24 16:37:38 +0400
committerbar@mysql.com <>2007-01-24 16:37:38 +0400
commitffeaffc26fc27e3d068210966254d3189d4868c5 (patch)
tree836889e34e664088431d01c58c6b203bd2dfcc5a /sql/field.cc
parentab8200aed827f6d28471205d1defabf600e201b7 (diff)
downloadmariadb-git-ffeaffc26fc27e3d068210966254d3189d4868c5.tar.gz
Bug#25815 Data truncated for column TEXT
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.
Diffstat (limited to 'sql/field.cc')
-rw-r--r--sql/field.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 257c7846468..61a687567fc 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -7024,7 +7024,7 @@ int Field_blob::store(const char *from,uint length,CHARSET_INFO *cs)
cannot_convert_error_pos, from + length))
return 2;
- if (copy_length < length)
+ if (from_end_pos < from + length)
{
report_data_too_long(this);
return 2;