@@ -163,8 +163,12 @@ HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
163163 * Xmax is not committed))) that has not been committed
164164 */
165165bool
166- HeapTupleSatisfiesSelf (HeapTupleHeader tuple , Snapshot snapshot , Buffer buffer )
166+ HeapTupleSatisfiesSelf (HeapTuple htup , Snapshot snapshot , Buffer buffer )
167167{
168+ HeapTupleHeader tuple = htup -> t_data ;
169+ Assert (ItemPointerIsValid (& htup -> t_self ));
170+ Assert (htup -> t_tableOid != InvalidOid );
171+
168172 if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
169173 {
170174 if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -351,8 +355,12 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
351355 *
352356 */
353357bool
354- HeapTupleSatisfiesNow (HeapTupleHeader tuple , Snapshot snapshot , Buffer buffer )
358+ HeapTupleSatisfiesNow (HeapTuple htup , Snapshot snapshot , Buffer buffer )
355359{
360+ HeapTupleHeader tuple = htup -> t_data ;
361+ Assert (ItemPointerIsValid (& htup -> t_self ));
362+ Assert (htup -> t_tableOid != InvalidOid );
363+
356364 if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
357365 {
358366 if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -526,7 +534,7 @@ HeapTupleSatisfiesNow(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
526534 * Dummy "satisfies" routine: any tuple satisfies SnapshotAny.
527535 */
528536bool
529- HeapTupleSatisfiesAny (HeapTupleHeader tuple , Snapshot snapshot , Buffer buffer )
537+ HeapTupleSatisfiesAny (HeapTuple htup , Snapshot snapshot , Buffer buffer )
530538{
531539 return true;
532540}
@@ -546,9 +554,13 @@ HeapTupleSatisfiesAny(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
546554 * table.
547555 */
548556bool
549- HeapTupleSatisfiesToast (HeapTupleHeader tuple , Snapshot snapshot ,
557+ HeapTupleSatisfiesToast (HeapTuple htup , Snapshot snapshot ,
550558 Buffer buffer )
551559{
560+ HeapTupleHeader tuple = htup -> t_data ;
561+ Assert (ItemPointerIsValid (& htup -> t_self ));
562+ Assert (htup -> t_tableOid != InvalidOid );
563+
552564 if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
553565 {
554566 if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -627,9 +639,13 @@ HeapTupleSatisfiesToast(HeapTupleHeader tuple, Snapshot snapshot,
627639 * distinguish that case must test for it themselves.)
628640 */
629641HTSU_Result
630- HeapTupleSatisfiesUpdate (HeapTupleHeader tuple , CommandId curcid ,
642+ HeapTupleSatisfiesUpdate (HeapTuple htup , CommandId curcid ,
631643 Buffer buffer )
632644{
645+ HeapTupleHeader tuple = htup -> t_data ;
646+ Assert (ItemPointerIsValid (& htup -> t_self ));
647+ Assert (htup -> t_tableOid != InvalidOid );
648+
633649 if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
634650 {
635651 if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -849,9 +865,13 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
849865 * for snapshot->xmax and the tuple's xmax.
850866 */
851867bool
852- HeapTupleSatisfiesDirty (HeapTupleHeader tuple , Snapshot snapshot ,
868+ HeapTupleSatisfiesDirty (HeapTuple htup , Snapshot snapshot ,
853869 Buffer buffer )
854870{
871+ HeapTupleHeader tuple = htup -> t_data ;
872+ Assert (ItemPointerIsValid (& htup -> t_self ));
873+ Assert (htup -> t_tableOid != InvalidOid );
874+
855875 snapshot -> xmin = snapshot -> xmax = InvalidTransactionId ;
856876
857877 if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
@@ -1040,9 +1060,13 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
10401060 * can't see it.)
10411061 */
10421062bool
1043- HeapTupleSatisfiesMVCC (HeapTupleHeader tuple , Snapshot snapshot ,
1063+ HeapTupleSatisfiesMVCC (HeapTuple htup , Snapshot snapshot ,
10441064 Buffer buffer )
10451065{
1066+ HeapTupleHeader tuple = htup -> t_data ;
1067+ Assert (ItemPointerIsValid (& htup -> t_self ));
1068+ Assert (htup -> t_tableOid != InvalidOid );
1069+
10461070 if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
10471071 {
10481072 if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -1233,9 +1257,13 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
12331257 * even if we see that the deleting transaction has committed.
12341258 */
12351259HTSV_Result
1236- HeapTupleSatisfiesVacuum (HeapTupleHeader tuple , TransactionId OldestXmin ,
1260+ HeapTupleSatisfiesVacuum (HeapTuple htup , TransactionId OldestXmin ,
12371261 Buffer buffer )
12381262{
1263+ HeapTupleHeader tuple = htup -> t_data ;
1264+ Assert (ItemPointerIsValid (& htup -> t_self ));
1265+ Assert (htup -> t_tableOid != InvalidOid );
1266+
12391267 /*
12401268 * Has inserting transaction committed?
12411269 *
@@ -1466,8 +1494,12 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
14661494 * just whether or not the tuple is surely dead).
14671495 */
14681496bool
1469- HeapTupleIsSurelyDead (HeapTupleHeader tuple , TransactionId OldestXmin )
1497+ HeapTupleIsSurelyDead (HeapTuple htup , TransactionId OldestXmin )
14701498{
1499+ HeapTupleHeader tuple = htup -> t_data ;
1500+ Assert (ItemPointerIsValid (& htup -> t_self ));
1501+ Assert (htup -> t_tableOid != InvalidOid );
1502+
14711503 /*
14721504 * If the inserting transaction is marked invalid, then it aborted, and
14731505 * the tuple is definitely dead. If it's marked neither committed nor
0 commit comments