← 输入框|github.com|刷新
Skip to content

Read a column found in two tables from the first table inside a built-in function, as before #2619 - #2929

Merged
mathiasrw merged 1 commit into
developfrom
fix/ambiguous-func-column
Oct 29, 2026
Merged

mathiasrw merged 1 commit into
developfrom
fix/ambiguous-func-column

Conversation

@mathiasrw

Copy link
Copy Markdown
Member

This adjusts a breaking change we merged by accident in #2619. That PR lets a bare column inside a built-in function (UPPER, LENGTH, TRIM and the rest) resolve to the table that has it, which fixes #2615. But a column found in both joined tables now throws Cannot resolve column "name" because it exists in two source tables, where 4.22.0 read it from the first table.

CREATE TABLE a (id INT, name STRING);
CREATE TABLE b (id INT, name STRING);
SELECT UPPER(name) FROM a JOIN b ON a.id = b.id; -- 4.22.0 reads a.name, develop throws

With this change, such a column reads the first table again inside a built-in function, and a column of one table keeps the fix from #2619. Test F in test/test2615.js covers JOIN, LEFT JOIN, a comma join and WHERE. The full suite passes.

Rejecting the ambiguous column is the right behaviour in the long run, and #2928 tracks it for the next major version.

@mathiasrw
mathiasrw merged commit 72973ef into develop Oct 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Built-in functions read an unqualified column from the first table in a JOIN

1 participant