@@ -79,7 +79,6 @@ static void process_remote_insert(StringInfo s, Relation rel);
79
79
static void process_remote_update (StringInfo s , Relation rel );
80
80
static void process_remote_delete (StringInfo s , Relation rel );
81
81
82
- static MemoryContext TopContext ;
83
82
static bool GucAltered ; /* transaction is setting some GUC variables */
84
83
85
84
/*
@@ -662,7 +661,7 @@ process_remote_commit(StringInfo in)
662
661
case PGLOGICAL_PREPARE :
663
662
{
664
663
Assert (IsTransactionState () && TransactionIdIsValid (MtmGetCurrentTransactionId ()));
665
- gid = pstrdup ( pq_getmsgstring (in )); /* in case of spilling large transaction to the file, message body will be deallocated, so copy it */
664
+ gid = pq_getmsgstring (in );
666
665
if (MtmExchangeGlobalTransactionStatus (gid , TRANSACTION_STATUS_IN_PROGRESS ) == TRANSACTION_STATUS_ABORTED ) {
667
666
MTM_LOG1 ("Avoid prepare of previously aborted global transaction %s" , gid );
668
667
AbortCurrentTransaction ();
@@ -1047,7 +1046,7 @@ void MtmExecutor(void* work, size_t size)
1047
1046
ALLOCSET_DEFAULT_INITSIZE ,
1048
1047
ALLOCSET_DEFAULT_MAXSIZE );
1049
1048
}
1050
- TopContext = MemoryContextSwitchTo (MtmApplyContext );
1049
+ TopMemoryContext = MemoryContextSwitchTo (MtmApplyContext );
1051
1050
replorigin_session_origin = InvalidRepOriginId ;
1052
1051
PG_TRY ();
1053
1052
{
0 commit comments