Return Error::DELETED_OBJECT from CreateEdge instead of aborting
Reviewers: mtomic, mferencevic Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2295
This commit is contained in:
parent
e18cb7b4c7
commit
34f80722c2
@ -454,12 +454,12 @@ Result<EdgeAccessor> Storage::Accessor::CreateEdge(VertexAccessor *from,
|
||||
|
||||
if (!PrepareForWrite(&transaction_, from_vertex))
|
||||
return Error::SERIALIZATION_ERROR;
|
||||
CHECK(!from_vertex->deleted) << "Invalid database state!";
|
||||
if (from_vertex->deleted) return Error::DELETED_OBJECT;
|
||||
|
||||
if (to_vertex != from_vertex) {
|
||||
if (!PrepareForWrite(&transaction_, to_vertex))
|
||||
return Error::SERIALIZATION_ERROR;
|
||||
CHECK(!to_vertex->deleted) << "Invalid database state!";
|
||||
if (to_vertex->deleted) return Error::DELETED_OBJECT;
|
||||
}
|
||||
|
||||
auto gid = storage_->edge_id_.fetch_add(1, std::memory_order_acq_rel);
|
||||
|
Loading…
Reference in New Issue
Block a user