fix(compiler): correctly validate alias in order/group by clauses for joins#2537
Merged
kyleconroy merged 2 commits intomainfrom Jul 28, 2023
Merged
fix(compiler): correctly validate alias in order/group by clauses for joins#2537kyleconroy merged 2 commits intomainfrom
kyleconroy merged 2 commits intomainfrom
Conversation
Collaborator
Author
|
I think this resolves the referenced issues and pull request, but there is still a subtle bug (not new). The following query runs fine with psql but sqlc still gets confused even with the patch in this PR applied. SELECT a.name AS name
FROM authors a JOIN authors b ON a.id = b.id
ORDER BY name;Here's a playground link for v1.19.1: https://play.sqlc.dev/p/8648bbce740f0f059549e4e50e75bd073443080be5e5d12fd68aa5699f1b0c72 I think I'll create a new issue for this unless I can resolve it quickly. |
Contributor
|
FWIW, let's merge this one instead of #2399. Just my 2c |
kyleconroy
approved these changes
Jul 28, 2023
alfonsodev
pushed a commit
to ExponentiaTeam/sqlc
that referenced
this pull request
Oct 13, 2025
… joins (sqlc-dev#2537) * fix(compiler): correctly validate alias in order/group by clauses for joins Resolves sqlc-dev#1886 Resolves sqlc-dev#2398 Resolves sqlc-dev#2399 * remove dead code and split up test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1886
Resolves #2398
Resolves #2399