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

FalkorDB may output non-existent relations in OPTIONAL MATCH #755

Open
Aurora-yzj opened this issue Jul 24, 2024 · 0 comments
Open

FalkorDB may output non-existent relations in OPTIONAL MATCH #755

Aurora-yzj opened this issue Jul 24, 2024 · 0 comments

Comments

@Aurora-yzj
Copy link

Hi! I discovered that FalkorDB could return non-existent relations in the OPTIONAL MATCH clause. Steps to reproduce are as follows.

  1. Use the following queries to initialize the data:
CREATE (n0 :L1:L0{id : 0})
CREATE (n0 :L1{id : 4})
CREATE (n0 :L0:L1{id : 5})
CREATE (n0 :L0{id : 6})
MATCH (n0 {id : 4}), (n1 {id : 5}) MERGE(n0)-[r :T4{id : 13}]->(n1)
MATCH (n0 {id : 6}), (n1 {id : 0}) MERGE(n0)-[r :T7{id : 18}]->(n1)
MATCH (n0 {id : 0}), (n1 {id : 5}) MERGE(n0)-[r :T1{id : 22}]->(n1)
  1. Please note that there is only one relation between id=4 node and id=5 node, and the relation id is 13. However, when executing the following query:
MATCH (n0)-[r0]->(n1) WHERE n0.id = 4 and n1.id = 5 OPTIONAL MATCH (n0 {id:4})-[r9]->(n1 {id:5}), (n2)-[r10]->(n3)-[r11]->(n4) RETURN n0.id, n1.id, r9.id

The result is [[4, 5, 18]], meaning that it outputs a non-existent relation id=18 between the two nodes. Adjusting the query, the database could output different non-existent relations.
Thank you!

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

No branches or pull requests

1 participant