Skip to content

Commit

Permalink
starting by and terminated by can appear in an order and any number o…
Browse files Browse the repository at this point in the history
…f times
  • Loading branch information
James Cor committed Dec 31, 2024
1 parent 6c50e01 commit beb559e
Show file tree
Hide file tree
Showing 3 changed files with 6,614 additions and 6,529 deletions.
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

0 comments on commit beb559e

Please sign in to comment.