Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply bindvars to subqueries #871

Merged
merged 2 commits into from
Mar 14, 2022
Merged

Apply bindvars to subqueries #871

merged 2 commits into from
Mar 14, 2022

Conversation

max-hoffman
Copy link
Contributor

Cherry pick from #795 to fix Subquery bindvars specficially.

Copy link
Member

@zachmu zachmu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix

// TransformUpWithOpaque applies a transformation function to the given tree from the bottom up, including through
// opaque nodes. This method is generally not safe to use for a transformation. Opaque nodes need to be considered in
// isolation except for very specific exceptions.
// TODO: a better way to do this might be to keep the WITH nodes around until the very end of anlysis, so that
Copy link
Member

Choose a reason for hiding this comment

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

Remove this TODO, doesn't make sense in isolation


return TransformUpWithOpaque(n, func(node sql.Node) (sql.Node, error) {
switch n := node.(type) {
case *IndexedJoin:
Copy link
Member

Choose a reason for hiding this comment

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

This seems misplaced, left over from other PR?

}
return e, nil
return TransformExpressionsUp(node, fixBindings)
Copy link
Member

Choose a reason for hiding this comment

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

Should be a default label rather than outside the switch

@max-hoffman max-hoffman merged commit 3255d25 into main Mar 14, 2022
@Hydrocharged Hydrocharged deleted the max/bindvar-subq branch April 6, 2022 07:39
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.

2 participants