Repository navigation
fix-join-without-on-clause-panic - #794
Merged
Merged
Conversation
A JOIN with no ON clause crashed plan building with a nil pointer dereference in the early-analysis visitor. Guard the nil ON expression in the two unguarded visitors and render a condition-less inner join as CROSS JOIN so both sqlite and postgres accept it. Adds a robot scenario that joins two provider tables with the condition in WHERE. Fixes #793 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
general-kroll-4-life
approved these changes
Sep 25, 2026
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.
Summary
Fixes #793.
A
JOINwith noONclause crashed plan building with an unrecovered nil pointer dereference in the early-analysis visitor (ast_expand.go), taking downshell,srvand MCP sessions.CROSS JOINhit the same path because the parser folds it into the plain join string.Changes:
earlyanalysis/ast_expand.go: guard the nilOnexpression before visiting it, matching the convention already used in the other visitors.astvisit/param_extract.go: same guard on the one remaining unguardedCondition.On.Acceptcall.astvisit/from_rewrite.go: render a condition-less inner join asCROSS JOINinstead of emitting a danglingON. Postgres rejects a bareJOINwithoutON, sqlite treats it as a cross join, so spelling it out keeps both backends happy. The hoisted-parameterON ( placeholder )path is preserved when the planner injects one.Behaviour:
JOINwithoutONis now a cross join, as in sqlite, so the join condition can live inWHERE.Test plan
Inner Join Without ON Clause Is Treated As Cross Joinin the mocked functional suite: joinsaws.iam.userstogoogleadmin.directory.userswith the condition inWHERE, with sqlite and postgres input variants. Verified locally that it panics on the unpatchedmainbinary and passes with this change.homebrewprovider for the issue's exact query, the no-WHEREform, explicitCROSS JOIN, and theON 1 = 1control.golangci-lint(pinned 2.5.0) clean on the touched packages;go testgreen forastanalysis/....🤖 Generated with Claude Code