Bug #46225 Conversion from Blob/Text column value to int does not give truncation warning
Submitted: 16 Jul 2009 14:09
Reporter: Øystein Grøvlen Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Data Types Severity:S3 (Non-critical)
Version:mysql-azalea OS:Any
Assigned to: Assigned Account CPU Architecture:Any
Triage: Triaged: D4 (Minor)

[16 Jul 2009 14:09] Øystein Grøvlen
Description:
This query passes a blob column to a function which expects an integer:

  select left('1234567890', b) from t1;

If a column contains something that is not just a single integer (e.g. "2.a"), 
one will get truncation warning for char and varchar columns, but not for blob/text columns. 

How to repeat:
create table t1 (t text, c char(10), b blob, d varbinary(10));
insert into t1 values ("", "2.a", "3e", "Hello");
select left('1234567890', t) from t1;
select left('1234567890', b) from t1;
select left('1234567890', c) from t1;
select left('1234567890', d) from t1;

Observe that the first two select queries will not generate a warning, while the last two queries will.
[16 Jul 2009 14:10] Øystein Grøvlen
This should be fixed by the work on Value object (WL#4904)
[16 Jul 2013 11:15] Hartmut Holzgraefe
Still reproducible with 5.6.12, so not fixed yet