@@ -2820,6 +2820,7 @@ compute_infobits(uint16 infomask, uint16 infomask2)
2820
2820
((infomask & HEAP_XMAX_IS_MULTI ) != 0 ? XLHL_XMAX_IS_MULTI : 0 ) |
2821
2821
((infomask & HEAP_XMAX_LOCK_ONLY ) != 0 ? XLHL_XMAX_LOCK_ONLY : 0 ) |
2822
2822
((infomask & HEAP_XMAX_EXCL_LOCK ) != 0 ? XLHL_XMAX_EXCL_LOCK : 0 ) |
2823
+ ((infomask & HEAP_COMBOCID ) != 0 ? XLHL_COMBOCID : 0 ) |
2823
2824
/* note we ignore HEAP_XMAX_SHR_LOCK here */
2824
2825
((infomask & HEAP_XMAX_KEYSHR_LOCK ) != 0 ? XLHL_XMAX_KEYSHR_LOCK : 0 ) |
2825
2826
((infomask2 & HEAP_KEYS_UPDATED ) != 0 ?
@@ -8369,11 +8370,12 @@ log_heap_update(Relation reln, Buffer oldbuf,
8369
8370
xlrec .old_xmax = HeapTupleHeaderGetRawXmax (oldtup -> t_data );
8370
8371
xlrec .old_infobits_set = compute_infobits (oldtup -> t_data -> t_infomask ,
8371
8372
oldtup -> t_data -> t_infomask2 );
8373
+ xlrec .t_cid = HeapTupleHeaderGetRawCommandId (oldtup -> t_data );
8372
8374
8373
8375
/* Prepare WAL data for the new page */
8374
8376
xlrec .new_offnum = ItemPointerGetOffsetNumber (& newtup -> t_self );
8375
8377
xlrec .new_xmax = HeapTupleHeaderGetRawXmax (newtup -> t_data );
8376
- xlrec . t_cid = HeapTupleHeaderGetRawCommandId ( newtup -> t_data );
8378
+
8377
8379
bufflags = REGBUF_STANDARD ;
8378
8380
if (init )
8379
8381
bufflags |= REGBUF_WILL_INIT ;
@@ -9024,7 +9026,7 @@ static void
9024
9026
fix_infomask_from_infobits (uint8 infobits , uint16 * infomask , uint16 * infomask2 )
9025
9027
{
9026
9028
* infomask &= ~(HEAP_XMAX_IS_MULTI | HEAP_XMAX_LOCK_ONLY |
9027
- HEAP_XMAX_KEYSHR_LOCK | HEAP_XMAX_EXCL_LOCK );
9029
+ HEAP_XMAX_KEYSHR_LOCK | HEAP_XMAX_EXCL_LOCK | HEAP_COMBOCID );
9028
9030
* infomask2 &= ~HEAP_KEYS_UPDATED ;
9029
9031
9030
9032
if (infobits & XLHL_XMAX_IS_MULTI )
@@ -9033,6 +9035,8 @@ fix_infomask_from_infobits(uint8 infobits, uint16 *infomask, uint16 *infomask2)
9033
9035
* infomask |= HEAP_XMAX_LOCK_ONLY ;
9034
9036
if (infobits & XLHL_XMAX_EXCL_LOCK )
9035
9037
* infomask |= HEAP_XMAX_EXCL_LOCK ;
9038
+ if (infobits & XLHL_COMBOCID )
9039
+ * infomask |= HEAP_COMBOCID ;
9036
9040
/* note HEAP_XMAX_SHR_LOCK isn't considered here */
9037
9041
if (infobits & XLHL_XMAX_KEYSHR_LOCK )
9038
9042
* infomask |= HEAP_XMAX_KEYSHR_LOCK ;
@@ -9094,7 +9098,7 @@ heap_xlog_delete(XLogReaderState *record)
9094
9098
HeapTupleHeaderSetXmax (htup , xlrec -> xmax );
9095
9099
else
9096
9100
HeapTupleHeaderSetXmin (htup , InvalidTransactionId );
9097
- HeapTupleHeaderSetCmax ( htup , xlrec -> t_cid , false) ;
9101
+ htup -> t_choice . t_heap . t_field3 . t_cid = xlrec -> t_cid ;
9098
9102
9099
9103
/* Mark the page as a candidate for pruning */
9100
9104
PageSetPrunable (page , XLogRecGetXid (record ));
@@ -9195,7 +9199,7 @@ heap_xlog_insert(XLogReaderState *record)
9195
9199
htup -> t_infomask = xlhdr .t_infomask ;
9196
9200
htup -> t_hoff = xlhdr .t_hoff ;
9197
9201
HeapTupleHeaderSetXmin (htup , XLogRecGetXid (record ));
9198
- HeapTupleHeaderSetCmin ( htup , xlhdr .t_cid ) ;
9202
+ htup -> t_choice . t_heap . t_field3 . t_cid = xlhdr .t_cid ;
9199
9203
htup -> t_ctid = target_tid ;
9200
9204
9201
9205
if (PageAddItem (page , (Item ) htup , newlen , xlrec -> offnum ,
@@ -9338,7 +9342,7 @@ heap_xlog_multi_insert(XLogReaderState *record)
9338
9342
htup -> t_infomask = xlhdr -> t_infomask ;
9339
9343
htup -> t_hoff = xlhdr -> t_hoff ;
9340
9344
HeapTupleHeaderSetXmin (htup , XLogRecGetXid (record ));
9341
- HeapTupleHeaderSetCmin ( htup , xlhdr -> t_cid ) ;
9345
+ htup -> t_choice . t_heap . t_field3 . t_cid = xlhdr -> t_cid ;
9342
9346
ItemPointerSetBlockNumber (& htup -> t_ctid , blkno );
9343
9347
ItemPointerSetOffsetNumber (& htup -> t_ctid , offnum );
9344
9348
@@ -9478,7 +9482,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
9478
9482
fix_infomask_from_infobits (xlrec -> old_infobits_set , & htup -> t_infomask ,
9479
9483
& htup -> t_infomask2 );
9480
9484
HeapTupleHeaderSetXmax (htup , xlrec -> old_xmax );
9481
- HeapTupleHeaderSetCmax ( htup , xlrec -> t_cid , false) ;
9485
+ htup -> t_choice . t_heap . t_field3 . t_cid = xlrec -> t_cid ;
9482
9486
/* Set forward chain link in t_ctid */
9483
9487
htup -> t_ctid = newtid ;
9484
9488
@@ -9611,7 +9615,7 @@ heap_xlog_update(XLogReaderState *record, bool hot_update)
9611
9615
htup -> t_hoff = xlhdr .t_hoff ;
9612
9616
9613
9617
HeapTupleHeaderSetXmin (htup , XLogRecGetXid (record ));
9614
- HeapTupleHeaderSetCmin ( htup , xlhdr .t_cid ) ;
9618
+ htup -> t_choice . t_heap . t_field3 . t_cid = xlhdr .t_cid ;
9615
9619
HeapTupleHeaderSetXmax (htup , xlrec -> new_xmax );
9616
9620
/* Make sure there is no forward chain link in t_ctid */
9617
9621
htup -> t_ctid = newtid ;
@@ -9752,7 +9756,7 @@ heap_xlog_lock(XLogReaderState *record)
9752
9756
offnum );
9753
9757
}
9754
9758
HeapTupleHeaderSetXmax (htup , xlrec -> locking_xid );
9755
- HeapTupleHeaderSetCmax ( htup , xlrec -> t_cid , false) ;
9759
+ htup -> t_choice . t_heap . t_field3 . t_cid = xlrec -> t_cid ;
9756
9760
PageSetLSN (page , lsn );
9757
9761
MarkBufferDirty (buffer );
9758
9762
}
0 commit comments