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

Graphd does not handle three-value logic properly #5203

Closed
nebula-bots opened this issue Jan 5, 2023 · 0 comments
Closed

Graphd does not handle three-value logic properly #5203

nebula-bots opened this issue Jan 5, 2023 · 0 comments
Labels
affects/master PR/issue: this bug affects master version. auto-sync find/automation process/done Process of bug severity/major Severity of bug type/bug Type: something is unexpected

Comments

@nebula-bots
Copy link
Contributor

Please check the FAQ documentation before raising an issue

Describe the bug (required)

Look at the queries in Nebula below:

(root@nebula) [nebulal_gdlancer]>  MATCH (v0)-[e0:Rel_1|Rel_0|Rel_3]->()-[e1]->() WHERE (id(v0) in [19, 6, 17, 18, 16, 15, 11]) and e1.Rel_1_1_Bool == false and e0.Rel_3_5_Bool is null RETURN e0.Rel_3_5_Bool, e1.Rel_1_1_Bool, e0.Rel_3_5_Bool AND e1.Rel_1_1_Bool
+-----------------+-----------------+---------------------------------------+
| e0.Rel_3_5_Bool | e1.Rel_1_1_Bool | (e0.Rel_3_5_Bool AND e1.Rel_1_1_Bool) |
+-----------------+-----------------+---------------------------------------+
| UNKNOWN_PROP    | false           | UNKNOWN_PROP                          |
| UNKNOWN_PROP    | false           | UNKNOWN_PROP                          |
| UNKNOWN_PROP    | false           | UNKNOWN_PROP                          |
+-----------------+-----------------+---------------------------------------+
Got 3 rows (time spent 1.675ms/18.282ms)

Fri, 18 Nov 2022 10:22:05 CST

We can see that null AND false is evaluated to be UNKNOWN_PROP(another form of null), while in Neo4j, null AND false is evaluate to false:

$ MATCH (v0)-[e0:Rel_1|Rel_0|Rel_3]->()-[e1]->() WHERE (v0.id in [19, 6, 17, 18, 16, 15, 11]) and e1.Rel_1_1_Bool = false and e0.Rel_3_5_Bool is null RETURN e0.Rel_3_5_Bool, e1.Rel_1_1_Bool, e0.Rel_3_5_Bool AND e1.Rel_1_1_Bool

╒═════════════════╤═════════════════╤═════════════════════════════════════╕
│"e0.Rel_3_5_Bool"│"e1.Rel_1_1_Bool"│"e0.Rel_3_5_Bool AND e1.Rel_1_1_Bool"│
╞═════════════════╪═════════════════╪═════════════════════════════════════╡
│null             │false            │false                                │
├─────────────────┼─────────────────┼─────────────────────────────────────┤
│null             │false            │false                                │
├─────────────────┼─────────────────┼─────────────────────────────────────┤
│null             │false            │false                                │
└─────────────────┴─────────────────┴─────────────────────────────────────┘

That is what we expected, beacause that comply with the rules of three values logic, see Three-valued logic

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id (e.g. a3ffc7d8) 31213ea

How To Reproduce(required)

Steps to reproduce the behavior:

  1. Step 1
  2. Step 2
  3. Step 3

Expected behavior

Additional context

@nebula-bots nebula-bots added affects/master PR/issue: this bug affects master version. auto-sync find/automation process/done Process of bug severity/major Severity of bug type/bug Type: something is unexpected labels Jan 5, 2023
@github-actions github-actions bot added the process/fixed Process of bug label Jan 5, 2023
@HarrisChu HarrisChu removed the process/fixed Process of bug label Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects/master PR/issue: this bug affects master version. auto-sync find/automation process/done Process of bug severity/major Severity of bug type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

3 participants