A logic bug caused by a self-loop. · Issue #3243 · RedisGraph/RedisGraph · GitHub
Skip to content

A logic bug caused by a self-loop. #3243

Open

Description

@sjhhh321

Redis version: redis-7.2.4
RedisGraph version: redisgraph-2.12.10
Operating system: Ubuntu 20.04

Q1:MATCH (n0 :L0)<-[r0 :T1]-(n1 :L3)<-[r1 :T3]-(n2 :L6), (n0)<-[r2 :T1]-(n3)-[r3 :T4]->(n4 :L1), (n3)-[r4 :T4]->(n3)-[r5 :T0]->(n5 :L2), (n6 :L4)<-[r6 :T3]-(n1 :L3), (n7)<-[r7 :T2]-(n8 :L5)-[r8 :T4]->(n0), (n8 :L5)-[r9 :T4]->(n9 :L4)<-[r10 :T3]-(n10 :L2) MATCH (n3)-[]->(n3 :L1)-[]->(n5) return count(*)
return---

Q2:MATCH (n2 :L6), (n3)-[r3 :T4]->(n4 :L1), (n3)-[r2 :T1]->(n0 :L0), (n10 :L2)-[r10 :T3]->(n9 :L4), (n1 :L3)<-[r1 :T3]-(n2 :L6), (n8 :L5), (n7), (n9 :L4)<-[r9 :T4]-(n8 :L5)-[r8 :T4]->(n0 :L0), (n5 :L2)<-[r5 :T0]-(n3), (n0 :L0)<-[r0 :T1]-(n1 :L3), (n3)-[r4 :T4]->(n3), (n7)<-[r7 :T2]-(n8 :L5), (n1 :L3), (n6 :L4)<-[r6 :T3]-(n1 :L3) MATCH (n3 :L1)-[]->(n3),(n3)-[]->(n5) return count(*)
return--4
These two queries are equivalent, but their results are inconsistent, indicating a bug. The first MATCH clause is identical in both queries; the issue occurs in the second equivalent MATCH clause, where different equivalent forms of the self-loop trigger the bug.

database:

database.log

Activity

  1. swilly22 commented on Oct 15, 2025

    @swilly22
    Contributor

    Hi @sjhhh321,
    Unfortunately RedisGraph is EOL, Let me recommend trying this query against FalkorDB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions