core: ignore rowid-less tables and prevent stale rowids or duplicate FULL JOIN rows - #8553
Draft
Pavan-Nambi wants to merge 2 commits into
Draft
core: ignore rowid-less tables and prevent stale rowids or duplicate FULL JOIN rows#8553Pavan-Nambi wants to merge 2 commits into
Pavan-Nambi wants to merge 2 commits into
Conversation
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.
todo:
open pre-existing bugs claude found during adversial review as issues. , seperate into multiple commits perhaps(?)
what
Unqualified rowid references were treated as ambiguous whenever multiple tables appeared in the FROM clause, even if only one table had a visible rowid:
SQLite returns 1. Turso returned ROWID is ambiguous.
Rowid lookup also missed eligible tables in outer query scopes, and outer columns could incorrectly take precedence over result aliases.
FULL OUTER hash joins had a related problem. Null-extending the build side left the previous rowid cached, so unmatched rows could expose a stale rowid. When the hash table spilled, deferred probe rows also took the normal miss path before grace processing and could be emitted twice.
Fix
Resolve real columns first, then consider only tables with a visible implicit rowid in the nearest query scope. Check result aliases before outer scopes, and derive virtual-table rowid visibility from their
declared schema.
Give HashProbe separate branches for true misses and rows deferred to grace processing. Clear the cached build rowid before emitting unmatched FULL JOIN rows.
AI disclosure
used claude for review and tests