Skip to content

Commit 4696afa

Browse files
committed
2 parents 463c1bc + 8652d7c commit 4696afa

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

contrib/mmts/multimaster.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2247,9 +2247,10 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22472247
}
22482248
if (!MtmRunUtilityStmt(conns[i], sql, &utility_errmsg) && !ignoreError)
22492249
{
2250-
// errorMsg = "Failed to run command at node %d";
2251-
// XXX: add check for our node
2252-
errorMsg = utility_errmsg;
2250+
if (i + 1 == MtmNodeId)
2251+
errorMsg = utility_errmsg;
2252+
else
2253+
errorMsg = "Failed to run command at node %d";
22532254

22542255
failedNode = i;
22552256
break;
@@ -2454,6 +2455,23 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24542455
skipCommand = stmt->relation->relpersistence == RELPERSISTENCE_TEMP;
24552456
}
24562457
break;
2458+
case T_IndexStmt:
2459+
{
2460+
Oid relid;
2461+
Relation rel;
2462+
IndexStmt *stmt = (IndexStmt *) parsetree;
2463+
bool isTopLevel = (context == PROCESS_UTILITY_TOPLEVEL);
2464+
2465+
if (stmt->concurrent)
2466+
PreventTransactionChain(isTopLevel,
2467+
"CREATE INDEX CONCURRENTLY");
2468+
2469+
relid = RelnameGetRelid(stmt->relation->relname);
2470+
rel = heap_open(relid, ShareLock);
2471+
skipCommand = rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP;
2472+
heap_close(rel, NoLock);
2473+
}
2474+
break;
24572475
default:
24582476
skipCommand = false;
24592477
break;

0 commit comments

Comments
 (0)