@@ -74,6 +74,7 @@ static XidStatus DtmGetTransactionStatus(TransactionId xid, XLogRecPtr *lsn);
7474static void DtmSetTransactionStatus (TransactionId xid , int nsubxids , TransactionId * subxids , XidStatus status , XLogRecPtr lsn );
7575static void DtmUpdateRecentXmin (Snapshot snapshot );
7676static void DtmInitialize (void );
77+ static void DtmSubXactCallback (XactEvent event , void * arg );
7778static void DtmXactCallback (XactEvent event , void * arg );
7879static TransactionId DtmGetNextXid (void );
7980static TransactionId DtmGetNewTransactionId (bool isSubXact );
@@ -105,7 +106,6 @@ static SnapshotData DtmSnapshot = { HeapTupleSatisfiesMVCC };
105106static bool DtmHasGlobalSnapshot ;
106107static bool DtmGlobalXidAssigned ;
107108static int DtmLocalXidReserve ;
108- static int DtmCurcid ;
109109static Snapshot DtmLastSnapshot ;
110110static TransactionManager DtmTM = {
111111 DtmGetTransactionStatus ,
@@ -605,9 +605,9 @@ static Snapshot DtmGetSnapshot(Snapshot snapshot)
605605 }
606606 if (TransactionIdIsValid (DtmNextXid ) && snapshot != & CatalogSnapshotData )
607607 {
608- if (!DtmHasGlobalSnapshot && ( snapshot != DtmLastSnapshot || DtmCurcid != snapshot -> curcid ))
608+ if (!DtmHasGlobalSnapshot ) {
609609 DtmGlobalGetSnapshot (DtmNextXid , & DtmSnapshot , & dtm -> minXid );
610- DtmCurcid = snapshot -> curcid ;
610+ }
611611 DtmLastSnapshot = snapshot ;
612612 DtmMergeWithGlobalSnapshot (snapshot );
613613 if (!IsolationUsesXactSnapshot ())
@@ -717,6 +717,7 @@ static void DtmInitialize()
717717 dtm -> nReservedXids = 0 ;
718718 dtm -> minXid = InvalidTransactionId ;
719719 RegisterXactCallback (DtmXactCallback , NULL );
720+ RegisterSubXactCallback (DtmSubXactCallback , NULL );
720721 }
721722 LWLockRelease (AddinShmemInitLock );
722723
@@ -735,6 +736,12 @@ static void DtmInitialize()
735736 TM = & DtmTM ;
736737}
737738
739+ static void
740+ DtmSubXactCallback (XactEvent event , void * arg )
741+ {
742+ elog (ERROR , "Subtransactions are not currently supported" );
743+ }
744+
738745static void
739746DtmXactCallback (XactEvent event , void * arg )
740747{
0 commit comments