Skip to content

Query params not generated for limit/offset with UNION ALL #2611

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

Closed
andrewmbenton opened this issue Aug 14, 2023 · 0 comments · Fixed by #2613
Closed

Query params not generated for limit/offset with UNION ALL #2611

andrewmbenton opened this issue Aug 14, 2023 · 0 comments · Fixed by #2613

Comments

@andrewmbenton
Copy link
Collaborator

andrewmbenton commented Aug 14, 2023

          This is a rare case. I think fixing this issue is very low priority.

When using UNION ALL in mysql, a problem occurred when LIMIT ? OFFSET ? was specified.
Specifically, Limit is not added to the Params field.
The version I checked is "sqlc v1.15.0"

-- name: ListAuthors :many
SELECT * FROM authors
WHERE country = 'DE'
UNION ALL
SELECT * FROM authors2
WHERE country = 'US'
LIMIT ? OFFSET ?;

Originally posted by @subc in #1665 (comment)

Here's a playground URL: https://play.sqlc.dev/p/1d2500a755be62afea94857e1b060343e71d993152f37a14dde691688f8981e8

orisano added a commit to orisano/sqlc that referenced this issue Aug 14, 2023
kyleconroy pushed a commit that referenced this issue Aug 28, 2023
…ith `UNION ALL` (#2613)

* fix(engine/dolphin): Fixed problem that LIMIT OFFSET cannot be used with `UNION ALL`

close #2611

* test: update endtoend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant