Skip to content

Conversation

@elianddb
Copy link
Contributor

@elianddb elianddb commented Nov 26, 2025

Fixes dolthub/dolt#10113
DELETE queries with NOT EXISTS subqueries failed because EXISTS expressions did not set the refsSubquery flag. This caused DELETE queries to use a simplified analyzer batch that skipped subquery initialization, leaving subqueries without execution builders.

  • Refactor EXISTS expression building to reuse buildScalar() for *ast.Subquery, ensuring refsSubquery is set.
  • Capture the table node for simple DELETE queries before buildWhere() wraps it.
  • Separate concerns between explicit targets and implicit targets in a bool, but keep all targets in the same list to handle wrapped targets.
  • Add WithTargets() method to update targets without changing the explicit/implicit flag.
  • Fix offsetAssignIndexes() fast path to skip when virtual columns are present, using the full indexing path instead.

@elianddb elianddb changed the title Elian/10113 dolthub/dolt#10113: Fix DELETE queries with NOT EXISTS uninitialized subqueries Nov 26, 2025
Copy link
Contributor

@jycor jycor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@elianddb elianddb merged commit fb85009 into main Nov 27, 2025
8 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.

Dolt attempted to evaluate uninitialized subquery , SQL compatibility adjustment

3 participants