-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
load data bug #22735
Comments
The case is: the csv file ends with '\n'. You can confirm this by check the file size: 20B |
Hi @zoujia-cm ,& @tohghua Since the behavior is the same as MySQL, I don't think it should be fixed. Do you agree with me? |
+1 |
+2 |
fundamentally agree with you |
Sure @zoujia-cm , I will close this issue for now. Thanks for pointing out it! BTW you can join our Slack channel for the discussions of related bugfixes/improvements of TiDB. |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions6. Fixed versions |
Bug Report
create a table:
create table ct(ch varchar(255), ch2 varchcar(255));
I have a csv file under /root directory, it's content like:
'ss','ee'|'rr','ss'
When I execute:
load data local infile '/root/test.csv' into table ct fields terminated by ',' enclosed by '\'' lines terminated by '|' (ch,ch2);
'ss' is stored as 'ss'\n.
when I execute :
select * from ct;
the output like:
+-------+-------+
| ch | ch2 |
+-------+-------+
| ss | ee |
+-------+-------+
| rr | 'ss'
|
+-------+-------+
1. Minimal reproduce step (Required)
create database test;
use test;
create table ct(ch varchar(255), ch2 varchar(255));
load data local infile '/root/test.csv' into table ct fields terminated by ',' enclosed by ''' lines terminated by '|' (ch,ch2);
2. What did you expect to see? (Required)
+----+----+
| ch | ch2|
+----+----+
| ss | ee |
+----+---+
| rr | ss |
+- --+-- -+
3. What did you see instead (Required)
+-------+-------+
| ch | ch2 |
+-------+-------+
| ss | ee |
+-------+-------+
| rr | 'ss'
|
+-------+-------+
4. What is your TiDB version? (Required)
master
5.0.0-rc
4.0.10
4.0.9
5.7.25-TiDB-v4.0.0-beta.2-2101-g17a65ab-dirty
v5.0.0-rc
The text was updated successfully, but these errors were encountered: