Bug #1767 Last null in last line ignored when loading new database
Submitted: 6 Nov 2003 7:44 Modified: 13 Dec 2003 11:55
Reporter: David Hollinbeck Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:4.0.16-max-debug OS:Windows (XP Home Edition)
Assigned to: MySQL Verification Team CPU Architecture:Any

[6 Nov 2003 7:44] David Hollinbeck
The last NULL in the last line of a file such as pet.txt (used in your tutorial) is ignored. The date placed into the database is NULL instead of 0000-00-00. If I add one more NULL to the last line then the date is correctly entered as 0000-00-00.

How to repeat:
construct a pet.txt file and load it into a new pet database.
[12 Nov 2003 14:05] Dean Ellis
The issue is due to the default for LINES TERMINATED BY not matching the Windows EOL combination.  If one follows along with the tutorial, it attempts to set 'death' to '\N\r' as it does not recognize '\r\n' as EOL.

It functions correctly provided one specifies the correct line terminator, so the tutorial may need to be revised to mention it.

Thank you.
[13 Dec 2003 11:55] Michael Widenius
I have now updated the documentation regarding this.