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

Commit6681d70

Browse files
committed
replicate grant stmt
1 parent1cb8c17 commit6681d70

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎contrib/mmts/multimaster.c‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,6 +2245,7 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22452245
if (MtmGUCBufferAllocated&& !MtmRunUtilityStmt(conns[i],MtmGUCBuffer->data,&utility_errmsg)&& !ignoreError)
22462246
{
22472247
errorMsg="Failed to set GUC variables at node %d";
2248+
elog(ERROR,utility_errmsg);
22482249
failedNode=i;
22492250
break;
22502251
}
@@ -2431,7 +2432,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24312432
caseT_PrepareStmt:
24322433
caseT_ExecuteStmt:
24332434
caseT_DeallocateStmt:
2434-
caseT_GrantStmt:/* XXX: we could replicate some of these these */;
2435+
//case T_GrantStmt: /* XXX: we could replicate some of these these */;
24352436
//case T_GrantRoleStmt:
24362437
//case T_AlterDatabaseStmt:
24372438
//case T_AlterDatabaseSetStmt:
@@ -2442,7 +2443,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24422443
caseT_ClusterStmt:/* XXX: we could replicate these */;
24432444
caseT_VacuumStmt:
24442445
caseT_ExplainStmt:
2445-
caseT_AlterSystemStmt:
2446+
//case T_AlterSystemStmt:
24462447
caseT_VariableShowStmt:
24472448
caseT_DiscardStmt:
24482449
//case T_CreateEventTrigStmt:
@@ -2460,7 +2461,13 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24602461
break;
24612462
caseT_VariableSetStmt:
24622463
{
2463-
//VariableSetStmt *stmt = (VariableSetStmt *) parsetree;
2464+
VariableSetStmt*stmt= (VariableSetStmt*)parsetree;
2465+
2466+
skipCommand= true;
2467+
2468+
/* Prevent SET TRANSACTION from replication */
2469+
if (MtmTx.isTransactionBlock||stmt->kind==VAR_SET_MULTI)
2470+
break;
24642471

24652472
if (!MtmGUCBufferAllocated)
24662473
{
@@ -2479,8 +2486,6 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24792486
//appendStringInfoString(MtmGUCBuffer, "; ");
24802487

24812488
appendStringInfoString(MtmGUCBuffer,queryString);
2482-
2483-
skipCommand= true;
24842489
}
24852490
break;
24862491
caseT_CreateStmt:
@@ -2507,7 +2512,7 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
25072512
{
25082513
rel=heap_open(relid,ShareLock);
25092514
skipCommand=rel->rd_rel->relpersistence==RELPERSISTENCE_TEMP;
2510-
heap_close(rel,NoLock);
2515+
heap_close(rel,ShareLock);
25112516
}
25122517
}
25132518
break;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp