mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix LOAD DATA to handle having the escape and enclosed-by character
be the same. (Bug #11203) mysql-test/r/loaddata.result: Update results mysql-test/t/loaddata.test: Add new test sql/sql_load.cc: Handle having escape_char and enclosed_char the same when loading data. mysql-test/std_data/loaddata5.dat: New BitKeeper file ``mysql-test/std_data/loaddata5.dat''
This commit is contained in:
@ -66,3 +66,11 @@ a b
|
||||
3 row 3
|
||||
0
|
||||
drop table t1;
|
||||
create table t1 (a varchar(20), b varchar(20));
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
|
||||
select * from t1;
|
||||
a b
|
||||
field1 field2
|
||||
a"b cd"ef
|
||||
a"b c"d"e
|
||||
drop table t1;
|
||||
|
3
mysql-test/std_data/loaddata5.dat
Normal file
3
mysql-test/std_data/loaddata5.dat
Normal file
@ -0,0 +1,3 @@
|
||||
"field1","field2"
|
||||
"a""b","cd""ef"
|
||||
"a"b",c"d"e
|
@ -31,3 +31,11 @@ load data infile '../../std_data/loaddata4.dat' into table t1 fields terminated
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# Bug #11203: LOAD DATA does not accept same characters for ESCAPED and
|
||||
# ENCLOSED
|
||||
#
|
||||
create table t1 (a varchar(20), b varchar(20));
|
||||
load data infile '../../std_data/loaddata5.dat' into table t1 fields terminated by ',' enclosed by '"' escaped by '"' (a,b);
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user