Bug #105819 Conversion from Blob/Text column value to double does not return a truncation er
Submitted: 7 Dec 2021 9:48 Modified: 7 Dec 2021 13:43
Reporter: Xia Li Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:8.0 OS:Any
Assigned to: CPU Architecture:Any

[7 Dec 2021 9:48] Xia Li
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.
[7 Dec 2021 13:43] MySQL Verification Team
Hi Mr. Li,

Thank you for your bug report.

We have repeated your test case with latest 8.0.

This looks mostly like a documentation issue, but we shall verify it as a code bug.

Verified as reported.