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

unions after cte aren't parsed properly #176

Closed
Appalled opened this issue Jul 4, 2023 · 2 comments · Fixed by #178 or #180
Closed

unions after cte aren't parsed properly #176

Appalled opened this issue Jul 4, 2023 · 2 comments · Fixed by #178 or #180

Comments

@Appalled
Copy link

Appalled commented Jul 4, 2023

Dear tree-sitter-sql developer,
Unions after cte aren't parsed properly, here are two examples. Please have a look.

with tb2 as (
  SELECT * FROM tb1
)
(
  (SELECT * FROM tb2)
  UNION
  (SELECT * FROM tb2)
)
;

with tb2 as (
  SELECT * FROM tb1
)
(SELECT * FROM tb2)
UNION
(SELECT * FROM tb2)
;

@matthias-Q
Copy link
Collaborator

Thanks for reporting. The issues are the brackets, not the unions. Will take a closer look tomorrow.

@Appalled
Copy link
Author

Thanks for reporting. The issues are the brackets, not the unions. Will take a closer look tomorrow.

Thanks for your swift response. The forked nvim-treesitter I use is not always in sync with the upstream, so my feedback maybe a little laggy. Previous examples got fixed, while I found another problem. Please have a look:

SELECT 
a1.*
FROM (
  SELECT * FROM tb01
  UNION ALL
  SELECT * FROM tb01
) a1
;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants