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

Fix some bugs in toEdgeQL when using e.with #1154

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Conversation

jaclarke
Copy link
Member

Reported on discord: https://discord.com/channels/841451783728529451/1313928437886619738

Fix 1:
While debugging realised the original query is incorrect: the expressions being added to the with block can't reference the select expression the with block is attached to, as that select can't be hoisted into a var in it's own with block. The expression tree walker was not checking for this case (an expr's parent also being one of its child exprs), which could cause an infinite loop in toEgdeQL.

Fix 2:
We check in toEdgeQL that all the places where a repeated expr is used exist within the scope of the with block it's being hoisted to. Here we were incorrectly not considering expressions already explicitly bound to that with block to be valid scopes.

@jaclarke jaclarke requested a review from scotttrinh December 11, 2024 17:10
Copy link
Collaborator

@scotttrinh scotttrinh left a comment

Choose a reason for hiding this comment

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

👏

I'd like to also produce better error output to help troubleshoot these, but let's do that as a separate PR.

@jaclarke jaclarke merged commit d153164 into master Dec 11, 2024
10 checks passed
@jaclarke jaclarke deleted the update-nested-with branch December 11, 2024 20:00
@jaclarke
Copy link
Member Author

👏

I'd like to also produce better error output to help troubleshoot these, but let's do that as a separate PR.

Opened an issue for this: #1155

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