Bug #35766 LOAD OPTIONALLY ENCLOSED BY prematurly terminates

Submitted: 2 Apr 2008 10:05 Modified: 2 Apr 2008 19:09
Reporter: Lars Johansson Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S3 (Non-critical)
Version:5.1.22, 4.1, 5.0, 5.1, 6.0 BK OS:Linux (Mandriva 2008 )
Assigned to: CPU Architecture:Any
Tags: load

[2 Apr 2008 10:05] Lars Johansson
Description:

 LOAD DATA LOCAL INFILE 'VBKD.CSV' replace INTO TABLE VBKD FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' IGNORE 0 LINES(`VBELN`,`POSNR`,`KURSK`,`BSTKD`,`BSTKD_E`,`BSTDK`,`FKDAT`);

If a field is enclosed by " and there is a space between the closing " and ;
e.g. ;"GRIEKSPOOR" ;
the load is terminated after the line is loaded.

How to repeat:
use test;

CREATE TABLE IF NOT EXISTS VBKD (`VBELN` CHAR(10),`POSNR` DECIMAL(6),`KURSK` DECIMAL(9,5),`BSTKD` CHAR(35),`BSTKD_E` CHAR(35),`BSTDK` DATE,`FKDAT` DATE

 ,primary key (`VBELN`,`POSNR`));
 truncate table VBKD;
 LOAD DATA LOCAL INFILE 'VBKD.CSV' replace INTO TABLE VBKD FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' IGNORE 0 LINES(`VBELN`,`POSNR`,`KURSK`,`BSTKD`,`BSTKD_E`,`BSTDK`,`FKDAT`);

loading the following infile will terminate after 2 rows, not 4!

0000050822;000000;1.00000;652404                             ;66310304                           ;20040324;20040324
0000050823;000000;1.00000;652406                             ;"GRIEKSPOOR" ;20040324;20040324
0000050824;000000;1.00000;652408                             ;                                   ;20040324;20040324
0000050825;000000;1.00000;652407                             ;1501204725                         ;20040324;20040324
[2 Apr 2008 19:09] Sveta Smirnova
Thank you for the report.

Verified as described.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.042 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.