Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4818af6

Browse files
committed
some crutches to GUC handling
1 parent 1794b3f commit 4818af6

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

multimaster.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3582,7 +3582,12 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
35823582
hash_search(MtmGucHash, key, HASH_REMOVE, NULL);
35833583
}
35843584
break;
3585+
35853586
case VAR_RESET_ALL:
3587+
{
3588+
hash_destroy(MtmGucHash);
3589+
MtmGucHashInit();
3590+
}
35863591
break;
35873592

35883593
case VAR_SET_MULTI:
@@ -3594,7 +3599,11 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
35943599

35953600
static void MtmGucDiscard(DiscardStmt *stmt)
35963601
{
3597-
3602+
if (stmt->target == DISCARD_ALL)
3603+
{
3604+
hash_destroy(MtmGucHash);
3605+
MtmGucHashInit();
3606+
}
35983607
}
35993608

36003609
static void MtmGucClear(void)
@@ -3619,7 +3628,18 @@ static char * MtmGucSerialize(void)
36193628
appendStringInfoString(serialized_gucs, "SET ");
36203629
appendStringInfoString(serialized_gucs, hentry->key);
36213630
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+
}
36233643
appendStringInfoString(serialized_gucs, "; ");
36243644
}
36253645
}

0 commit comments

Comments
 (0)