Bug #29339 | Warning 1265 'Data truncated' incorrectly worded | ||
---|---|---|---|
Submitted: | 25 Jun 2007 14:36 | Modified: | 27 Jun 2007 14:04 |
Reporter: | Peter Belm | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Errors | Severity: | S4 (Feature request) |
Version: | 5.0.41 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[25 Jun 2007 14:36]
Peter Belm
[25 Jun 2007 15:03]
MySQL Verification Team
Thank you for the bug report.
[27 Jun 2007 13:01]
Sergei Golubchik
The warning is correct. INSERT INTO `test_table` VALUES(0) is treated exactly the same as INSERT INTO `test_table` VALUES('foobar') - both insert values outside of the ENUM set. Try to select from the table to see. ENUM elements are numbered from 1, not from 0. If you do INSERT INTO `test_table` VALUES(1) or INSERT INTO `test_table` VALUES(2) - there will be no warning.
[27 Jun 2007 14:00]
Peter Belm
I'm not saying that the reason the warning is coming up is a bug, but that the warning itself is worded incorrectly in some instances (hence the severity of "Feature request"). Turning an integer 0 into a string '0' is not truncation. This wording can be very confusing if this is the first time you've seen the error. It should be made clear that the data was automatically altered rather than assuming the data was "truncated" (I assume this was originally created for cutting off decimal digits, in that particular case truncation is the correct term).
[27 Jun 2007 14:04]
Peter Belm
Sorry I re-read your comment, while I understood the way MySQL enumerates I assumed it was trying to do an automatic type conversion. Set back to Not a Bug.