[CONC-49] LOAD DATA LOCAL query fails to import all rows with mariadb client revision 80 Created: 2013-09-04  Updated: 2021-07-22  Resolved: 2013-09-04

Status: Closed
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Sandhya Sriraj Assignee: Georg Richter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Windows


Attachments: File sample.csv    

 Description   

LOAD DATA LOCAL query fails to import all rows. It fails after importing first row and shows warning "Data truncated for column 'c' at row 1".
It was working fine till revision 79.

Here are the details:
Table Structure:
CREATE TABLE `csv_table` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
`c` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

LOAD LOCAL QUERY:
LOAD DATA LOCAL INFILE 'C:\\Users\\XYZ\\Desktop
sample.csv' INTO TABLE `csv_db`.`csv_table` FIELDS ESCAPED BY '
' TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' (`a`, `b`, `c`);

sample.csv attached here.



 Comments   
Comment by Peter Laursen [ 2013-09-04 ]

It seems that 'Windows Linebreaks' (\r\n) are broken in revision 80 with LOAD DATA LOCAL.

Please also observe that "LINES TERMINATED BY" can specify any character sequence.
It is not restricted to 'visual linebreaks' (neither Linux, Windows nor Mac -style) actually.

Comment by Georg Richter [ 2013-09-04 ]

fixed in rev. 84

Generated at Thu Feb 08 03:02:30 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.