@@ -163,8 +163,12 @@ HeapTupleSetHintBits(HeapTupleHeader tuple, Buffer buffer,
163
163
* Xmax is not committed))) that has not been committed
164
164
*/
165
165
bool
166
- HeapTupleSatisfiesSelf (HeapTupleHeader tuple , Snapshot snapshot , Buffer buffer )
166
+ HeapTupleSatisfiesSelf (HeapTuple htup , Snapshot snapshot , Buffer buffer )
167
167
{
168
+ HeapTupleHeader tuple = htup -> t_data ;
169
+ Assert (ItemPointerIsValid (& htup -> t_self ));
170
+ Assert (htup -> t_tableOid != InvalidOid );
171
+
168
172
if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
169
173
{
170
174
if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -351,8 +355,12 @@ HeapTupleSatisfiesSelf(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
351
355
*
352
356
*/
353
357
bool
354
- HeapTupleSatisfiesNow (HeapTupleHeader tuple , Snapshot snapshot , Buffer buffer )
358
+ HeapTupleSatisfiesNow (HeapTuple htup , Snapshot snapshot , Buffer buffer )
355
359
{
360
+ HeapTupleHeader tuple = htup -> t_data ;
361
+ Assert (ItemPointerIsValid (& htup -> t_self ));
362
+ Assert (htup -> t_tableOid != InvalidOid );
363
+
356
364
if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
357
365
{
358
366
if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -526,7 +534,7 @@ HeapTupleSatisfiesNow(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
526
534
* Dummy "satisfies" routine: any tuple satisfies SnapshotAny.
527
535
*/
528
536
bool
529
- HeapTupleSatisfiesAny (HeapTupleHeader tuple , Snapshot snapshot , Buffer buffer )
537
+ HeapTupleSatisfiesAny (HeapTuple htup , Snapshot snapshot , Buffer buffer )
530
538
{
531
539
return true;
532
540
}
@@ -546,9 +554,13 @@ HeapTupleSatisfiesAny(HeapTupleHeader tuple, Snapshot snapshot, Buffer buffer)
546
554
* table.
547
555
*/
548
556
bool
549
- HeapTupleSatisfiesToast (HeapTupleHeader tuple , Snapshot snapshot ,
557
+ HeapTupleSatisfiesToast (HeapTuple htup , Snapshot snapshot ,
550
558
Buffer buffer )
551
559
{
560
+ HeapTupleHeader tuple = htup -> t_data ;
561
+ Assert (ItemPointerIsValid (& htup -> t_self ));
562
+ Assert (htup -> t_tableOid != InvalidOid );
563
+
552
564
if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
553
565
{
554
566
if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -627,9 +639,13 @@ HeapTupleSatisfiesToast(HeapTupleHeader tuple, Snapshot snapshot,
627
639
* distinguish that case must test for it themselves.)
628
640
*/
629
641
HTSU_Result
630
- HeapTupleSatisfiesUpdate (HeapTupleHeader tuple , CommandId curcid ,
642
+ HeapTupleSatisfiesUpdate (HeapTuple htup , CommandId curcid ,
631
643
Buffer buffer )
632
644
{
645
+ HeapTupleHeader tuple = htup -> t_data ;
646
+ Assert (ItemPointerIsValid (& htup -> t_self ));
647
+ Assert (htup -> t_tableOid != InvalidOid );
648
+
633
649
if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
634
650
{
635
651
if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -849,9 +865,13 @@ HeapTupleSatisfiesUpdate(HeapTupleHeader tuple, CommandId curcid,
849
865
* for snapshot->xmax and the tuple's xmax.
850
866
*/
851
867
bool
852
- HeapTupleSatisfiesDirty (HeapTupleHeader tuple , Snapshot snapshot ,
868
+ HeapTupleSatisfiesDirty (HeapTuple htup , Snapshot snapshot ,
853
869
Buffer buffer )
854
870
{
871
+ HeapTupleHeader tuple = htup -> t_data ;
872
+ Assert (ItemPointerIsValid (& htup -> t_self ));
873
+ Assert (htup -> t_tableOid != InvalidOid );
874
+
855
875
snapshot -> xmin = snapshot -> xmax = InvalidTransactionId ;
856
876
857
877
if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
@@ -1040,9 +1060,13 @@ HeapTupleSatisfiesDirty(HeapTupleHeader tuple, Snapshot snapshot,
1040
1060
* can't see it.)
1041
1061
*/
1042
1062
bool
1043
- HeapTupleSatisfiesMVCC (HeapTupleHeader tuple , Snapshot snapshot ,
1063
+ HeapTupleSatisfiesMVCC (HeapTuple htup , Snapshot snapshot ,
1044
1064
Buffer buffer )
1045
1065
{
1066
+ HeapTupleHeader tuple = htup -> t_data ;
1067
+ Assert (ItemPointerIsValid (& htup -> t_self ));
1068
+ Assert (htup -> t_tableOid != InvalidOid );
1069
+
1046
1070
if (!(tuple -> t_infomask & HEAP_XMIN_COMMITTED ))
1047
1071
{
1048
1072
if (tuple -> t_infomask & HEAP_XMIN_INVALID )
@@ -1233,9 +1257,13 @@ HeapTupleSatisfiesMVCC(HeapTupleHeader tuple, Snapshot snapshot,
1233
1257
* even if we see that the deleting transaction has committed.
1234
1258
*/
1235
1259
HTSV_Result
1236
- HeapTupleSatisfiesVacuum (HeapTupleHeader tuple , TransactionId OldestXmin ,
1260
+ HeapTupleSatisfiesVacuum (HeapTuple htup , TransactionId OldestXmin ,
1237
1261
Buffer buffer )
1238
1262
{
1263
+ HeapTupleHeader tuple = htup -> t_data ;
1264
+ Assert (ItemPointerIsValid (& htup -> t_self ));
1265
+ Assert (htup -> t_tableOid != InvalidOid );
1266
+
1239
1267
/*
1240
1268
* Has inserting transaction committed?
1241
1269
*
@@ -1466,8 +1494,12 @@ HeapTupleSatisfiesVacuum(HeapTupleHeader tuple, TransactionId OldestXmin,
1466
1494
* just whether or not the tuple is surely dead).
1467
1495
*/
1468
1496
bool
1469
- HeapTupleIsSurelyDead (HeapTupleHeader tuple , TransactionId OldestXmin )
1497
+ HeapTupleIsSurelyDead (HeapTuple htup , TransactionId OldestXmin )
1470
1498
{
1499
+ HeapTupleHeader tuple = htup -> t_data ;
1500
+ Assert (ItemPointerIsValid (& htup -> t_self ));
1501
+ Assert (htup -> t_tableOid != InvalidOid );
1502
+
1471
1503
/*
1472
1504
* If the inserting transaction is marked invalid, then it aborted, and
1473
1505
* the tuple is definitely dead. If it's marked neither committed nor
0 commit comments