thatdot / quine

Quine • a streaming graph • https://quine.io • Discord: https://discord.gg/GMhd8TE4MR
https://quine.io
Other
295 stars 39 forks source link

Cypher: fix scoping around subqueries #13

Closed harpocrates closed 2 years ago

harpocrates commented 2 years ago

Previously, subqueries would just extend the existing scope. That's not the expected Cypher behaviour though - the expectation is that only imported columns (the WITH inside the CALL) get pulled in. In addition, the subquery in the CALL { .. } can be the union of queries that import different subsets of variables from the outer scope!

All this requires a change to the internal Query.SubQuery IR and its semantics as well as tracking scope much more carefully in the presence of subqueries (eg. to remove variables from scope).