Repository navigation
Read a column found in two tables from the first table inside a built-in function, as in 4.22.0 - #2930
Merged
Conversation
…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.
…-in function, as in 4.22.0
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.
…ed into its module
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.
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.jsnow 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.