Skip to content

A logic bug caused by node reference. #3244

@sjhhh321

Description

@sjhhh321

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

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

Q2:MATCH (n6 :L2)<-[r10 :T1]-(n10 :L3), (n10 :L3), (n8 :L1)<-[r7 :T0]-(n3 :L3)<-[r2 :T1]-(n0)<-[r9 :T0]-(n9 :L1), (n10 :L3)<-[r11 :T1]-(n11 :L0), (n9 :L1)<-[r8 :T1]-(n6 :L2), (n6 :L2)<-[r5 :T0]-(n3 :L3), (n7 :L4)<-[r6 :T5]-(n3 :L3), (n5 :L2), (n5 :L2)<-[r4 :T1]-(n3 :L3), (n4)<-[r3 :T2]-(n3 :L3), (n1 :L2)-[r0 :T0]->(n0), (n1 :L2)-[r1 :T4]->(n2) MATCH (n0)-[]->(n3)-[]->(n4) RETURN COUNT(*);
return--1

Q1 returns 0 while Q2 returns 1. Only the first MATCH differs here; the second MATCH is identical and fully references the nodes from the first MATCH. The problem also shows up where the first MATCH is applied, and it seems the issue occurs purely when referencing nodes.

database:

database.log

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