fix_assert_xmaxinvalid.v1.patch
application/octet-stream
Filename: fix_assert_xmaxinvalid.v1.patch
Type: application/octet-stream
Part: 0
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
Series: patch v1
| File | + | − |
|---|---|---|
| src/backend/access/heap/heapam.c | 0 | 0 |
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 4020906..e074213 100644
*** a/src/backend/access/heap/heapam.c
--- b/src/backend/access/heap/heapam.c
*************** l1:
*** 2175,2191 ****
{
/* Perform additional check for transaction-snapshot mode RI updates */
if (!HeapTupleSatisfiesVisibility(&tp, crosscheck, buffer))
result = HeapTupleUpdated;
}
if (result != HeapTupleMayBeUpdated)
{
Assert(result == HeapTupleSelfUpdated ||
result == HeapTupleUpdated ||
result == HeapTupleBeingUpdated);
- Assert(!(tp.t_data->t_infomask & HEAP_XMAX_INVALID));
*ctid = tp.t_data->t_ctid;
- *update_xmax = HeapTupleHeaderGetXmax(tp.t_data);
UnlockReleaseBuffer(buffer);
if (have_tuple_lock)
UnlockTuple(relation, &(tp.t_self), ExclusiveLock);
--- 2175,2198 ----
{
/* Perform additional check for transaction-snapshot mode RI updates */
if (!HeapTupleSatisfiesVisibility(&tp, crosscheck, buffer))
+ {
result = HeapTupleUpdated;
+ *update_xmax = InvalidTransactionId;
+ }
}
+ else if (result != HeapTupleMayBeUpdated)
+ {
+ Assert(!(tp.t_data->t_infomask & HEAP_XMAX_INVALID));
+ *update_xmax = HeapTupleHeaderGetXmax(tp.t_data);
+ }
+
if (result != HeapTupleMayBeUpdated)
{
Assert(result == HeapTupleSelfUpdated ||
result == HeapTupleUpdated ||
result == HeapTupleBeingUpdated);
*ctid = tp.t_data->t_ctid;
UnlockReleaseBuffer(buffer);
if (have_tuple_lock)
UnlockTuple(relation, &(tp.t_self), ExclusiveLock);
*************** l2:
*** 2527,2533 ****
--- 2534,2548 ----
{
/* Perform additional check for transaction-snapshot mode RI updates */
if (!HeapTupleSatisfiesVisibility(&oldtup, crosscheck, buffer))
+ {
result = HeapTupleUpdated;
+ *update_xmax = InvalidTransactionId;
+ }
+ }
+ else if (result != HeapTupleMayBeUpdated)
+ {
+ Assert(!(oldtup.t_data->t_infomask & HEAP_XMAX_INVALID));
+ *update_xmax = HeapTupleHeaderGetXmax(oldtup.t_data);
}
if (result != HeapTupleMayBeUpdated)
*************** l2:
*** 2535,2543 ****
Assert(result == HeapTupleSelfUpdated ||
result == HeapTupleUpdated ||
result == HeapTupleBeingUpdated);
- Assert(!(oldtup.t_data->t_infomask & HEAP_XMAX_INVALID));
*ctid = oldtup.t_data->t_ctid;
- *update_xmax = HeapTupleHeaderGetXmax(oldtup.t_data);
UnlockReleaseBuffer(buffer);
if (have_tuple_lock)
UnlockTuple(relation, &(oldtup.t_self), ExclusiveLock);
--- 2550,2556 ----