Bug #64603 | misleading warning for documented LOAD DATA INFILE behavior | ||
---|---|---|---|
Submitted: | 9 Mar 2012 17:46 | Modified: | 9 Mar 2012 18:05 |
Reporter: | Stephen Dewey | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Errors | Severity: | S3 (Non-critical) |
Version: | 5.3.5-MariaDB-ga-log | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | 1265, data truncated, LOAD DATA INFILE, warning 1265 |
[9 Mar 2012 17:46]
Stephen Dewey
[9 Mar 2012 17:52]
Stephen Dewey
As a follow-up to my suggested fix, I think that it would be best to keep the warning, since changing empty fields to "zero" may often be an undesirable behavior. I do think the warning could be more helpful or should be documented in the LOAD DATA INFILE section.
[9 Mar 2012 17:58]
Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php This is actually not LOAD DATA INFILE issue, but standard warning for cases when data is not proper for certain column type: mysql> CREATE TABLE `myt` ( `my1` varchar(20) NOT NULL, `my2` date DEFAULT NULL, `my3` varchar(20) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Query OK, 0 rows affected (0.15 sec) mysql> insert into myt values('abcd','','a123'); Query OK, 1 row affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+------------------------------------------+ | Level | Code | Message | +---------+------+------------------------------------------+ | Warning | 1265 | Data truncated for column 'my2' at row 1 | +---------+------+------------------------------------------+ 1 row in set (0.00 sec) mysql> select * from myt; +------+------------+------+ | my1 | my2 | my3 | +------+------------+------+ | abcd | 0000-00-00 | a123 | +------+------------+------+ 1 row in set (0.00 sec) I don't think we need to fix standard behavior.
[9 Mar 2012 18:05]
Stephen Dewey
Thanks for the follow-up. The reason I think it is confusing/wrong is the definition of truncate is "to shorten by cutting off a part." In this case it isn't actually being truncated because it is already a zero-length string, so I felt it was confusing. However, I do see your point about it being an extension of a standard processing rule.