Skip to content

Fix ALL, ANY and SOME with a subquery in UPDATE and DELETE (#3199) - #3202

Merged
mathiasrw merged 2 commits into
AlaSQL:mainfrom
sniwas:fix/quantified-subquery-dml
Dec 2, 2026
Merged

mathiasrw merged 2 commits into
AlaSQL:mainfrom
sniwas:fix/quantified-subquery-dml

Conversation

@sniwas

@sniwas sniwas commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closes #3199

UPDATE and DELETE with > ALL, = ANY or SOME over a subquery threw TypeError: Cannot read properties of undefined (reading 'queriesfn'). The generated code for these read this.query.queriesfn, which does not exist when the function is bound to the statement. It now reads this.queriesfn, as IN and NOT IN already do.

This also covers the same subqueries in UPDATE ... SET. A correlated subquery in UPDATE or DELETE that refers to the outer row still fails (reading 'a'), as it does with IN on main; that is not changed here.

Tested on Windows with Bun:

  • test/test3199.js: 3 cases, failing before the change and passing after.
  • Full bun test run: 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).
  • SELECT list, HAVING, JOIN ... ON, CASE, nested, correlated, view, derived table and INSERT ... SELECT uses of these operators gave the same output before and after in a throwaway script.
  • Prettier check on the changed files passes.

Not run: the parser build step (the grammar is unchanged) and browser builds.

@mathiasrw
mathiasrw merged commit de6b53f into AlaSQL:main Dec 2, 2026
15 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.

ALL, ANY or SOME with a subquery in UPDATE or DELETE throws a TypeError

2 participants