Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9bacc10

Browse files
committed
temp index fix
1 parent 6c1733d commit 9bacc10

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

multimaster.c

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,9 +2230,10 @@ static void MtmBroadcastUtilityStmt(char const* sql, bool ignoreError)
22302230
}
22312231
if (!MtmRunUtilityStmt(conns[i], sql, &utility_errmsg) && !ignoreError)
22322232
{
2233-
// errorMsg = "Failed to run command at node %d";
2234-
// XXX: add check for our node
2235-
errorMsg = utility_errmsg;
2233+
if (i + 1 == MtmNodeId)
2234+
errorMsg = utility_errmsg;
2235+
else
2236+
errorMsg = "Failed to run command at node %d";
22362237

22372238
failedNode = i;
22382239
break;
@@ -2433,6 +2434,27 @@ static void MtmProcessUtility(Node *parsetree, const char *queryString,
24332434
skipCommand = stmt->relation->relpersistence == RELPERSISTENCE_TEMP;
24342435
}
24352436
break;
2437+
case T_IndexStmt:
2438+
{
2439+
Oid relid;
2440+
LOCKMODE lockmode;
2441+
Relation rel;
2442+
2443+
IndexStmt *stmt = (IndexStmt *) parsetree;
2444+
lockmode = stmt->concurrent ? ShareUpdateExclusiveLock
2445+
: ShareLock;
2446+
relid = RangeVarGetRelidExtended(stmt->relation, lockmode,
2447+
false, false,
2448+
NULL, // ???
2449+
NULL);
2450+
2451+
rel = heap_open(relid, lockmode);
2452+
2453+
skipCommand = rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP;
2454+
2455+
heap_close(rel, NoLock);
2456+
}
2457+
break;
24362458
default:
24372459
skipCommand = false;
24382460
break;

0 commit comments

Comments
 (0)