@@ -3941,18 +3941,18 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
3941
3941
break ;
3942
3942
3943
3943
case T_VacuumStmt :
3944
- if (context == PROCESS_UTILITY_TOPLEVEL ) {
3944
+ skipCommand = true;
3945
+ if (context == PROCESS_UTILITY_TOPLEVEL ) {
3945
3946
MtmProcessDDLCommand (queryString , false, true);
3946
3947
MtmTx .isDistributed = false;
3947
- skipCommand = true;
3948
- break ;
3949
- } else {
3948
+ } else if (MtmApplyContext != NULL ) {
3950
3949
MemoryContext oldContext = MemoryContextSwitchTo (MtmApplyContext );
3951
3950
Assert (oldContext != MtmApplyContext );
3952
3951
MtmVacuumStmt = (VacuumStmt * )copyObject (parsetree );
3953
3952
MemoryContextSwitchTo (oldContext );
3954
3953
return ;
3955
3954
}
3955
+ break ;
3956
3956
3957
3957
case T_CreateDomainStmt :
3958
3958
/* Detect temp tables access */
@@ -4049,10 +4049,10 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
4049
4049
MtmProcessDDLCommand (queryString , false, true);
4050
4050
MtmTx .isDistributed = false;
4051
4051
skipCommand = true;
4052
- } else {
4052
+ } else if ( MtmApplyContext != NULL ) {
4053
4053
MemoryContext oldContext = MemoryContextSwitchTo (MtmApplyContext );
4054
4054
Assert (oldContext != MtmApplyContext );
4055
- MtmIndexStmt = indexStmt ;
4055
+ MtmIndexStmt = ( IndexStmt * ) copyObject ( indexStmt ) ;
4056
4056
MemoryContextSwitchTo (oldContext );
4057
4057
return ;
4058
4058
}
@@ -4069,10 +4069,10 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
4069
4069
MtmProcessDDLCommand (queryString , false, true);
4070
4070
MtmTx .isDistributed = false;
4071
4071
skipCommand = true;
4072
- } else {
4072
+ } else if ( MtmApplyContext != NULL ) {
4073
4073
MemoryContext oldContext = MemoryContextSwitchTo (MtmApplyContext );
4074
4074
Assert (oldContext != MtmApplyContext );
4075
- MtmDropStmt = stmt ;
4075
+ MtmDropStmt = ( DropStmt * ) copyObject ( stmt ) ;
4076
4076
MemoryContextSwitchTo (oldContext );
4077
4077
return ;
4078
4078
}
0 commit comments