@@ -1682,7 +1682,7 @@ HeapTupleSatisfiesHistoricMVCC(HeapTuple htup, Snapshot snapshot,
1682
1682
1683
1683
/*
1684
1684
* TempTupleSatisfiesVisibility
1685
- * True iff global temp table tuple is visible for the given snapshot .
1685
+ * True iff global temp table tuple is visible for the current transaction .
1686
1686
*
1687
1687
* Temporary tables are visible only for current backend, so there is no need to
1688
1688
* handle cases with tuples committed by other backends. We only need to exclude
@@ -1696,7 +1696,6 @@ TempTupleSatisfiesVisibility(HeapTuple htup, CommandId curcid, Buffer buffer)
1696
1696
TransactionId xmin ;
1697
1697
TransactionId xmax ;
1698
1698
1699
-
1700
1699
Assert (ItemPointerIsValid (& htup -> t_self ));
1701
1700
Assert (htup -> t_tableOid != InvalidOid );
1702
1701
@@ -1720,27 +1719,17 @@ TempTupleSatisfiesVisibility(HeapTuple htup, CommandId curcid, Buffer buffer)
1720
1719
if (HEAP_XMAX_IS_LOCKED_ONLY (tuple -> t_infomask )) /* not deleter */
1721
1720
return true;
1722
1721
1723
- if (tuple -> t_infomask & HEAP_XMAX_IS_MULTI )
1724
- {
1725
- xmax = HeapTupleGetUpdateXid (tuple );
1726
-
1727
- /* updating subtransaction must have aborted */
1728
- if (IsReplicaTransactionAborted (xmax ))
1729
- return true;
1722
+ xmax = (tuple -> t_infomask & HEAP_XMAX_IS_MULTI )
1723
+ ? HeapTupleGetUpdateXid (tuple )
1724
+ : HeapTupleHeaderGetRawXmax (tuple );
1730
1725
1731
- return (HeapTupleHeaderGetCmax (tuple ) >= curcid );
1732
- }
1733
- xmax = HeapTupleHeaderGetRawXmax (tuple );
1734
-
1735
- /* deleting subtransaction must have aborted */
1736
1726
if (IsReplicaTransactionAborted (xmax ))
1737
- return true;
1727
+ return true; /* updating subtransaction aborted */
1738
1728
1739
- if (IsReplicaCurrentTransactionId (xmax ))
1740
- return ( HeapTupleHeaderGetCmax ( tuple ) >= curcid ) ; /* deleted after scan started */
1729
+ if (! IsReplicaCurrentTransactionId (xmax ))
1730
+ return false ; /* updating transaction committed */
1741
1731
1742
- /* xmax transaction committed */
1743
- return false;
1732
+ return (HeapTupleHeaderGetCmax (tuple ) >= curcid ); /* updated after scan started */
1744
1733
}
1745
1734
1746
1735
0 commit comments