Skip to content

Set SubqueryAlias.OuterScopeVisibility to true if inside trigger scope#3342

Merged
angelamayxie merged 4 commits intomainfrom
angela/view_triggers
Dec 12, 2025
Merged

Set SubqueryAlias.OuterScopeVisibility to true if inside trigger scope#3342
angelamayxie merged 4 commits intomainfrom
angela/view_triggers

Conversation

@angelamayxie
Copy link
Copy Markdown
Contributor

@angelamayxie angelamayxie commented Dec 12, 2025

Fixes dolthub/dolt#10175

Trigger scopes were being included when determining exec indexes for SubqueryAlias child nodes but were not actually passed down to child iterators during rowexec (code). As a result, we were getting index out of bounds errors since the trigger scopes were not included in the parent row.

Since there's no easy way to separate the trigger scope columns out from the rest of the parent row during rowexec, it was easier to just mark SubqueryAlias.OuterScopeVisibility inside triggers to true. I think it technically does make sense here because the trigger scope is an outer scope that the SubqueryAlias does have visibility of, but I added a TODO comment in case this is incorrect.

Copy link
Copy Markdown
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

@angelamayxie angelamayxie marked this pull request as ready for review December 12, 2025 23:52
@angelamayxie angelamayxie merged commit 4422a1c into main Dec 12, 2025
11 of 15 checks passed
@angelamayxie angelamayxie deleted the angela/view_triggers branch December 12, 2025 23:53
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.

Unable to find field with index ... in row of ... columns

2 participants