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

Incorrect result after unwind #5051

Closed
nebula-bots opened this issue Dec 13, 2022 · 1 comment · Fixed by #5054
Closed

Incorrect result after unwind #5051

nebula-bots opened this issue Dec 13, 2022 · 1 comment · Fixed by #5054
Assignees
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
Milestone

Comments

@nebula-bots
Copy link
Contributor

Please check the FAQ documentation before raising an issue

Describe the bug (required)

Similar to #1701 but must be a different problem.

Look at the queries below, the first query retusn 34 row, in the second query which we unwind the result in the first query and return the unwinded column it return 17 rows, there are 17 rows of result missing:

(root@nebula) [gdlancer]> MATCH (v0)-[e0*1..1]->(:Label_0:Label_5)<-[e1]-() WHERE (id(v0) in [9, 18, 30, 20, 12, 22, 19, 21, 10, 15, 22]) AND (e1.Rel_2_4_Bool) MATCH (v1)-[e2]->()<-[e3]-(v2) WHERE (id(v1) == 9) AND ((((e2.Rel_0_5_Int * (- e1.Rel_2_0_Int)) % (e1.Rel_2_5_Int * (- (e3.Rel_2_5_Int * (0.795342 - e2.Rel_0_6_Int))))) < (- (((- (e3.Rel_2_5_Int + v2.Label_0.Label_0_5_Int)) - ((e2.Rel_0_4_Double * e2.Rel_0_3_Int) - e3.Rel_2_1_Double)) - (v2.Label_0.Label_0_4_Int + (- (- e2.Rel_0_6_Int))))))) WITH v2, v2.Label_0.Label_0_3_Bool AS pa0, e2, e3 WHERE ((((52 * e3.Rel_2_1_Double) + ((e2.Rel_0_4_Double % (e3.Rel_2_1_Double / e2.Rel_0_4_Double)) * 0.276742)) - v2.Label_0.Label_0_5_Int) <= (e3.Rel_2_5_Int - (- e2.Rel_0_3_Int))) return  (e3.Rel_2_3_Bool AND v2.Label_0.Label_0_3_Bool)
(root@nebula) [gdlancer]> MATCH (v0)-[e0*1..1]->(:Label_0:Label_5)<-[e1]-() WHERE (id(v0) in [9, 18, 30, 20, 12, 22, 19, 21, 10, 15, 22]) AND (e1.Rel_2_4_Bool) MATCH (v1)-[e2]->()<-[e3]-(v2) WHERE (id(v1) == 9) AND ((((e2.Rel_0_5_Int * (- e1.Rel_2_0_Int)) % (e1.Rel_2_5_Int * (- (e3.Rel_2_5_Int * (0.795342 - e2.Rel_0_6_Int))))) < (- (((- (e3.Rel_2_5_Int + v2.Label_0.Label_0_5_Int)) - ((e2.Rel_0_4_Double * e2.Rel_0_3_Int) - e3.Rel_2_1_Double)) - (v2.Label_0.Label_0_4_Int + (- (- e2.Rel_0_6_Int))))))) WITH v2, v2.Label_0.Label_0_3_Bool AS pa0, e2, e3 WHERE ((((52 * e3.Rel_2_1_Double) + ((e2.Rel_0_4_Double % (e3.Rel_2_1_Double / e2.Rel_0_4_Double)) * 0.276742)) - v2.Label_0.Label_0_5_Int) <= (e3.Rel_2_5_Int - (- e2.Rel_0_3_Int))) return  (e3.Rel_2_3_Bool AND v2.Label_0.Label_0_3_Bool)
+-------------------------------------------------+
| (e3.Rel_2_3_Bool AND v2.Label_0.Label_0_3_Bool) |
+-------------------------------------------------+
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
| false                                           |
+-------------------------------------------------+
Got 34 rows (time spent 6.209ms/31.269625ms)

Mon, 12 Dec 2022 18:30:14 CST

(root@nebula) [gdlancer]> MATCH (v0)-[e0*1..1]->(:Label_0:Label_5)<-[e1]-() WHERE (id(v0) in [9, 18, 30, 20, 12, 22, 19, 21, 10, 15, 22]) AND (e1.Rel_2_4_Bool) MATCH (v1)-[e2]->()<-[e3]-(v2) WHERE (id(v1) == 9) AND ((((e2.Rel_0_5_Int * (- e1.Rel_2_0_Int)) % (e1.Rel_2_5_Int * (- (e3.Rel_2_5_Int * (0.795342 - e2.Rel_0_6_Int))))) < (- (((- (e3.Rel_2_5_Int + v2.Label_0.Label_0_5_Int)) - ((e2.Rel_0_4_Double * e2.Rel_0_3_Int) - e3.Rel_2_1_Double)) - (v2.Label_0.Label_0_4_Int + (- (- e2.Rel_0_6_Int))))))) WITH v2, v2.Label_0.Label_0_3_Bool AS pa0, e2, e3 WHERE ((((52 * e3.Rel_2_1_Double) + ((e2.Rel_0_4_Double % (e3.Rel_2_1_Double / e2.Rel_0_4_Double)) * 0.276742)) - v2.Label_0.Label_0_5_Int) <= (e3.Rel_2_5_Int - (- e2.Rel_0_3_Int))) UNWIND (e3.Rel_2_3_Bool AND v2.Label_0.Label_0_3_Bool) AS ua0 return ua0
+-------+
| ua0   |
+-------+
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
| false |
+-------+
Got 17 rows (time spent 5.424ms/20.163625ms)

Mon, 12 Dec 2022 18:30:18 CST

(root@nebula) [gdlancer]>

In contrast, both queries in Neo4j return 34 rows of result:

$ MATCH (v0)-[e0*1..1]->(:Label_0:Label_5)<-[e1]-() WHERE (v0.id in [9, 18, 30, 20, 12, 22, 19, 21, 10, 15, 22]) AND (e1.Rel_2_4_Bool) MATCH (v1)-[e2]->()<-[e3]-(v2) WHERE (v1.id = 9) AND ((((e2.Rel_0_5_Int * (- e1.Rel_2_0_Int)) % (e1.Rel_2_5_Int * (- (e3.Rel_2_5_Int * (0.795342 - e2.Rel_0_6_Int))))) < (- (((- (e3.Rel_2_5_Int + v2.Label_0_5_Int)) - ((e2.Rel_0_4_Double * e2.Rel_0_3_Int) - e3.Rel_2_1_Double)) - (v2.Label_0_4_Int + (- (- e2.Rel_0_6_Int))))))) WITH v2, v2.Label_0_3_Bool AS pa0, e2, e3 WHERE ((((52 * e3.Rel_2_1_Double) + ((e2.Rel_0_4_Double % (e3.Rel_2_1_Double / e2.Rel_0_4_Double)) * 0.276742)) - v2.Label_0_5_Int) <= (e3.Rel_2_5_Int - (- e2.Rel_0_3_Int))) UNWIND (e3.Rel_2_3_Bool AND v2.Label_0_3_Bool) AS ua0 return ua0

╒═════╕
│"ua0"│
╞═════╡
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
├─────┤
│false│
└─────┘

$ MATCH (v0)-[e0*1..1]->(:Label_0:Label_5)<-[e1]-() WHERE (v0.id in [9, 18, 30, 20, 12, 22, 19, 21, 10, 15, 22]) AND (e1.Rel_2_4_Bool) MATCH (v1)-[e2]->()<-[e3]-(v2) WHERE (v1.id = 9) AND ((((e2.Rel_0_5_Int * (- e1.Rel_2_0_Int)) % (e1.Rel_2_5_Int * (- (e3.Rel_2_5_Int * (0.795342 - e2.Rel_0_6_Int))))) < (- (((- (e3.Rel_2_5_Int + v2.Label_0_5_Int)) - ((e2.Rel_0_4_Double * e2.Rel_0_3_Int) - e3.Rel_2_1_Double)) - (v2.Label_0_4_Int + (- (- e2.Rel_0_6_Int))))))) WITH v2, v2.Label_0_3_Bool AS pa0, e2, e3 WHERE ((((52 * e3.Rel_2_1_Double) + ((e2.Rel_0_4_Double % (e3.Rel_2_1_Double / e2.Rel_0_4_Double)) * 0.276742)) - v2.Label_0_5_Int) <= (e3.Rel_2_5_Int - (- e2.Rel_0_3_Int))) return (e3.Rel_2_3_Bool AND v2.Label_0_3_Bool)

╒═════════════════════════════════════════╕
│"(e3.Rel_2_3_Bool AND v2.Label_0_3_Bool)"│
╞═════════════════════════════════════════╡
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
├─────────────────────────────────────────┤
│false                                    │
└─────────────────────────────────────────┘

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id (e.g. a3ffc7d8) 573f7f4 (community edition)

How To Reproduce(required)

Steps to reproduce the behavior:

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

Expected behavior

Additional context

@xtcyclist
Copy link
Contributor

This bug remain fixed. But issues on other related clauses like ListComprehension have been reopened by #5229.

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
3 participants