Description:
String-to-number conversion produces warnings or errors only with CHAR/VARCHAR type. No warnings/errors with TEXT/BLOB.
mysql> create table t(a text, b blob);
Query OK, 0 rows affected (0.06 sec)
mysql> insert into t set a='檝汛', b='好';
Query OK, 1 row affected (0.01 sec)
mysql> select * from t where a = 26;
Empty set (0.01 sec)
mysql> update t set a = 44 where a = 26;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql> insert into t select * from t where a = 26;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> delete from t where a = 26;
Query OK, 0 rows affected (0.00 sec)
mysql> select * from t where b = 26;
Empty set (0.01 sec)
mysql> update t set b = 44 where b = 26;
Query OK, 0 rows affected (0.00 sec)
Rows matched: 0 Changed: 0 Warnings: 0
mysql> insert into t select * from t where b = 26;
Query OK, 0 rows affected (0.00 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> delete from t where b = 26;
Query OK, 0 rows affected (0.01 sec)
How to repeat:
create table t(a text, b blob);
insert into t set a='檝汛', b='好';
case1:
select * from t where a = 26;
select * from t where b = 26;
case2:
update t set a = 44 where a = 26;
insert into t select * from t where a = 26;
delete from t where a = 26;
update t set b = 44 where b = 26;
insert into t select * from t where b = 26;
delete from t where b = 26;
Suggested fix:
Expected result:
Case1 should return a truncated warning, and case2 should return a truncated error.