Repository navigation
Fix ALL, ANY and SOME with a subquery in UPDATE and DELETE (#3199) - #3202
Merged
Merged
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.
Closes #3199
UPDATEandDELETEwith> ALL,= ANYorSOMEover a subquery threwTypeError: Cannot read properties of undefined (reading 'queriesfn'). The generated code for these readthis.query.queriesfn, which does not exist when the function is bound to the statement. It now readsthis.queriesfn, asINandNOT INalready do.This also covers the same subqueries in
UPDATE ... SET. A correlated subquery inUPDATEorDELETEthat refers to the outer row still fails (reading 'a'), as it does withINonmain; that is not changed here.Tested on Windows with Bun:
test/test3199.js: 3 cases, failing before the change and passing after.bun testrun: 3042 pass, 211 skip, 11 fail. The run without the change had the same failures apart from the new tests (Test 107-B Excel cases, and a CLI case that differs from run to run).HAVING,JOIN ... ON,CASE, nested, correlated, view, derived table andINSERT ... SELECTuses of these operators gave the same output before and after in a throwaway script.Not run: the parser build step (the grammar is unchanged) and browser builds.