diff --git a/mysql-test/extra/binlog_tests/ctype_cp932.test b/mysql-test/extra/binlog_tests/ctype_cp932.test index 688d06c4dde..c6196b928b0 100644 --- a/mysql-test/extra/binlog_tests/ctype_cp932.test +++ b/mysql-test/extra/binlog_tests/ctype_cp932.test @@ -413,3 +413,14 @@ select * from t1; insert into t1 values ('abc'); select * from t1; drop table t1; + +# +# Bug#25815 Data truncated for column TEXT +# +set names utf8; +create table t1 (a text) default character set cp932; +insert into t1 values (_utf8 0xE38182); +show warnings; +select * from t1; +select hex(a) from t1; +drop table t1; diff --git a/mysql-test/r/binlog_stm_ctype_cp932.result b/mysql-test/r/binlog_stm_ctype_cp932.result index ed57b87c1ba..10451686e2c 100755 --- a/mysql-test/r/binlog_stm_ctype_cp932.result +++ b/mysql-test/r/binlog_stm_ctype_cp932.result @@ -11353,3 +11353,15 @@ a a a drop table t1; +set names utf8; +create table t1 (a text) default character set cp932; +insert into t1 values (_utf8 0xE38182); +show warnings; +Level Code Message +select * from t1; +a +あ +select hex(a) from t1; +hex(a) +82A0 +drop table t1; diff --git a/sql/field.cc b/sql/field.cc index 3bea4e9c0fb..589f15d929e 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -7213,7 +7213,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; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index dd589c5bff9..d080ef70dad 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -7486,7 +7486,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), case (int) OPT_STANDALONE: /* Dummy option for NT */ break; #endif - /* + /* The following change issues a deprecation warning if the slave configuration is specified either in the my.cnf file or on the command-line. See BUG#21490.