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

Problem when deparsing Queries with UNION #129

Closed
primeapple opened this issue Feb 22, 2019 · 1 comment
Closed

Problem when deparsing Queries with UNION #129

primeapple opened this issue Feb 22, 2019 · 1 comment

Comments

@primeapple
Copy link

primeapple commented Feb 22, 2019

And another one:

"SELECT * FROM "test" UNION SELECT * FROM "test2""
We have the (quite stupid) query:

WITH test AS (SELECT * FROM student),
test2 AS (SELECT * FROM student)
SELECT * FROM test
UNION
SELECT * FROM test2
ORDER BY id DESC

When we parse and deparse this query we get something very very funny:

SELECT * FROM "test" UNION SELECT * FROM "test2"

Now this is amazing. It seems, that when you deparse something with UNION, you forget everything else (WITH, ORDER BY, probably HAVING, ...)

@lfittl
Copy link
Member

lfittl commented Jul 1, 2019

Fixed by 823155c

@lfittl lfittl closed this as completed Jul 1, 2019
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