-
Notifications
You must be signed in to change notification settings - Fork 861
incorrect ambiguous reference check #2398
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
Comments
Alias column names don't exist in the table definition. When we take it from the select target list, we only need to do this once (and not once for every table in a join statement). Refs: sqlc-dev#2398
Alias column names don't exist in the table definition. When we take it from the select target list, we only need to do this once (and not once for every table in a join statement). Refs: sqlc-dev#2398 sqlc-dev#1886
That's an interesting one. I believe this has been in the code for a while. The PR above should fix this (and also #1886 which seems to be very similar to this one here). |
Sorry for late reply, thanks for the fix! |
Version
1.18.0
What happened?
There seems to be a minor bug in checking ambiguous references when joning tables while using alias.
To reproduce, change the
sqlc/internal/endtoend/testdata/order_by_non_existing_column/postgresql
toThe column of min_price is not ambiguous but sqlc reports:
Relevant log output
Database schema
SQL queries
Configuration
No response
Playground URL
No response
What operating system are you using?
Linux
What database engines are you using?
PostgreSQL
What type of code are you generating?
Go
The text was updated successfully, but these errors were encountered: