8000 some crutches to GUC handling · postgrespro/postgres_cluster@10b1f04 · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 10b1f04

Browse files
committed
some crutches to GUC handling
1 parent 2dd95cb commit 10b1f04

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

contrib/mmts/multimaster.c

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

35893594
case VAR_SET_MULTI:
@@ -3595,7 +3600,11 @@ static void MtmGucSet(VariableSetStmt *stmt, const char *queryStr)
35953600

35963601
static void MtmGucDiscard(DiscardStmt *stmt)
35973602
{
3598-
3603+
if (stmt->target == DISCARD_ALL)
3604+
{
3605+
hash_destroy(MtmGucHash);
3606+
MtmGucHashInit();
3607+
}
35993608
}
36003609

36013610
static void MtmGucClear(void)
@@ -3620,7 +3629,18 @@ static char * MtmGucSerialize(void)
36203629
appendStringInfoString(serialized_gucs, "SET ");
36213630
appendStringInfoString(serialized_gucs, hentry->key);
36223631
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+
}
36243644
appendStringInfoString(serialized_gucs, "; ");
36253645
}
36263646
}

0 commit comments

Comments
 (0)
0