@@ -166,9 +166,9 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
166166 Assert (ItemPointerIsValid (& htup -> t_self ));
167167 Assert (htup -> t_tableOid != InvalidOid );
168168
169- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
169+ if (!HeapTupleHeaderXminCommitted (tuple ))
170170 {
171- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
171+ if (HeapTupleHeaderXminInvalid ( tuple ) )
172172 return false;
173173
174174 /* Used by pre-9.0 binary upgrades */
@@ -210,7 +210,7 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
210210 }
211211 }
212212 }
213- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
213+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
214214 {
215215 if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid */
216216 return true;
@@ -244,11 +244,11 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
244244
245245 return false;
246246 }
247- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
247+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
248248 return false;
249- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
249+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
250250 SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
251- HeapTupleHeaderGetXmin (tuple ));
251+ HeapTupleHeaderGetRawXmin (tuple ));
252252 else
253253 {
254254 /* it must have aborted or crashed */
@@ -356,9 +356,9 @@ HeapTupleSatisfiesToast(HeapTuple htup, Snapshot snapshot,
356356 Assert (ItemPointerIsValid (& htup -> t_self ));
357357 Assert (htup -> t_tableOid != InvalidOid );
358358
359- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
359+ if (!HeapTupleHeaderXminCommitted (tuple ))
360360 {
361- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
361+ if (HeapTupleHeaderXminInvalid ( tuple ) )
362362 return false;
363363
364364 /* Used by pre-9.0 binary upgrades */
@@ -441,9 +441,9 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
441441 Assert (ItemPointerIsValid (& htup -> t_self ));
442442 Assert (htup -> t_tableOid != InvalidOid );
443443
444- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
444+ if (!HeapTupleHeaderXminCommitted (tuple ))
445445 {
446- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
446+ if (HeapTupleHeaderXminInvalid ( tuple ) )
447447 return HeapTupleInvisible ;
448448
449449 /* Used by pre-9.0 binary upgrades */
@@ -485,7 +485,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
485485 }
486486 }
487487 }
488- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
488+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
489489 {
490490 if (HeapTupleHeaderGetCmin (tuple ) >= curcid )
491491 return HeapTupleInvisible ; /* inserted after scan started */
@@ -564,11 +564,11 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
564564 else
565565 return HeapTupleInvisible ; /* updated before scan started */
566566 }
567- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
567+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
568568 return HeapTupleInvisible ;
569- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
569+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
570570 SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
571- HeapTupleHeaderGetXmin (tuple ));
571+ HeapTupleHeaderGetRawXmin (tuple ));
572572 else
573573 {
574574 /* it must have aborted or crashed */
@@ -715,9 +715,9 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
715715
716716 snapshot -> xmin = snapshot -> xmax = InvalidTransactionId ;
717717
718- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
718+ if (!HeapTupleHeaderXminCommitted (tuple ))
719719 {
720- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
720+ if (HeapTupleHeaderXminInvalid ( tuple ) )
721721 return false;
722722
723723 /* Used by pre-9.0 binary upgrades */
@@ -759,7 +759,7 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
759759 }
760760 }
761761 }
762- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
762+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
763763 {
764764 if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid */
765765 return true;
@@ -793,15 +793,15 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
793793
794794 return false;
795795 }
796- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
796+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
797797 {
798- snapshot -> xmin = HeapTupleHeaderGetXmin (tuple );
798+ snapshot -> xmin = HeapTupleHeaderGetRawXmin (tuple );
799799 /* XXX shouldn't we fall through to look at xmax? */
800800 return true; /* in insertion by other */
801801 }
802- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
802+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
803803 SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
804- HeapTupleHeaderGetXmin (tuple ));
804+ HeapTupleHeaderGetRawXmin (tuple ));
805805 else
806806 {
807807 /* it must have aborted or crashed */
@@ -909,9 +909,9 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
909909 Assert (ItemPointerIsValid (& htup -> t_self ));
910910 Assert (htup -> t_tableOid != InvalidOid );
911911
912- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
912+ if (!HeapTupleHeaderXminCommitted (tuple ))
913913 {
914- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
914+ if (HeapTupleHeaderXminInvalid ( tuple ) )
915915 return false;
916916
917917 /* Used by pre-9.0 binary upgrades */
@@ -953,7 +953,7 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
953953 }
954954 }
955955 }
956- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
956+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
957957 {
958958 if (HeapTupleHeaderGetCmin (tuple ) >= snapshot -> curcid )
959959 return false; /* inserted after scan started */
@@ -995,11 +995,11 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
995995 else
996996 return false; /* deleted before scan started */
997997 }
998- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
998+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
999999 return false;
1000- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
1000+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
10011001 SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
1002- HeapTupleHeaderGetXmin (tuple ));
1002+ HeapTupleHeaderGetRawXmin (tuple ));
10031003 else
10041004 {
10051005 /* it must have aborted or crashed */
@@ -1013,7 +1013,8 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
10131013 * By here, the inserting transaction has committed - have to check
10141014 * when...
10151015 */
1016- if (XidInMVCCSnapshot (HeapTupleHeaderGetXmin (tuple ), snapshot ))
1016+ if (!HeapTupleHeaderXminFrozen (tuple )
1017+ && XidInMVCCSnapshot (HeapTupleHeaderGetRawXmin (tuple ), snapshot ))
10171018 return false; /* treat as still in progress */
10181019
10191020 if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid or aborted */
@@ -1116,9 +1117,9 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
11161117 * If the inserting transaction aborted, then the tuple was never visible
11171118 * to any other transaction, so we can delete it immediately.
11181119 */
1119- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
1120+ if (!HeapTupleHeaderXminCommitted (tuple ))
11201121 {
1121- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
1122+ if (HeapTupleHeaderXminInvalid ( tuple ) )
11221123 return HEAPTUPLE_DEAD ;
11231124 /* Used by pre-9.0 binary upgrades */
11241125 else if (tuple -> t_infomask & HEAP_MOVED_OFF )
@@ -1157,7 +1158,7 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
11571158 return HEAPTUPLE_DEAD ;
11581159 }
11591160 }
1160- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
1161+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
11611162 {
11621163 if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid */
11631164 return HEAPTUPLE_INSERT_IN_PROGRESS ;
@@ -1168,9 +1169,9 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
11681169 /* inserted and then deleted by same xact */
11691170 return HEAPTUPLE_DELETE_IN_PROGRESS ;
11701171 }
1171- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
1172+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
11721173 SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
1173- HeapTupleHeaderGetXmin (tuple ));
1174+ HeapTupleHeaderGetRawXmin (tuple ));
11741175 else
11751176 {
11761177 /*
@@ -1347,8 +1348,8 @@ HeapTupleIsSurelyDead(HeapTuple htup, TransactionId OldestXmin)
13471348 * invalid, then we assume it's still alive (since the presumption is that
13481349 * all relevant hint bits were just set moments ago).
13491350 */
1350- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
1351- return (tuple -> t_infomask & HEAP_XMIN_INVALID ) != 0 ? true : false;
1351+ if (!HeapTupleHeaderXminCommitted (tuple ))
1352+ return HeapTupleHeaderXminInvalid (tuple ) ? true : false;
13521353
13531354 /*
13541355 * If the inserting transaction committed, but any deleting transaction
0 commit comments