Skip to content

Read a column found in two tables from the first table inside a built-in function, as in 4.22.0 - #2930

Merged
mathiasrw merged 17 commits into
fix/2917from
fix/ambiguous-func-column-rollup
Nov 19, 2026
Merged

mathiasrw merged 17 commits into
fix/2917from
fix/ambiguous-func-column-rollup

Conversation

@mathiasrw

Copy link
Copy Markdown
Member

The same adjustment as #2929, for the ES6 train. #2926 lets a bare column inside a built-in function resolve to the table that has it, but a column found in two tables then throws where 4.22.0 read it from the first table. That is a breaking change we did not mean to make in 4.x.

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 #2926. Test H in test/test2917.js now checks the first-table reading in both FROM orders, instead of expecting the error. The full suite passes.

Rejecting the ambiguous column is tracked for the next major version in #2928.

komal0000 and others added 5 commits October 29, 2026 20:26
…lose #2877 and close #2791 (#2683)

Since DEFAULT can be used as a name, `UPDATE t SET a = DEFAULT` and
`INSERT INTO t VALUES (DEFAULT, ...)` read it as a column named
`default`. UPDATE wrote undefined and INSERT threw a TypeError.

The grammar now reads DEFAULT on its own in SET and in VALUES as a
DefaultValue node. UPDATE writes the column default (NULL when the column
has none), and INSERT leaves the column out so the table default fills it.
A quoted [default] is still a column.
@mathiasrw
mathiasrw added this pull request to stack #2927 October 29, 2026 10:07
komal0000 and others added 4 commits November 1, 2026 13:03
A correlated IN, NOT IN, ALL/ANY/SOME or EXISTS subquery in HAVING got the
group row as its outer scope, so t1.a read from an undefined t1 and threw.
These subqueries now get the group's source row, keyed by table alias, the
same way a scalar subquery in HAVING already does. WHERE is unchanged.
Add INSERT ... SET, expression default, IDENTITY and NOT NULL test case as suggested in #2921.
@mathiasrw mathiasrw added this to the v4.x Focus milestone Nov 9, 2026
@mathiasrw mathiasrw closed this Nov 19, 2026
@mathiasrw
mathiasrw merged commit 8b003d2 into main Nov 19, 2026
20 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.

5 participants