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
[master < T1209] Fix API bug on accessing deleted object #1209
Conversation
…ph/memgraph into fix-trigger-for-deleted-api-issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks fine, but I’d prefer to extend FromVertex
and ToVertex
instead of creating new methods. The new ones’ names (FromVertexWithDeleted
and ToVertexWithDeleted
) really aren’t very clear, and tbh I can’t think of a name that’s both clear and descriptive.
Clarification: I recommend sth like this:
VertexAccessor EdgeAccessor::FromVertex(bool edge_for_deleted = false) const {
if (UNLIKELY(edge_for_deleted)) {
return VertexAccessor{from_vertex_, transaction_, indices_,
constraints_, config_, for_deleted_ && from_vertex_->deleted};
}
return VertexAccessor{from_vertex_, transaction_, indices_, constraints_, config_};
}
@antoniofilipovic - can you write me a release note (RN)? |
This PR enables to access deleted vertex from deleted edge when being processed as part of trigger function |
Issue: When doing detach delete on graph, and accessing deleted objects from C++ API, if you are accessing
From
andTo
vertex of deleted edge, error occurs that you are accessing deleted vertex although it shouldn't.When a vertex is detach deleted, its VertexAccessor is marked
for_deleted_
, and out|in EdgeAccessors are markedfor_deleted_
. VertexAccessors which you can access from EdgeAccessor are not marked for_deleted_. This creates a slight problem when working with deleted objects in API, because only EdgeAccessor is markedfor_deleted_
not also itsVertexAccessors
. Therefore someVertexAccessors
have wrong information, markingfor_deleted_
as false instead of true.[master < Task] PR
To keep docs changelog up to date, one more thing to do: