Skip to content

Inconsistent evaluation of pattern predicate in WHERE: ()--() differs from NOT((()--()) XOR true) #6136

@zihaozeng0021

Description

@zihaozeng0021

Configuration

Nebula Version: 2025.10.28-nightly

Operating System: WSL2 – Ubuntu 24.04.1 LTS

Installation Method: Docker


Steps to reproduce

  1. Start Nebula via Docker
docker exec -it nebula-docker-compose-console-1 sh
  1. Connect with nebula-console:
nebula-console -u root -p nebula -addr graphd -port 9669
  1. Run the following query:

Create a test space

CREATE SPACE IF NOT EXISTS test(partition_num=1, replica_factor=1, vid_type=FIXED_STRING(8));

Select the space

use test

Setup

CREATE TAG IF NOT EXISTS L(n string);
CREATE EDGE IF NOT EXISTS E();

INSERT VERTEX L(n) VALUES "a":("a"), "b":("b"), "c":("c");
INSERT EDGE E() VALUES "a"->"b":();

Sanity-check that an edge exists:

(root@nebula) [test]> MATCH ()-[e:E]->() RETURN e;
+---------------------+
| e                   |
+---------------------+
| [:E "a"->"b" @0 {}] |
+---------------------+
Got 1 rows (time spent 8.558ms/9.200294ms)

Thu, 25 Dec 2025 06:37:04 UTC

Run the buggy queries:

(root@nebula) [test]> MATCH (n:L) WHERE ()--() RETURN n;
+---+
| n |
+---+
+---+
Empty set (time spent 5.52ms/5.904034ms)

Thu, 25 Dec 2025 06:37:11 UTC

(root@nebula) [test]> MATCH (n:L) WHERE NOT((()--()) XOR true) RETURN n;
+------------------+
| n                |
+------------------+
| ("a" :L{n: "a"}) |
| ("b" :L{n: "b"}) |
| ("c" :L{n: "c"}) |
+------------------+
Got 3 rows (time spent 5.994ms/6.312413ms)

Thu, 25 Dec 2025 06:37:16 UTC

Expected behaviour

These two queries should return the same result set because their WHERE clauses are logically equivalent:

  • WHERE ()--()
  • WHERE NOT((()--()) XOR true)

Actual behaviour

Their outputs are different with each other

  • MATCH (n:L) WHERE ()--() RETURN n; → Empty set
  • MATCH (n:L) WHERE NOT((()--()) XOR true) RETURN n; → 3 rows (a, b, c)

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects/nonePR/issue: this bug affects none version.severity/noneSeverity of bugtype/bugType: something is unexpected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions