Make xl_heap_lock's infobits_set field of type uint8, not int8. Using
int8 isn't appropriate given that the field just holds status bits.
This fixes an oversight in commit
0ac5ad5134.
In passing rename the nearby TransactionId field to "xmax" to make
things consistency with related records, such as xl_heap_lock_updated.
Deliberately avoid a bump in XLOG_PAGE_MAGIC. No back, either.
Author: Peter Geoghegan <
[email protected]>
Discussion: https://postgr.es/m/CAH2-WzkCd3kOS8b7Rfxw7Mh1_6jvX=Nzo-CWR1VBTiOtVZkWHA@mail.gmail.com
XLogRegisterBuffer(0, buffer, REGBUF_STANDARD);
xlrec.offnum = ItemPointerGetOffsetNumber(&oldtup.t_self);
- xlrec.locking_xid = xmax_lock_old_tuple;
+ xlrec.xmax = xmax_lock_old_tuple;
xlrec.infobits_set = compute_infobits(oldtup.t_data->t_infomask,
oldtup.t_data->t_infomask2);
xlrec.flags =
XLogRegisterBuffer(0, *buffer, REGBUF_STANDARD);
xlrec.offnum = ItemPointerGetOffsetNumber(&tuple->t_self);
- xlrec.locking_xid = xid;
+ xlrec.xmax = xid;
xlrec.infobits_set = compute_infobits(new_infomask,
tuple->t_data->t_infomask2);
xlrec.flags = cleared_all_frozen ? XLH_LOCK_ALL_FROZEN_CLEARED : 0;
BufferGetBlockNumber(buffer),
offnum);
}
- HeapTupleHeaderSetXmax(htup, xlrec->locking_xid);
+ HeapTupleHeaderSetXmax(htup, xlrec->xmax);
HeapTupleHeaderSetCmax(htup, FirstCommandId, false);
PageSetLSN(page, lsn);
MarkBufferDirty(buffer);
{
xl_heap_lock *xlrec = (xl_heap_lock *) rec;
- appendStringInfo(buf, "off: %u, xid: %u, flags: 0x%02X",
- xlrec->offnum, xlrec->locking_xid, xlrec->flags);
+ appendStringInfo(buf, "off: %u, xmax: %u, flags: 0x%02X",
+ xlrec->offnum, xlrec->xmax, xlrec->flags);
out_infobits(buf, xlrec->infobits_set);
}
else if (info == XLOG_HEAP_INPLACE)
/* This is what we need to know about lock */
typedef struct xl_heap_lock
{
- TransactionId locking_xid; /* might be a MultiXactId not xid */
+ TransactionId xmax; /* might be a MultiXactId */
OffsetNumber offnum; /* locked tuple's offset on page */
- int8 infobits_set; /* infomask and infomask2 bits to set */
+ uint8 infobits_set; /* infomask and infomask2 bits to set */
uint8 flags; /* XLH_LOCK_* flag bits */
} xl_heap_lock;
-#define SizeOfHeapLock (offsetof(xl_heap_lock, flags) + sizeof(int8))
+#define SizeOfHeapLock (offsetof(xl_heap_lock, flags) + sizeof(uint8))
/* This is what we need to know about locking an updated version of a row */
typedef struct xl_heap_lock_updated