Bug #62325 | LOAD DATA not loading NULL values properly | ||
---|---|---|---|
Submitted: | 1 Sep 2011 17:45 | Modified: | 14 Nov 2011 10:37 |
Reporter: | Michael Butler | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.5.8 MySQL Community Server (GPL) | OS: | Windows (Windows 7) |
Assigned to: | CPU Architecture: | Any | |
Tags: | infile, LOAD DATA, null |
[1 Sep 2011 17:45]
Michael Butler
[2 Sep 2011 13:08]
Valeriy Kravchuk
What exact server version, x.y.z, do you use?
[2 Sep 2011 14:49]
Michael Butler
5.5.8 MySQL Community Server (GPL)
[2 Sep 2011 15:20]
Michael Butler
I did some putzing and discovered the (IMHO) oddly specific nature of this bug. I was focused on a case where it wasn't working where my NULL was the last value in the row. Deleting the tab between where that NULL is and the second-to-last value gives me my NULL. Also, putting \N into a spot in the middle of the row gives me a NULL. This provides a simple workaround, but I still think this counts as a bug because the \N should work no matter where it's placed, even if it's not needed.
[14 Nov 2011 10:37]
Valeriy Kravchuk
Our manual, http://dev.mysql.com/doc/refman/5.5/en/load-data.html, clearly says: "If you specify no FIELDS or LINES clause, the defaults are the same as if you had written this: FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY ''" Extra tab matters, it is interpreted as field separator, so your \N goes to the "next" filed comparing to expected.