Given the graph constructed by:
CREATE ({x:1})-[:R]->({x:2})-[:R]->({x:3})
The query
MATCH ()-[r]->() WITH r MATCH (a)-[r]->(b) RETURN a, b
Should return the endpoints of each of the two r edges one time. Instead, we generate the execution plan:
1) "Results"
2) " Project"
3) " Conditional Traverse | (a)-[r]->(b)"
4) " All Node Scan | (a)"
5) " Project"
6) " Conditional Traverse | (anon_0)-[r]->(anon_1)"
7) " All Node Scan | (anon_0)"
Wherein the scan at line 4 also acts as a Cartesian product, and the r traversed at 3 is not influenced by that at 6. Each pair of endpoints is returned twice.
One of the misbehaviors caused by this issue is a memory leak on WITH-projected edge lists. (This scenario happens to pass because the LIMIT 1 blocks the implicit Cartesian product, but is not actually supported.) In this case, the variable-length traversal believes it should populate the edge value rs, and in doing so overwrites the heap-allocated list actually held at rs.
Given the graph constructed by:
CREATE ({x:1})-[:R]->({x:2})-[:R]->({x:3})The query
MATCH ()-[r]->() WITH r MATCH (a)-[r]->(b) RETURN a, bShould return the endpoints of each of the two
redges one time. Instead, we generate the execution plan:Wherein the scan at line 4 also acts as a Cartesian product, and the
rtraversed at 3 is not influenced by that at 6. Each pair of endpoints is returned twice.One of the misbehaviors caused by this issue is a memory leak on WITH-projected edge lists. (This scenario happens to pass because the
LIMIT 1blocks the implicit Cartesian product, but is not actually supported.) In this case, the variable-length traversal believes it should populate the edge valuers, and in doing so overwrites the heap-allocated list actually held atrs.