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

LOCK TABLES and UNLOCK TABLES treated as syntax errors #32

Closed
dt opened this issue May 21, 2018 · 2 comments
Closed

LOCK TABLES and UNLOCK TABLES treated as syntax errors #32

dt opened this issue May 21, 2018 · 2 comments

Comments

@dt
Copy link

dt commented May 21, 2018

Discovered while looking at mysqldump's default output, which contains a couple things that currently cause syntax errors.

A mysqldump file consists of SQL statements that create tables and insert rows into them. By default it places LOCK TABLES and UNLOCK TABLES statements around its inserts, but currently these are not handled by the parser.

@sjezewski
Copy link

Similar issue ... trying to parse the output generated by a single table pgdump, the COPY statment is treated as a syntax error:

COPY public.company (id, name, age, address, salary) FROM stdin;
1	alice	100	1234 acme st                                      	1000000
2	bill	100	12345 acme st                                     	10000.0234
3	dakota	10	666 acme st                                       	100.023399
\.

Results in syntax error at position 5 near 'COPY'

@dt
Copy link
Author

dt commented Jul 31, 2018

I added LOCK and UNLOCK to upstream vitess last month, so this can probably close since that'll filter down here when it rebases.

@sjezewski I doubt you'll have too much luck using this library to read pgdump output since it targets mysql dialect rather than postgres dialect SQL, and as you found, postgres-isms like COPY protocol will fail to parse. You might want to look for a postgres dialect parser?

@dt dt closed this as completed Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants