When trying to attach a node where the id is 0 the generated CypherQuery was missing the end node from the MATCH part.
This bug come out when neo started to reuse ids of deleted nodes: because the first id is 0, when this happened instead of connecting to the new node, a ton of edges were created between nodes with the same label.
This patch checks if the end node has an id, and won't ignore it from the query even if the value is the numeric 0.
For missing values (false, null, unset) the behavior was not changed.
I have also added a unit test to visualize the problem.
When trying to attach a node where the id is
0
the generated CypherQuery was missing the end node from the MATCH part.This bug come out when neo started to reuse ids of deleted nodes: because the first id is 0, when this happened instead of connecting to the new node, a ton of edges were created between nodes with the same label.
This patch checks if the end node has an id, and won't ignore it from the query even if the value is the numeric
0
.For missing values (
false
,null
,unset
) the behavior was not changed.I have also added a unit test to visualize the problem.