Fix crash caused by deleting non-existing edge in DETACH DELETE (#1355)
This commit is contained in:
parent
af56ab6ea8
commit
3ff2c72db9
@ -354,6 +354,9 @@ EdgeInfoForDeletion Storage::Accessor::PrepareDeletableEdges(const std::unordere
|
|||||||
|
|
||||||
// also add edges which we want to delete from the query
|
// also add edges which we want to delete from the query
|
||||||
for (const auto &edge_accessor : edges) {
|
for (const auto &edge_accessor : edges) {
|
||||||
|
if (edge_accessor->from_vertex_->deleted || edge_accessor->to_vertex_->deleted) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
partial_src_vertices.insert(edge_accessor->from_vertex_);
|
partial_src_vertices.insert(edge_accessor->from_vertex_);
|
||||||
partial_dest_vertices.insert(edge_accessor->to_vertex_);
|
partial_dest_vertices.insert(edge_accessor->to_vertex_);
|
||||||
|
|
||||||
|
@ -209,3 +209,13 @@ Feature: Delete
|
|||||||
MATCH (n) DETACH DELETE n SET n.prop = 1 WITH n RETURN n
|
MATCH (n) DETACH DELETE n SET n.prop = 1 WITH n RETURN n
|
||||||
"""
|
"""
|
||||||
Then an error should be raised
|
Then an error should be raised
|
||||||
|
|
||||||
|
Scenario: Delete a relationship that is already deleted in a previous DETACH DELETE clause
|
||||||
|
Given an empty graph
|
||||||
|
When executing query:
|
||||||
|
"""
|
||||||
|
CREATE (n0)<-[r0:T]-(n1) DETACH DELETE n0 DETACH DELETE r0 RETURN n1;
|
||||||
|
"""
|
||||||
|
Then the result should be:
|
||||||
|
| n1 |
|
||||||
|
| () |
|
||||||
|
Loading…
Reference in New Issue
Block a user