-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
executor: fix escape for select into outfile #19661
Conversation
/uncc @lzmhhh123 |
/cc @qw4990 , @SunRunAway |
52518df
to
2958d1d
Compare
/run-all-tests |
1 similar comment
/run-all-tests |
/run-unit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What about other special characters like \r\n? |
What do you mean? If they are used as line terminator, then it will be appended, if they appeared in a string, they will probably be enclosed (otherwise, we can't do anything). Tested in MySQL:
TiDB:
|
/cc @breeswish |
@ichn-hu Thank you for pointing out! Could you further verify that the results of the following statements are identical? CREATE TABLE `tx` (
`a` varbinary(20) DEFAULT NULL
);
insert into tx values ('d","e",');
insert into tx values (unhex("00"));
insert into tx values ("\r\n\b\Z\t");
insert into tx values (null);
select * from tx into outfile '~/1.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\n'; |
15e6294
to
8caefb0
Compare
/run-all-tests |
1 similar comment
/run-all-tests |
/run-sqllogic-test-1 |
/run-all-tests |
/run-unit-test |
/run-check-dev |
/run-all-tests |
/run-all-tests |
/run-unit-test |
/run-unit-test |
/run-check-dev |
/run-all-tests |
/run-all-tests |
/run-all-tests |
/run-all-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #19905 |
What problem does this PR solve?
Issue Number: close #19517
Problem Summary:
SelectInto executor does not handle escape.
What is changed and how it works?
Proposal: xxx
What's Changed:
Added the handling, and also some more test cases.
How it Works:
Scan the field, and add escape.
Related changes
Check List
Tests
Side effects
Release note