old_infomask;
TransactionId xmax,
new_xmax;
+ TransactionId priorXmax = InvalidTransactionId;
ItemPointerCopy(tid, &tupid);
CHECK_FOR_INTERRUPTS();
LockBuffer(buf, BUFFER_LOCK_EXCLUSIVE);
+ /*
+ * Check the tuple XMIN against prior XMAX, if any. If we reached
+ * the end of the chain, we're done, so return success.
+ */
+ if (TransactionIdIsValid(priorXmax) &&
+ !TransactionIdEquals(HeapTupleHeaderGetXmin(mytup.t_data),
+ priorXmax))
+ {
+ UnlockReleaseBuffer(buf);
+ return HeapTupleMayBeUpdated;
+ }
+
old_infomask = mytup.t_data->t_infomask;
xmax = HeapTupleHeaderGetRawXmax(mytup.t_data);
}
/* tail recursion */
+ priorXmax = HeapTupleHeaderGetUpdateXid(mytup.t_data);
ItemPointerCopy(&(mytup.t_data->t_ctid), &tupid);
UnlockReleaseBuffer(buf);
}