Skip to content

Conversation

@mccanne
Copy link
Collaborator

@mccanne mccanne commented Oct 26, 2025

This commit addresses an unfinished aspect of subqueries when they are invoked from resursive functions. Previously, the subquery would incorrectly block as Eval() is called concurrently violating our invariant.

The fix is to keep a stack of non-shared subquery instances that can be used when recursion is detected. This involves calling the rungen builder from the runtime whenever we need a new instance, which turned out to be surprisingly easy to implement.

Fixes #6211

This commit fixes a bug where a conditional expression was causing
a fatal error if either branch of the conditional had a type error.
The fix is to report an error only when both branches have errors.
This commit addresses an unfinished aspect of subqueries when they
are invoked from resursive functions.  Previously, the subquery would
incorrectly block as Eval() is called concurrently violating our invariant.

The fix is to keep a stack of non-shared subquery instances that can
be used when recursion is detected.  This inovlves calling the rungen
builder from the runtime whenever we need a new instance, which turned
out to be surprisingly easy to implement.
Base automatically changed from checker-cond-expr to main October 28, 2025 02:33
@mccanne mccanne merged commit bec8934 into main Oct 28, 2025
3 checks passed
@mccanne mccanne deleted the recursive-subquery branch October 28, 2025 02:36
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.

Subqueries inside recursive functions can cause deadlock

3 participants