[MDEV-11631] LOAD DATA INFILE fails to load data with an escape character followed by a multi-byte character Created: 2016-12-22  Updated: 2017-01-09  Resolved: 2017-01-09

Status: Closed
Project: MariaDB Server
Component/s: Character Sets
Affects Version/s: 5.5.52, 5.5.53
Fix Version/s: 5.5.55, 10.0.29, 10.1.21

Type: Bug Priority: Major
Reporter: Richard Stracke Assignee: Sergei Golubchik
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-11343 LOAD DATA INFILE fails to load data w... Closed

 Description   

Bug MDEV-11343 still exist in 5.5.52 and 5.5.53

Same steps to reproduce

echo "\ä" >/tmp/test.txt

Now I try to load this file into a table:

DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET utf8);
LOAD DATA INFILE '/tmp/test.txt' INTO TABLE t1 CHARACTER SET utf8;

It fails with this error:

ERROR 1300 (HY000): Invalid utf8 character string: ''



 Comments   
Comment by Alexander Barkov [ 2016-12-22 ]

I'm somewhat afraid of backporting it to 5.5.

The LOAD code has always been very fragile. Fixing one problem often introduced another problem. So in 10.2 we completely rewrote it. Hopefully starting from 10.2 it will work fine.

When we backported an extraction of the 10.2 patch to 10.0/10.1, it was a partial backport only, so some unexpected side effects are possible when the old code fragments are involved. Backporting it to 5.5 makes the things even more dangerous.

Comment by Alexander Barkov [ 2016-12-22 ]

dangerous to backport to 5.5.

Comment by Sergei Golubchik [ 2017-01-04 ]

still need to test if it's fixed by the latest 5.5 merge and add a test case

Comment by Alexander Barkov [ 2017-01-09 ]

The patch c3cf7f47f0f4a1ec314001aaf0c3d9c1c1f62097 fixed this problem.
Added a test case into 5.5.

Generated at Thu Feb 08 07:51:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.