@@ -74,7 +74,7 @@ int DefaultXactIsoLevel = XACT_READ_COMMITTED;
7474int XactIsoLevel ;
7575
7676bool DefaultXactReadOnly = false;
77- /*
77+ /*
7878 * We need initialization because only initialized vars appear in
7979 * postges.def and accssible from loadable extension
8080 */
@@ -119,10 +119,6 @@ TransactionId *ParallelCurrentXids;
119119 */
120120bool MyXactAccessedTempRel = false;
121121
122- /*
123- * Number of logical changes (insert,delte,update,lgical message) performed by transaction
124- */
125- int64 MyXactLogicalChanges = 0 ;
126122
127123/*
128124 * transaction states - transaction state from server perspective
@@ -1920,8 +1916,6 @@ StartTransaction(void)
19201916 XactIsoLevel = DefaultXactIsoLevel ;
19211917 forceSyncCommit = false;
19221918 MyXactAccessedTempRel = false;
1923- MyXactLogicalChanges = 0 ;
1924-
19251919
19261920 /*
19271921 * reinitialize within-transaction counters
@@ -2187,7 +2181,7 @@ CommitTransaction(void)
21872181 * waiting for lock on a relation we've modified, we want them to know
21882182 * about the catalog change before they start using the relation).
21892183 */
2190- xactHasCatcacheInvalidationMessages = HasCatcacheInvalidationMessages ();
2184+ xactHasCatcacheInvalidationMessages = HasCatcacheInvalidationMessages ();
21912185 xactHasRelcacheInvalidationMessages = HasRelcacheInvalidationMessages ();
21922186 AtEOXact_Inval (true);
21932187
@@ -2202,7 +2196,7 @@ CommitTransaction(void)
22022196 RESOURCE_RELEASE_AFTER_LOCKS ,
22032197 true, true);
22042198
2205- if (!is_autonomous_transaction )
2199+ if (!is_autonomous_transaction )
22062200 {
22072201 /*
22082202 * Likewise, dropping of files deleted during the transaction is best done
@@ -2221,13 +2215,13 @@ CommitTransaction(void)
22212215
22222216 AtCommit_Notify ();
22232217 AtEOXact_GUC (true, s -> gucNestLevel );
2224- if (!is_autonomous_transaction )
2218+ if (!is_autonomous_transaction )
22252219 {
22262220 AtEOXact_SPI (true);
22272221 }
22282222 AtEOXact_on_commit_actions (true);
22292223 AtEOXact_Namespace (true, is_parallel_worker );
2230- if (!is_autonomous_transaction )
2224+ if (!is_autonomous_transaction )
22312225 {
22322226 AtEOXact_SMgr ();
22332227 AtEOXact_Files ();
@@ -2695,7 +2689,7 @@ AbortTransaction(void)
26952689 AtEOXact_Buffers (false);
26962690 }
26972691 AtEOXact_RelationCache (false);
2698- xactHasCatcacheInvalidationMessages = HasCatcacheInvalidationMessages ();
2692+ xactHasCatcacheInvalidationMessages = HasCatcacheInvalidationMessages ();
26992693 xactHasRelcacheInvalidationMessages = HasRelcacheInvalidationMessages ();
27002694 AtEOXact_Inval (false);
27012695 AtEOXact_MultiXact ();
@@ -3543,14 +3537,14 @@ void SuspendTransaction(void)
35433537 sus -> TopTransactionStateData = TopTransactionStateData ;
35443538
35453539 sus -> SnapshotState = SuspendSnapshot (); /* only before the resource-owner stuff */
3546-
3547- if (HasCatcacheInvalidationMessages ())
3540+
3541+ if (HasCatcacheInvalidationMessages ())
35483542 {
35493543 ResetCatalogCaches ();
35503544 }
3551- if (HasRelcacheInvalidationMessages ())
3545+ if (HasRelcacheInvalidationMessages ())
35523546 {
3553- RelationCacheInvalidate ();
3547+ RelationCacheInvalidate ();
35543548 }
35553549 sus -> InvalidationInfo = SuspendInvalidationInfo ();
35563550 xactHasCatcacheInvalidationMessages = false;
@@ -3607,7 +3601,7 @@ void SuspendTransaction(void)
36073601
36083602 sus -> PgStatState = PgStatSuspend ();
36093603 sus -> TriggerState = TriggerSuspend ();
3610- sus -> SPIState = SuspendSPI ();
3604+ sus -> SPIState = SuspendSPI ();
36113605 }
36123606
36133607 AtStart_Memory ();
@@ -3666,13 +3660,13 @@ bool ResumeTransaction(void)
36663660
36673661 ResumeSnapshot (sus -> SnapshotState ); /* only after the resource-owner stuff */
36683662 ResumeInvalidationInfo (sus -> InvalidationInfo );
3669- if (xactHasCatcacheInvalidationMessages )
3663+ if (xactHasCatcacheInvalidationMessages )
36703664 {
36713665 ResetCatalogCaches ();
36723666 }
3673- if (xactHasRelcacheInvalidationMessages )
3667+ if (xactHasRelcacheInvalidationMessages )
36743668 {
3675- RelationCacheInvalidate ();
3669+ RelationCacheInvalidate ();
36763670 }
36773671
36783672 MyProc -> backendId = sus -> vxid .backendId ;
@@ -3870,7 +3864,7 @@ EndTransactionBlock(bool autonomous)
38703864 * to COMMIT.
38713865 */
38723866 case TBLOCK_INPROGRESS :
3873- if (autonomous && getNestLevelATX () == 0 ) {
3867+ if (autonomous && getNestLevelATX () == 0 ) {
38743868 ereport (WARNING ,
38753869 (errcode (ERRCODE_NO_ACTIVE_SQL_TRANSACTION ),
38763870 errmsg ("there is no autonomous transaction in progress" )));
@@ -3999,7 +3993,7 @@ UserAbortTransactionBlock(bool autonomous)
39993993 * exit the transaction block.
40003994 */
40013995 case TBLOCK_INPROGRESS :
4002- if (autonomous && getNestLevelATX () == 0 ) {
3996+ if (autonomous && getNestLevelATX () == 0 ) {
40033997 ereport (WARNING ,
40043998 (errcode (ERRCODE_NO_ACTIVE_SQL_TRANSACTION ),
40053999 errmsg ("there is no autonomous transaction in progress" )));
@@ -5179,7 +5173,7 @@ EstimateTransactionStateSpace(void)
51795173 nxids = add_size (nxids , s -> nChildXids );
51805174 }
51815175
5182- nxids = add_size (nxids , nParallelCurrentXids );
5176+ nxids = add_size (nxids , nParallelCurrentXids );
51835177 nxids = mul_size (nxids , sizeof (TransactionId ));
51845178 return add_size (nxids , TM -> GetTransactionStateSize ());
51855179}
@@ -5495,7 +5489,6 @@ XactLogCommitRecord(TimestampTz commit_time,
54955489 /* First figure out and collect all the information needed */
54965490
54975491 xlrec .xact_time = commit_time ;
5498- xlrec .n_changes = MyXactLogicalChanges ;
54995492
55005493 if (relcacheInval )
55015494 xl_xinfo .xinfo |= XACT_COMPLETION_UPDATE_RELCACHE_FILE ;
@@ -5897,7 +5890,7 @@ xact_redo_commit(xl_xact_parsed_commit *parsed,
58975890 * because subtransaction commit is never WAL logged.
58985891 */
58995892static void
5900- xact_redo_abort (xl_xact_parsed_abort * parsed ,
5893+ xact_redo_abort (xl_xact_parsed_abort * parsed ,
59015894 TransactionId xid ,
59025895 XLogRecPtr lsn ,
59035896 RepOriginId origin_id )
@@ -6043,9 +6036,9 @@ xact_redo(XLogReaderState *record)
60436036 RecreateTwoPhaseFile (XLogRecGetXid (record ),
60446037 XLogRecGetData (record ), XLogRecGetDataLen (record ));
60456038
6046- if (originId != InvalidRepOriginId && originId != DoNotReplicateId )
6039+ if (originId != InvalidRepOriginId && originId != DoNotReplicateId )
60476040 {
6048- xl_xact_parsed_prepare parsed ;
6041+ xl_xact_parsed_prepare parsed ;
60496042 ParsePrepareRecord (XLogRecGetXid (record ), XLogRecGetData (record ), & parsed );
60506043 Assert (parsed .origin_lsn != InvalidXLogRecPtr );
60516044 /* recover apply progress */
@@ -6066,17 +6059,17 @@ xact_redo(XLogReaderState *record)
60666059}
60676060
60686061Datum pg_current_tx_nest_level (PG_FUNCTION_ARGS )
6069- {
6062+ {
60706063 PG_RETURN_INT64 (GetCurrentTransactionNestLevel ());
60716064}
60726065
60736066Datum pg_current_atx_nest_level (PG_FUNCTION_ARGS )
6074- {
6067+ {
60756068 PG_RETURN_INT64 (getNestLevelATX ());
60766069}
60776070
60786071Datum pg_current_atx_has_ancestor (PG_FUNCTION_ARGS )
6079- {
6072+ {
60806073 int64 xid = PG_GETARG_INT64 (0 );
60816074 PG_RETURN_BOOL (TransactionIdIsAncestorOfCurrentATX (xid ));
60826075}
0 commit comments