You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
readyset-sql-passes: Fix schema resolution in JOIN ON conditions
When an unqualified table reference appears in a JOIN ON condition,
it should resolve to the schema of the table being joined rather than
defaulting to the first matching table in the search path.
Previously, with a query like:
SELECT d.id FROM s2.t1 d LEFT JOIN s2.t2 ON d.id = t2.d_id
And a search path of [s1, s2], the unqualified "t2" in the ON clause
would incorrectly resolve to s1.t2 (first in search path) instead of
s2.t2 (the table actually being joined).
This patch tracks schemas from explicitly-qualified tables in the
JOIN context and checks this context before falling back to search
path resolution. This ensures unqualified table references in JOIN
ON clauses correctly bind to the tables being joined, matching SQL
semantics.
AI-Use: level:3
Release-Note-Core: Fixed incorrect schema resolution for unqualified
tables in JOIN ON clauses when multiple schemas contain tables with
the same name.
Change-Id: I180c27b9f3eec6096ce4ea14c959ab51d334bf0a
Reviewed-on: https://gerrit.readyset.name/c/readyset/+/11239
Tested-by: Buildkite CI
Reviewed-by: Vassili Zarouba <vassili@readyset.io>
0 commit comments