Bug #1704 Load Data Infile does not use Ignore Lines with Fixed Width
Submitted: 29 Oct 2003 12:32 Modified: 13 Dec 2003 4:34
Reporter: Dean Ellis Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.0.16 OS:
Assigned to: Michael Widenius CPU Architecture:Any

[29 Oct 2003 12:32] Dean Ellis
Description:
LOAD DATA INFILE when used with a fixed-width file does not use the IGNORE x LINES option, even with specified LINES TERMINATED BY.

How to repeat:
USE test;
CREATE TABLE testing ( a int, b int, c int, d int );
INSERT INTO testing VALUES (1,2,3,4),(5,6,7,8);
SELECT * INTO OUTFILE '/tmp/testing' FIELDS TERMINATED BY '' ENCLOSED BY '' FROM testing;

Edit /tmp/testing and add fixed-width headings to the top of the file.

LOAD DATA INFILE '/tmp/testing' INTO TABLE testing FIELDS TERMINATED BY '' ENCLOSED BY '' IGNORE 1 LINES;

It will attempt to insert the headings.  Behaviour is identical if you specify a line terminator.

Suggested fix:
n/a
[13 Dec 2003 4:34] Michael Widenius
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

Fix will be in 4.0.17