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

Commit4378dd7

Browse files
committed
replicate grant stmt
1 parenta0acd7b commit4378dd7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎multimaster.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2272,6 +2272,7 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22722272
if (MtmGUCBufferAllocated&& !MtmRunUtilityStmt(conns[i],MtmGUCBuffer->data,&utility_errmsg)&& !ignoreError)
22732273
{
22742274
errorMsg="Failed to set GUC variables at node %d";
2275+
elog(ERROR,utility_errmsg);
22752276
failedNode=i;
22762277
break;
22772278
}
@@ -2454,7 +2455,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24542455
caseT_PrepareStmt:
24552456
caseT_ExecuteStmt:
24562457
caseT_DeallocateStmt:
2457-
caseT_GrantStmt:/* XXX: we could replicate some of these these */;
2458+
//case T_GrantStmt: /* XXX: we could replicate some of these these */;
24582459
//case T_GrantRoleStmt:
24592460
//case T_AlterDatabaseStmt:
24602461
//case T_AlterDatabaseSetStmt:
@@ -2465,7 +2466,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24652466
caseT_ClusterStmt:/* XXX: we could replicate these */;
24662467
caseT_VacuumStmt:
24672468
caseT_ExplainStmt:
2468-
caseT_AlterSystemStmt:
2469+
//case T_AlterSystemStmt:
24692470
caseT_VariableShowStmt:
24702471
caseT_DiscardStmt:
24712472
//case T_CreateEventTrigStmt:
@@ -2483,7 +2484,13 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24832484
break;
24842485
caseT_VariableSetStmt:
24852486
{
2486-
//VariableSetStmt *stmt = (VariableSetStmt *) parsetree;
2487+
VariableSetStmt*stmt= (VariableSetStmt*)parsetree;
2488+
2489+
skipCommand= true;
2490+
2491+
/* Prevent SET TRANSACTION from replication */
2492+
if (MtmTx.isTransactionBlock||stmt->kind==VAR_SET_MULTI)
2493+
break;
24872494

24882495
if (!MtmGUCBufferAllocated)
24892496
{
@@ -2502,8 +2509,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25022509
//appendStringInfoString(MtmGUCBuffer, "; ");
25032510

25042511
appendStringInfoString(MtmGUCBuffer,queryString);
2505-
2506-
skipCommand= true;
25072512
}
25082513
break;
25092514
caseT_CreateStmt:
@@ -2530,7 +2535,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25302535
{
25312536
rel=heap_open(relid,ShareLock);
25322537
skipCommand=rel->rd_rel->relpersistence==RELPERSISTENCE_TEMP;
2533-
heap_close(rel,NoLock);
2538+
heap_close(rel,ShareLock);
25342539
}
25352540
}
25362541
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp