@@ -5173,7 +5173,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
5173
5173
pgClassTuple = SearchSysCache1 (RELOID , tableOid );
5174
5174
pgClassStruct = (Form_pg_class ) GETSTRUCT (pgClassTuple );
5175
5175
if (pgClassStruct -> relpersistence == 't' )
5176
- MyXactAccessedTempRel = true ;
5176
+ MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPREL ;
5177
5177
ReleaseSysCache (pgClassTuple );
5178
5178
}
5179
5179
break ;
@@ -5341,7 +5341,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
5341
5341
}
5342
5342
else MTM_LOG3 ("Skip utility statement '%s': skip=%d, insideDDL=%d" , queryString , skipCommand , MtmDDLStatement != NULL );
5343
5343
5344
- prevMyXactAccessedTempRel = MyXactAccessedTempRel ;
5344
+ prevMyXactAccessedTempRel = MyXactFlags & XACT_FLAGS_ACCESSEDTEMPREL ;
5345
5345
5346
5346
if (PreviousProcessUtilityHook != NULL )
5347
5347
{
@@ -5369,9 +5369,10 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
5369
5369
{
5370
5370
prevMyXactAccessedTempRel = true;
5371
5371
}
5372
- MyXactAccessedTempRel = prevMyXactAccessedTempRel ;
5372
+ if (prevMyXactAccessedTempRel )
5373
+ MyXactFlags |= XACT_FLAGS_ACCESSEDTEMPREL ;
5373
5374
}
5374
- if (MyXactAccessedTempRel )
5375
+ if (MyXactFlags & XACT_FLAGS_ACCESSEDTEMPREL )
5375
5376
{
5376
5377
MTM_LOG1 ("Xact accessed temp table, stopping replication of statement '%s'" , queryString );
5377
5378
MtmTx .isDistributed = false; /* Skip */
0 commit comments