Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commitc45303d

Browse files
committed
allocate session_authorization role in TopMemoryContext
1 parent68abec2 commitc45303d

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎multimaster.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4493,6 +4493,7 @@ static void MtmGucInit(void)
44934493
{
44944494
HASHCTLhash_ctl;
44954495
char*current_role;
4496+
MemoryContextoldcontext;
44964497

44974498
MemSet(&hash_ctl,0,sizeof(hash_ctl));
44984499
hash_ctl.keysize=GUC_KEY_MAXLEN;
@@ -4507,9 +4508,11 @@ static void MtmGucInit(void)
45074508
* If current role is not equal to MtmDatabaseUser, than set it bofore
45084509
* any other GUC vars.
45094510
*/
4511+
oldcontext=MemoryContextSwitchTo(TopMemoryContext);
45104512
current_role=GetConfigOptionByName("session_authorization",NULL, false);
45114513
if (strcmp(MtmDatabaseUser,current_role)!=0)
45124514
MtmGucUpdate("session_authorization",current_role);
4515+
MemoryContextSwitchTo(oldcontext);
45134516
}
45144517

45154518
staticvoidMtmGucDiscard()

‎sql/multimaster.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ alter schema user1 owner to user1;
44

55
\c"user=user1 dbname=regression"
66
createtableuser1.test(iintprimary key);
7+
createtableuser1.test2(iintprimary key);
78

89
\c"user=user1 dbname=regression port=5433"
910
select*from test;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp