@@ -3582,7 +3582,12 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
3582
3582
hash_search (MtmGucHash , key , HASH_REMOVE , NULL );
3583
3583
}
3584
3584
break ;
3585
+
3585
3586
case VAR_RESET_ALL :
3587
+ {
3588
+ hash_destroy (MtmGucHash );
3589
+ MtmGucHashInit ();
3590
+ }
3586
3591
break ;
3587
3592
3588
3593
case VAR_SET_MULTI :
@@ -3594,7 +3599,11 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
3594
3599
3595
3600
static void MtmGucDiscard (DiscardStmt * stmt )
3596
3601
{
3597
-
3602
+ if (stmt -> target == DISCARD_ALL )
3603
+ {
3604
+ hash_destroy (MtmGucHash );
3605
+ MtmGucHashInit ();
3606
+ }
3598
3607
}
3599
3608
3600
3609
static void MtmGucClear (void )
@@ -3619,7 +3628,18 @@ static char * MtmGucSerialize(void)
3619
3628
appendStringInfoString (serialized_gucs , "SET " );
3620
3629
appendStringInfoString (serialized_gucs , hentry -> key );
3621
3630
appendStringInfoString (serialized_gucs , " TO " );
3622
- appendStringInfoString (serialized_gucs , hentry -> value );
3631
+
3632
+ /* quite a crutch */
3633
+ if (strcmp (hentry -> key , "work_mem" ) == 0 )
3634
+ {
3635
+ appendStringInfoString (serialized_gucs , "'" );
3636
+ appendStringInfoString (serialized_gucs , hentry -> value );
3637
+ appendStringInfoString (serialized_gucs , "'" );
3638
+ }
3639
+ else
3640
+ {
3641
+ appendStringInfoString (serialized_gucs , hentry -> value );
3642
+ }
3623
3643
appendStringInfoString (serialized_gucs , "; " );
3624
3644
}
3625
3645
}
0 commit comments