Bug #9337 misleading warning when inserting invalid utf8 data
Submitted: 22 Mar 2005 13:53 Modified: 11 Oct 2006 9:10
Reporter: Marko Mäkelä Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:4.1.10, 5.0.3 OS:Any (all)
Assigned to: Assigned Account CPU Architecture:Any

[22 Mar 2005 13:53] Marko Mäkelä
When inserting invalid data to a UTF-8 encoded column, MySQL will truncate the data, treating the invalid UTF-8 character as end-of-string marker. So far, so good (except it would be better to roll back the statement).

However, the warning message 1265 issued by MySQL is misleading: it says
"Data truncated for column 'a' at row 1" instead of "Invalid data for column 'a' truncated at row 1" or something similar.

How to repeat:
create table t(a char(4)) charset=utf8;
insert into t values(0x22e222);
show warnings;
select hex(a) from t;

Suggested fix:
Issue a more descriptive warning message.
[7 May 2005 16:28] Michael Widenius
Fix will be in 5.0, as we don't want to do a big change just to correct a warning in 4.1
Now waiting for a new patch to review...
[29 Aug 2005 10:42] Alexander Barkov
See also bug#12600
[27 Jul 2006 7:34] Alexander Barkov
Can't find time to continue working on this bug 
due to big amount of other bugs with higher priority.
Setting back to "verified".
[11 Oct 2006 9:10] Alexander Barkov
The patch for 18908 fixes this problem as well.
Markign as puplicate to 18908.