-
Notifications
You must be signed in to change notification settings - Fork 22
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
Missing quoting in 'Alias' deparse #17
Comments
I found a similar problem with SQL pg-query-parser/src/deparser.js Lines 1115 to 1119 in 1684b8f
It should be |
@benny-medflyt is this still an issue? |
if it is, make a PR to my fork and I'll merge and publish https://github.com/pyramation/pgsql-parser |
pyramation
added a commit
to pyramation/pg-query-parser
that referenced
this issue
Jun 11, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is a bug in the
deparse
function when outputting an Alias that hascolnames
. It doesn't properly quote the alias name and the column names:pg-query-parser/src/deparser.js
Lines 269 to 273 in 1684b8f
The fix is to call
this.quote
on thename
(just as is done in the "else" branch) as well asthis.quote
on all the column names.Here are 2 valid PostgreSQL queries that this library parses correctly, but deparse generates invalid output:
Incorrectly is deparsed to:
I can try to create a pull request
The text was updated successfully, but these errors were encountered: