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