@@ -166,9 +166,9 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
166
166
Assert (ItemPointerIsValid (& htup -> t_self ));
167
167
Assert (htup -> t_tableOid != InvalidOid );
168
168
169
- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
169
+ if (!HeapTupleHeaderXminCommitted (tuple ))
170
170
{
171
- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
171
+ if (HeapTupleHeaderXminInvalid ( tuple ) )
172
172
return false;
173
173
174
174
/* Used by pre-9.0 binary upgrades */
@@ -210,7 +210,7 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
210
210
}
211
211
}
212
212
}
213
- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
213
+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
214
214
{
215
215
if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid */
216
216
return true;
@@ -244,11 +244,11 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
244
244
245
245
return false;
246
246
}
247
- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
247
+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
248
248
return false;
249
- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
249
+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
250
250
SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
251
- HeapTupleHeaderGetXmin (tuple ));
251
+ HeapTupleHeaderGetRawXmin (tuple ));
252
252
else
253
253
{
254
254
/* it must have aborted or crashed */
@@ -356,9 +356,9 @@ HeapTupleSatisfiesToast(HeapTuple htup, Snapshot snapshot,
356
356
Assert (ItemPointerIsValid (& htup -> t_self ));
357
357
Assert (htup -> t_tableOid != InvalidOid );
358
358
359
- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
359
+ if (!HeapTupleHeaderXminCommitted (tuple ))
360
360
{
361
- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
361
+ if (HeapTupleHeaderXminInvalid ( tuple ) )
362
362
return false;
363
363
364
364
/* Used by pre-9.0 binary upgrades */
@@ -441,9 +441,9 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
441
441
Assert (ItemPointerIsValid (& htup -> t_self ));
442
442
Assert (htup -> t_tableOid != InvalidOid );
443
443
444
- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
444
+ if (!HeapTupleHeaderXminCommitted (tuple ))
445
445
{
446
- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
446
+ if (HeapTupleHeaderXminInvalid ( tuple ) )
447
447
return HeapTupleInvisible ;
448
448
449
449
/* Used by pre-9.0 binary upgrades */
@@ -485,7 +485,7 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
485
485
}
486
486
}
487
487
}
488
- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
488
+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
489
489
{
490
490
if (HeapTupleHeaderGetCmin (tuple ) >= curcid )
491
491
return HeapTupleInvisible ; /* inserted after scan started */
@@ -564,11 +564,11 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
564
564
else
565
565
return HeapTupleInvisible ; /* updated before scan started */
566
566
}
567
- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
567
+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
568
568
return HeapTupleInvisible ;
569
- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
569
+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
570
570
SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
571
- HeapTupleHeaderGetXmin (tuple ));
571
+ HeapTupleHeaderGetRawXmin (tuple ));
572
572
else
573
573
{
574
574
/* it must have aborted or crashed */
@@ -715,9 +715,9 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
715
715
716
716
snapshot -> xmin = snapshot -> xmax = InvalidTransactionId ;
717
717
718
- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
718
+ if (!HeapTupleHeaderXminCommitted (tuple ))
719
719
{
720
- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
720
+ if (HeapTupleHeaderXminInvalid ( tuple ) )
721
721
return false;
722
722
723
723
/* Used by pre-9.0 binary upgrades */
@@ -759,7 +759,7 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
759
759
}
760
760
}
761
761
}
762
- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
762
+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
763
763
{
764
764
if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid */
765
765
return true;
@@ -793,15 +793,15 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
793
793
794
794
return false;
795
795
}
796
- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
796
+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
797
797
{
798
- snapshot -> xmin = HeapTupleHeaderGetXmin (tuple );
798
+ snapshot -> xmin = HeapTupleHeaderGetRawXmin (tuple );
799
799
/* XXX shouldn't we fall through to look at xmax? */
800
800
return true; /* in insertion by other */
801
801
}
802
- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
802
+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
803
803
SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
804
- HeapTupleHeaderGetXmin (tuple ));
804
+ HeapTupleHeaderGetRawXmin (tuple ));
805
805
else
806
806
{
807
807
/* it must have aborted or crashed */
@@ -909,9 +909,9 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
909
909
Assert (ItemPointerIsValid (& htup -> t_self ));
910
910
Assert (htup -> t_tableOid != InvalidOid );
911
911
912
- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
912
+ if (!HeapTupleHeaderXminCommitted (tuple ))
913
913
{
914
- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
914
+ if (HeapTupleHeaderXminInvalid ( tuple ) )
915
915
return false;
916
916
917
917
/* Used by pre-9.0 binary upgrades */
@@ -953,7 +953,7 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
953
953
}
954
954
}
955
955
}
956
- else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetXmin (tuple )))
956
+ else if (TransactionIdIsCurrentTransactionId (HeapTupleHeaderGetRawXmin (tuple )))
957
957
{
958
958
if (HeapTupleHeaderGetCmin (tuple ) >= snapshot -> curcid )
959
959
return false; /* inserted after scan started */
@@ -995,11 +995,11 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
995
995
else
996
996
return false; /* deleted before scan started */
997
997
}
998
- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
998
+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
999
999
return false;
1000
- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
1000
+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
1001
1001
SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
1002
- HeapTupleHeaderGetXmin (tuple ));
1002
+ HeapTupleHeaderGetRawXmin (tuple ));
1003
1003
else
1004
1004
{
1005
1005
/* it must have aborted or crashed */
@@ -1013,7 +1013,8 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
1013
1013
* By here, the inserting transaction has committed - have to check
1014
1014
* when...
1015
1015
*/
1016
- if (XidInMVCCSnapshot (HeapTupleHeaderGetXmin (tuple ), snapshot ))
1016
+ if (!HeapTupleHeaderXminFrozen (tuple )
1017
+ && XidInMVCCSnapshot (HeapTupleHeaderGetRawXmin (tuple ), snapshot ))
1017
1018
return false; /* treat as still in progress */
1018
1019
1019
1020
if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid or aborted */
@@ -1116,9 +1117,9 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
1116
1117
* If the inserting transaction aborted, then the tuple was never visible
1117
1118
* to any other transaction, so we can delete it immediately.
1118
1119
*/
1119
- if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
1120
+ if (!HeapTupleHeaderXminCommitted (tuple ))
1120
1121
{
1121
- if (tuple -> t_infomask & HEAP_XMIN_INVALID )
1122
+ if (HeapTupleHeaderXminInvalid ( tuple ) )
1122
1123
return HEAPTUPLE_DEAD ;
1123
1124
/* Used by pre-9.0 binary upgrades */
1124
1125
else if (tuple -> t_infomask & HEAP_MOVED_OFF )
@@ -1157,7 +1158,7 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
1157
1158
return HEAPTUPLE_DEAD ;
1158
1159
}
1159
1160
}
1160
- else if (TransactionIdIsInProgress (HeapTupleHeaderGetXmin (tuple )))
1161
+ else if (TransactionIdIsInProgress (HeapTupleHeaderGetRawXmin (tuple )))
1161
1162
{
1162
1163
if (tuple -> t_infomask & HEAP_XMAX_INVALID ) /* xid invalid */
1163
1164
return HEAPTUPLE_INSERT_IN_PROGRESS ;
@@ -1168,9 +1169,9 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
1168
1169
/* inserted and then deleted by same xact */
1169
1170
return HEAPTUPLE_DELETE_IN_PROGRESS ;
1170
1171
}
1171
- else if (TransactionIdDidCommit (HeapTupleHeaderGetXmin (tuple )))
1172
+ else if (TransactionIdDidCommit (HeapTupleHeaderGetRawXmin (tuple )))
1172
1173
SetHintBits (tuple , buffer , HEAP_XMIN_COMMITTED ,
1173
- HeapTupleHeaderGetXmin (tuple ));
1174
+ HeapTupleHeaderGetRawXmin (tuple ));
1174
1175
else
1175
1176
{
1176
1177
/*
@@ -1347,8 +1348,8 @@ HeapTupleIsSurelyDead(HeapTuple htup, TransactionId OldestXmin)
1347
1348
* invalid, then we assume it's still alive (since the presumption is that
1348
1349
* all relevant hint bits were just set moments ago).
1349
1350
*/
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;
1352
1353
1353
1354
/*
1354
1355
* If the inserting transaction committed, but any deleting transaction
0 commit comments