You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got this to work by using regular ? parameters inside of named parameters. The MySQL parser we're using is not happy with function calls after LIMIT and OFFSET
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 ?;
Activity
kyleconroy commentedon Jun 10, 2022
I got this to work by using regular
?parameters inside of named parameters. The MySQL parser we're using is not happy with function calls afterLIMITandOFFSEThttps://play.sqlc.dev/p/ac63085049628c6b20fd85479e03ea071df9e42f5224a025863f7b6adba84ab4
rhodee commentedon Jun 10, 2022
Noted. I think this can be closed. I was hoping to use the
sqlc.argmethod but this is fine. Thank you @kyleconroysubc commentedon Apr 2, 2023
This is a rare case. I think fixing this issue is very low priority.
When using
UNION ALLin mysql, a problem occurred whenLIMIT ? OFFSET ?was specified.Specifically, Limit is not added to the
Paramsfield.The version I checked is "sqlc v1.15.0"
andrewmbenton commentedon Aug 14, 2023
Closing since this is very old and the workaround seems acceptable until and unless the upstream parser is changed.
I created a new issue (#2611) for the
UNION ALLbug.