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