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

Include the With clause in walked subtrees for Select statements #284

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

fulghum
Copy link

@fulghum fulghum commented Oct 20, 2023

We weren't walking the With clause for select statements, which caused us to not find any bind vars in use there.

Related to: dolthub/dolt#6852

@fulghum fulghum requested a review from zachmu as a code owner October 20, 2023 18:03
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

Copy link

@max-hoffman max-hoffman left a comment

Choose a reason for hiding this comment

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

The only potential issue is that I thought string formatting used the subtree walk to round trip string -> AST -> string. So if that worked before, I'm wondering if we need to delete something from the SELECT stringer

@fulghum
Copy link
Author

fulghum commented Oct 20, 2023

The only potential issue is that I thought string formatting used the subtree walk to round trip string -> AST -> string. So if that worked before, I'm wondering if we need to delete something from the SELECT stringer

Thanks for raising the potential concern. I poked around at this a bit and I don't think there are any issues. The Walk function is only used in a few places. The only use in Vitess is to identify bind vars, then we have a couple uses in GMS: one for finding bind vars, and one that searches for AliasedTableExpr, and one in the analyzeHaving function. I didn't see any problems with those usages and will keep an eye on the GMS and Dolt tests as this goes through.

@fulghum fulghum merged commit ef26be7 into main Oct 20, 2023
4 checks passed
@fulghum fulghum deleted the fulghum/dolt-6852 branch October 20, 2023 18:33
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.

3 participants