mirror of https://github.com/citusdata/citus.git
Add extension ownership check
parent
b25a1c48e6
commit
38213e09ad
|
@ -1329,8 +1329,8 @@ PostprocessCreateFunctionStmt(Node *node, const char *queryString)
|
||||||
return NIL;
|
return NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ObjectAddress address = GetObjectAddressFromParseTree((Node *) stmt, false);
|
ObjectAddress functionAddress = GetObjectAddressFromParseTree((Node *) stmt, false);
|
||||||
if (!DependentRelationsOfFunctionCanBeDistributed(&address))
|
if (!DependentRelationsOfFunctionCanBeDistributed(&functionAddress))
|
||||||
{
|
{
|
||||||
ereport(WARNING, (errmsg("Citus can't distribute functions having dependency on"
|
ereport(WARNING, (errmsg("Citus can't distribute functions having dependency on"
|
||||||
" non-distributed relations"),
|
" non-distributed relations"),
|
||||||
|
@ -1340,10 +1340,15 @@ PostprocessCreateFunctionStmt(Node *node, const char *queryString)
|
||||||
return NIL;
|
return NIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureDependenciesExistOnAllNodes(&address);
|
if (IsObjectAddressOwnedByExtension(&functionAddress, NULL))
|
||||||
|
{
|
||||||
|
return NIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
EnsureDependenciesExistOnAllNodes(&functionAddress);
|
||||||
|
|
||||||
List *commands = list_make1(DISABLE_DDL_PROPAGATION);
|
List *commands = list_make1(DISABLE_DDL_PROPAGATION);
|
||||||
commands = list_concat(commands, CreateFunctionDDLCommandsIdempotent(&address));
|
commands = list_concat(commands, CreateFunctionDDLCommandsIdempotent(&functionAddress));
|
||||||
commands = list_concat(commands, list_make1(ENABLE_DDL_PROPAGATION));
|
commands = list_concat(commands, list_make1(ENABLE_DDL_PROPAGATION));
|
||||||
|
|
||||||
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
|
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
|
||||||
|
|
Loading…
Reference in New Issue