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

fix starting by and terminated by order #393

Merged
merged 1 commit into from
Dec 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions go/vt/sqlparser/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5585,17 +5585,6 @@ func TestInvalid(t *testing.T) {
input: "select * from tbl into outfile 'outfile.txt' fields terminated by 'a' escaped by 'c' escaped by 'c'",
err: "syntax error",
},
{
// TODO: should work
input: "select * from tbl into outfile 'outfile.txt' lines terminated by 'e' starting by 'd'",
err: "syntax error",
},
{
// TODO: should work
input: "select * from tbl into outfile 'outfile.txt' lines starting by 'd' terminated by 'e' starting by 'd' terminated by 'e'",
err: "syntax error",
},

{
input: "select date 20010203",
err: "syntax error",
Expand Down Expand Up @@ -7573,6 +7562,14 @@ func TestLoadData(t *testing.T) {
input: "LOAD DATA INFILE '/tmp/jokes.txt' INTO TABLE jokes FIELDS TERMINATED BY '' LINES TERMINATED BY '\n%%\n' (joke)",
output: "load data infile '/tmp/jokes.txt' into table jokes fields terminated by '' lines terminated by '\n%%\n' (joke)",
},
{
input: "select * from tbl into outfile 'outfile.txt' lines terminated by 'e' starting by 'd'",
output: "select * from tbl into outfile 'outfile.txt' lines starting by 'd' terminated by 'e'",
},
{
input: "select * from tbl into outfile 'outfile.txt' lines starting by 'a' terminated by 'b' starting by 'd' terminated by 'e'",
output: "select * from tbl into outfile 'outfile.txt' lines starting by 'd' terminated by 'e'",
},
{
input: "LOAD DATA INFILE 'data.txt' INTO TABLE db2.my_table",
output: "load data infile 'data.txt' into table db2.my_table",
Expand Down
Loading