You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@age.apache.org by GitBox <gi...@apache.org> on 2022/08/17 19:00:03 UTC
[GitHub] [age] jrgemignani commented on a diff in pull request #246: AGE PG12.1.0 ALPHA
jrgemignani commented on code in PR #246:
URL: https://github.com/apache/age/pull/246#discussion_r948311440
##########
src/backend/executor/cypher_set.c:
##########
@@ -136,41 +136,63 @@ static HeapTuple update_entity_tuple(ResultRelInfo *resultRelInfo,
{
ExecConstraints(resultRelInfo, elemTupleSlot, estate);
}
- /*
- simple_table_tuple_update(resultRelInfo->ri_RelationDesc,
- GetCurrentCommandId(true),
- elemTupleSlot, estate->es_snapshot,
- &update_indexes);
-
- if (resultRelInfo->ri_NumIndices > 0 && update_indexes)
- //ExecInsertIndexTuples(elemTupleSlot, estate, false, NULL,
- // NIL);
- */
- // Insert the tuple normally
- update_result = heap_update(resultRelInfo->ri_RelationDesc,
- &(tuple->t_self), tuple,
+
+ result = table_tuple_update(resultRelInfo->ri_RelationDesc,
+ &tuple->t_self, elemTupleSlot,
GetCurrentCommandId(true),
- estate->es_crosscheck_snapshot, true, &hufd,
- &lockmode);
+ //estate->es_output_cid,
+ estate->es_snapshot,// NULL,
+ estate->es_crosscheck_snapshot,
+ true /* wait for commit */ ,
+ &hufd, &lockmode, &update_indexes);
- if (update_result != TM_Ok)
+ if (result == TM_SelfModified)
+ {
+ if (hufd.cmax != estate->es_output_cid)
+ {
+ ereport(ERROR,
+ (errcode(ERRCODE_TRIGGERED_DATA_CHANGE_VIOLATION),
+ errmsg("tuple to be updated was already modified")));
+ }
+
+ ExecCloseIndices(resultRelInfo);
+ estate->es_result_relation_info = saved_resultRelInfo;
+
+ return tuple;
+ }
+
+ if (result != TM_Ok)
{
ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR),
- errmsg("Entity failed to be updated: %i", update_result)));
+ errmsg("Entity failed to be updated: %i", result)));
}
-
- &update_indexes = update_result == TM_Ok && !HeapTupleIsHeapOnly(tuple);
-
+
// Insert index entries for the tuple
Review Comment:
It was decided at the beginning of the project to allow // for comments as our product is an extension and not a fork. I don't think this applies to extensions.
--
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: commits-unsubscribe@age.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org