Skip to content

fix: range subselect alias pointer dereference #3711

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

Merged

Conversation

ahme-dev
Copy link
Contributor

@ahme-dev ahme-dev commented Nov 16, 2024

Made to solve dereference panics reported by a list of open issues (I've also seen it in my codebase):

  1. 1.26.0 crashes on subquery without alias #3337
  2. Go panics when sub query is missing an alias with sqlite #3514
  3. sqlc panics on union all with subqueries using mysql #2453

Queries and schemas combined below, none of which panic anymore on this branch.
https://play.sqlc.dev/p/f1541063c62ed9302d43b7d00eec0d487764e5ee577a43e4114ff6c654585768

@andrewmbenton
Copy link
Collaborator

andrewmbenton commented Aug 5, 2025

The third item in your list is unrelated, but the other two are valid. I will attempt to add some tests to your branch so that we can evaluate and merge.

@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 5, 2025
@andrewmbenton andrewmbenton force-pushed the fix(compiler)/alias-dereference-panic branch from 1522758 to 8e48e5d Compare August 5, 2025 05:32
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 6, 2025
@kyleconroy kyleconroy merged commit e81b1b5 into sqlc-dev:main Aug 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants