Skip to content

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

Closed
@andrewmbenton

Description

@andrewmbenton
          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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions