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

Inconsistent query results with Multi-Clause OPTIONAL MATCH #2729

Open
swf2000 opened this issue Feb 21, 2025 · 0 comments
Open

Inconsistent query results with Multi-Clause OPTIONAL MATCH #2729

swf2000 opened this issue Feb 21, 2025 · 0 comments
Labels
bug bug community community Effort - Unknown Effort - Unknown Frequency - Monthly Frequency - Monthly Reach - VeryFew Reach - VeryFew Severity - S3 Severity - S3

Comments

@swf2000
Copy link

swf2000 commented Feb 21, 2025

Memgraph version
3.0.0 & 2.22.0

Describe the bug
When executing a complex multi-OPTIONAL MATCH query on the same graph structure, Memgraph 3.0.0 returns 2 results, whereas version 2.22.0 returns 3 results. The discrepancy arises specifically when the final OPTIONAL MATCH clause is included. Additional observations:
Removing the last OPTIONAL MATCH causes both versions to return 1 result consistently.
Executing the final OPTIONAL MATCH independently (MATCH (n4)--(...) RETURN *) returns 2 results in both versions.
Because the earliest versions with discrepancy were different from the #2728 , I don't think they are the same bug

To Reproduce
Steps to reproduce the behavior:

  1. load database below
  2. Execute the Query:
    OPTIONAL MATCH (:l11:l5:l7:l8:l0:l3:l10 {k4: true}) -[r0:rt1 {k5: -1024095592, k11: false}]-> (n0:l10:l9:l5:l2:l11:l7:l8 {k7: true}) <-[:rt7]- (:l0:l5:l4:l6:l11 {k8: -1484265074, id: 96}), (n1 {k7: true, k6: "n"}) <-[:rt5]- (:l11:l3:l7:l6) <-[r1:rt10 {k3: -950296483}]- (n2), (:l11:l6:l4:l8:l1:l7:l3:l2 {k4: true}) -[r4:rt5 {k9: false}]-> (n3:l9:l4:l6:l3:l10:l8:l0:l11:l7 {k1: 125851774}) <-[r3:rt1 {k8: 556956105, k2: 1063710530}]- (:l6:l10:l1 {id: 121}) <-[r2:rt0 {k0: "3"}]- (:l10:l7:l0 {k3: 2005924874}) <-[:rt3 {k6: "1YUzVWQ"}]- () <-[r5:rt9 {k5: 1288719938}]- (n2) -[:rt3 {k7: true, k0: "67QUSHs"}]-> () <-[:rt10]- () WHERE n3.k9
    OPTIONAL MATCH p0 = (:l3:l9) -[r6:rt3]-> (n5:l0:l8:l7:l4:l1:l6) <-[:rt0]- (n4:l4:l11 {k4: true}) <-[:rt8]- (n0), p1 = (:l8:l10:l2:l7:l4:l0:l11:l5:l6 {k8: 1315569893}) <-[r8:rt11 {k1: 581095057}]- (n7:l11:l3:l6:l7:l10:l4:l9:l5:l8:l2) <-[:rt8]- (n6) -[r7:rt4]-> (n2), (n3) -[r9:rt6]-> (n1) <-[:rt2 {k7: true, k1: -855626291}]- (:l10:l5:l4:l1:l11:l0 {k2: -187788341})
    OPTIONAL MATCH ( {k2: 871068635}), p2 = ( {id: 105}) -[:rt5 {k1: -1859674828}]-> (n1), (:l8:l3:l9:l5:l11:l0) <-[:rt2 {id: 117}]- (n8:l4 {k0: "1zTuc", k4: true}) <-[r10:rt8 {k3: -2006773592}]- (:l7:l1 {k0: "6"})
    OPTIONAL MATCH (n4)--(n9:l8) -[:rt0|rt6*..3]-(n5) --(n10:l3:l1:l11:l0:l6:l4:l5:l10:l7:l2) RETURN *

memgraph-export.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bug community community Effort - Unknown Effort - Unknown Frequency - Monthly Frequency - Monthly Reach - VeryFew Reach - VeryFew Severity - S3 Severity - S3
Projects
Development

No branches or pull requests

2 participants