Skip to content

Fix panic for DELETE with JOIN on subquery #4023

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
merged 1 commit into from
Aug 2, 2025

Conversation

gwillem
Copy link
Contributor

@gwillem gwillem commented Jul 17, 2025

Fixes #3848

This would create a panic:

DELETE pt
FROM primary_table pt
JOIN (SELECT 1 as id) jt ON pt.id = jt.id;
panic: expected range var

github.com/sqlc-dev/sqlc/internal/engine/dolphin.convertToRangeVarList(0x140000669c0?, 0x140008f0390)

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 17, 2025
@kyleconroy kyleconroy merged commit eb4b0b5 into sqlc-dev:main Aug 2, 2025
8 checks passed
@gwillem gwillem deleted the wdg/fix-delete-join-subquery branch August 3, 2025 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete query with join returns panic: expected range var error
2 participants