agensgraph
agensgraph copied to clipboard
Unexpected Error with Variable Length Relationships in Cypher Query
Environment
Agensgraph commit version: a706a3966f676cc04bd285af1d2c44e4e23736cf Operating System: Ubuntu22.04 Installation Method: source code compilation
Step to reproduce
When execute:
OPTIONAL MATCH (n3)-[m0*1..1]->(n3:L5)<-[m1*1..2]-(n5) WHERE length(m0)=1 AND length(m1)=1 WITH n3, n5 RETURN *;
it results in the following error:
ERROR: column "n3" does not exist
But when I execute a simple version as below:
OPTIONAL MATCH (n3)-[]->(n3 :L5)<-[]-(n5) RETURN *;
it returns empty result
Analysis
The difference between the first query and the second is that the former converts the edges into variable length relationships and uses a WITH clause to eliminate side effects, but it returns an error.