Skip to content
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

server: add test for LOAD DATA #10901

Closed
wants to merge 1 commit into from
Closed

Conversation

imtbkcat
Copy link

What problem does this PR solve?

TiDB cannot support LOAD DATA sql which fields terminated by hex expression.

load data local infile '/home/pingcap/jeff-test/merchant.dmp' into table `merchant` fields terminated by X'01'
2018/06/29 13:29:22.709 conn.go:481: [warning] [8448] dispatch error:

parser pr: pingcap/parser#365

What is changed and how it works?

Add hexLit and binaryLit for FieldTerminator, and convert hex expression to string during parsing.

After:

mysql> load data local infile '~/1.csv' into table t_sp FIELDS TERMINATED BY X'2C2C2C2C' enclosed by '"';
Query OK, 3 rows affected (0.00 sec)
Records: 3  Deleted: 0  Skipped: 0  Warnings: 0

Check List

Tests

  • Unit test

Code changes

  • None

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

@imtbkcat imtbkcat requested review from jackysp and lysu June 21, 2019 07:52
@imtbkcat imtbkcat closed this Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant