seagle-yuan commented on code in PR #1852:
URL:
https://github.com/apache/incubator-hugegraph/pull/1852#discussion_r867972197
##########
hugegraph-core/src/main/java/com/baidu/hugegraph/backend/store/BackendMutation.java:
##########
@@ -111,6 +111,19 @@ private void optimizeUpdates(BackendEntry entry, Action
action) {
" transaction between %s and %s",
entry, originItem.entry()));
}
+
+ if (originAction == Action.INSERT ||
+ originAction == Action.DELETE) {
+ throw incompatibleActionException(action,
originAction);
+ } else {
+ Id subId = entry.subId();
+ Id originSubId = originItem.entry().subId();
+ assert subId != null;
+ if (subId == originSubId || subId.equals(originSubId))
{
+ iter.remove();
+ }
Review Comment:
if only keep lines 119-124
`
@Test
public void testDeleteAndAppendEntry() {
BackendMutation mutation = new BackendMutation();
BackendEntry entry1 = constructBackendEntry("1");
BackendEntry entry2 = constructBackendEntry("1", "name", "marko");
mutation.add(entry1, Action.DELETE);
Assert.assertThrows(HugeException.class, () -> {
mutation.add(entry2, Action.APPEND);
});
}
`
these scripts are probably not able to pass
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]