# Bug in bigger cypher using or false

**URL:** <https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153>\
**Category:** Cypher\
**Tags:** cypher, bug\
**Created:** [May 29, 2024, 12:25pm UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153 "2024-05-29T12:25:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reiner](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/reiner/32/221_2.png) [@Reiner](https://community.neo4j.com/u/Reiner)\
**Post date:** [May 29, 2024, 12:25pm UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153/1 "2024-05-29T12:25:08Z")

</div>

Using Neo4j Enterprise 4.4.2, I get wrong results from a cypher query using a simple WHERE condition in a bigger query. The same condition works in a small cypher. Here is the small cypher that correctly outputs a message count of 4:

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/3/c/3ce301520edf79bb3bf108231b5cc4e3710edfd1.png)

The bigger production cypher results in the same application and position on line 85 and follows the same condition as above, but results in a wrong message count of 0

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/d/d/ddb70ca1dc0397cd76fdf82593b98f348c38e7a8.png)

I marked the "or false" part as when removing this, which logically should have no effect, the cypher outputs the correct message count of 4. (just to explain, this "or false" results from a more complex application logic)

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/4/f/4fb5755c9e4ee26c4d04884d68afb2d96b4506c9.png)

For more details, here the relevant part of the profile of the first small working cypher:

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/7/5/7598390a669291c1fcc0dd400fad1759033ea8f4.png)

And the NOT working bigger cypher inlcuding "or false"

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/b/8/b826707abfe9ddd02a2c44b7c94e4bc43b4a5fec.png)

And the working bigger cypher without "or false"

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/b/0/b03048fc0f56c720f0384d47bb2fdd370c6bfe8b.png)

Do I miss something or is this a bug in the cypher processing?

Best,  
Reiner

---

<div class="post-metadata">

**Author:** ![Reiner](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/reiner/32/221_2.png) [@Reiner](https://community.neo4j.com/u/Reiner)\
**Post date:** [May 29, 2024, 12:29pm UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153/2 "2024-05-29T12:29:36Z")

</div>

Found a workaround using pattern comprehension but the issue should be investigated anyways.

 ![image](https://us1.discourse-cdn.com/flex021/uploads/neo4jcommunity/original/3X/0/4/0444f404f7f57c1a39b8df457dcf5a25a68b1476.png)

---

<div class="post-metadata">

**Author:** ![dana\_canzano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dana_canzano/32/27392_2.png) [@dana\_canzano](https://community.neo4j.com/u/dana_canzano)\
**Post date:** [May 29, 2024, 12:35pm UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153/3 "2024-05-29T12:35:39Z")

</div>

@Reiner

4.4.2 is fairly old and given [Neo4j 4.4.2 - Graph Database & Analytics](https://neo4j.com/release-notes/database/neo4j-4-4-2/) indicates released on 16 December 2021.

Any chance to upgrade to a more recent release, ie. 4.4.34 [Neo4j 4.4.34 - Graph Database & Analytics](https://neo4j.com/release-notes/database/neo4j-4-4-34/)

---

<div class="post-metadata">

**Author:** ![Reiner](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/reiner/32/221_2.png) [@Reiner](https://community.neo4j.com/u/Reiner)\
**Post date:** [May 29, 2024, 12:45pm UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153/4 "2024-05-29T12:45:34Z")

</div>

Yes - we will try this. Even more we would like to upgrade to 5.1x but as using COLLECT in mappings is deprecated in 5.x, we have to rewrite and test about 140 mostly complex cyphers in our application before :-(

---

<div class="post-metadata">

**Author:** ![dana\_canzano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dana_canzano/32/27392_2.png) [@dana\_canzano](https://community.neo4j.com/u/dana_canzano)\
**Post date:** [May 29, 2024, 1:54pm UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153/5 "2024-05-29T13:54:48Z")

</div>

@Reiner

even if the problem persists in 4.4.34, if a fix is to be had it would be applied to 4.4.34+ and not 4.4.2+

---

<div class="post-metadata">

**Author:** ![Reiner](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/reiner/32/221_2.png) [@Reiner](https://community.neo4j.com/u/Reiner)\
**Post date:** [May 30, 2024, 7:43am UTC](https://community.neo4j.com/t/bug-in-bigger-cypher-using-or-false/68153/6 "2024-05-30T07:43:53Z")

</div>

We just upgraded, in 4.4.34 the problem doesn't exist anymore. Thanks!
