@@ -79,7 +79,6 @@ static void process_remote_insert(StringInfo s, Relation rel);
7979static void process_remote_update (StringInfo s ,Relation rel );
8080static void process_remote_delete (StringInfo s ,Relation rel );
8181
82- static MemoryContext TopContext ;
8382static bool GucAltered ;/* transaction is setting some GUC variables */
8483
8584/*
@@ -662,7 +661,7 @@ process_remote_commit(StringInfo in)
662661case PGLOGICAL_PREPARE :
663662{
664663Assert (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 );
666665if (MtmExchangeGlobalTransactionStatus (gid ,TRANSACTION_STATUS_IN_PROGRESS )== TRANSACTION_STATUS_ABORTED ) {
667666MTM_LOG1 ("Avoid prepare of previously aborted global transaction %s" ,gid );
668667AbortCurrentTransaction ();
@@ -1047,7 +1046,7 @@ void MtmExecutor(void* work, size_t size)
10471046ALLOCSET_DEFAULT_INITSIZE ,
10481047ALLOCSET_DEFAULT_MAXSIZE );
10491048 }
1050- TopContext = MemoryContextSwitchTo (MtmApplyContext );
1049+ TopMemoryContext = MemoryContextSwitchTo (MtmApplyContext );
10511050replorigin_session_origin = InvalidRepOriginId ;
10521051PG_TRY ();
10531052 {