* cross-partition UPDATE
*/
TupleTableSlot *cpUpdateReturningSlot;
-
- /*
- * Lock mode to acquire on the latest tuple version before performing
- * EvalPlanQual on it
- */
- LockTupleMode lockmode;
} ModifyTableContext;
/*
bool updated; /* did UPDATE actually occur? */
bool updateIndexes; /* index update required? */
bool crossPartUpdate; /* was it a cross-partition update? */
+
+ /*
+ * Lock mode to acquire on the latest tuple version before performing
+ * EvalPlanQual on it
+ */
+ LockTupleMode lockmode;
} UpdateContext;
estate->es_snapshot,
estate->es_crosscheck_snapshot,
true /* wait for commit */ ,
- &context->tmfd, &context->lockmode,
+ &context->tmfd, &updateCxt->lockmode,
&updateCxt->updateIndexes);
if (result == TM_Ok)
updateCxt->updated = true;
result = table_tuple_lock(resultRelationDesc, tupleid,
estate->es_snapshot,
inputslot, estate->es_output_cid,
- context->lockmode, LockWaitBlock,
+ updateCxt.lockmode, LockWaitBlock,
TUPLE_LOCK_FLAG_FIND_LAST_VERSION,
&context->tmfd);
{
EvalPlanQualSetSlot(&node->mt_epqstate, context.planSlot);
- context.lockmode = 0;
-
ExecMerge(&context, node->resultRelInfo, NULL, node->canSetTag);
continue; /* no RETURNING support yet */
}
{
EvalPlanQualSetSlot(&node->mt_epqstate, context.planSlot);
- context.lockmode = 0;
-
ExecMerge(&context, node->resultRelInfo, NULL, node->canSetTag);
continue; /* no RETURNING support yet */
}
}
}
- /* complete context setup */
- context.lockmode = 0;
-
switch (operation)
{
case CMD_INSERT: