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

sqlc.arg(key) in subquery is not replaced with placeholder #2403

Closed
nobuyo opened this issue Jul 5, 2023 · 0 comments · Fixed by #2414
Closed

sqlc.arg(key) in subquery is not replaced with placeholder #2403

nobuyo opened this issue Jul 5, 2023 · 0 comments · Fixed by #2414
Assignees
Labels
Milestone

Comments

@nobuyo
Copy link

nobuyo commented Jul 5, 2023

Version

1.18.0

What happened?

When generating query.sql.go, if there is a subquery in the query and one arg is used multiple times, the sqlc.arg in subquery is not expanded to a placeholder.

I've attached the playground url, thanks!

Relevant log output

No response

Database schema

No response

SQL queries

No response

Configuration

No response

Playground URL

https://play.sqlc.dev/p/4db6630bb57b14ff1913c150a2c0140e9eb4e587f54e93586f430e99681ae83b

Edit: add outer parenthesis to subquery, then it works.

https://play.sqlc.dev/p/8f4de494021b1db7476e47349f46a8d773575ef495399a5af5441cde3e9b41ae

What operating system are you using?

Linux

What database engines are you using?

MySQL

What type of code are you generating?

Go

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

Successfully merging a pull request may close this issue.

3 participants