mirror of https://github.com/citusdata/citus.git
wip
parent
7df6a42a70
commit
bd4a3a42bb
|
@ -690,6 +690,13 @@ GetDistributeObjectOps(Node *node)
|
|||
}
|
||||
}
|
||||
|
||||
case T_ViewStmt:
|
||||
{
|
||||
ViewStmt *stmt = castNode(ViewStmt, node);
|
||||
|
||||
return &NoDistributeOps;
|
||||
}
|
||||
|
||||
case T_AlterOwnerStmt:
|
||||
{
|
||||
AlterOwnerStmt *stmt = castNode(AlterOwnerStmt, node);
|
||||
|
|
|
@ -603,36 +603,25 @@ ProcessUtilityInternal(PlannedStmt *pstmt,
|
|||
"rename the role")));
|
||||
}
|
||||
|
||||
|
||||
if (IsA(parsetree, ViewStmt))
|
||||
{
|
||||
CommandCounterIncrement();
|
||||
elog(INFO, "create view");
|
||||
ViewStmt *v = (ViewStmt *)parsetree;
|
||||
ViewStmt *v = (ViewStmt *) parsetree;
|
||||
|
||||
Oid viewOid = RangeVarGetRelid(v->view, AccessShareLock, false);
|
||||
|
||||
|
||||
Oid viewOid = RangeVarGetRelid(v->view, NoLock, false);
|
||||
elog(INFO, "viewOid: %d", viewOid);
|
||||
/* TODO: check the view depends on a distributed table that we should sync */
|
||||
if (ClusterHasKnownMetadataWorkers())
|
||||
if (ClusterHasKnownMetadataWorkers() && IsCoordinator())
|
||||
{
|
||||
/*
|
||||
* Ensure that the views are also propagated to the metadata workers
|
||||
*/
|
||||
PropagateDependenciesOfViewList(list_make1_oid(viewOid));
|
||||
|
||||
/* prevent recursive propagation */
|
||||
SendCommandToWorkersWithMetadata(DISABLE_DDL_PROPAGATION);
|
||||
|
||||
/* send the commands one by one */
|
||||
{
|
||||
char *viewDef = GetViewCreationCommand(viewOid);
|
||||
elog(INFO, "viewDef: %s", viewDef);
|
||||
|
||||
SendCommandToWorkersWithMetadata(viewDef);
|
||||
}
|
||||
/* TODO: this command fails*/
|
||||
char *viewDef = GetViewCreationCommand(viewOid);
|
||||
SendCommandToWorkersWithMetadata(viewDef);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -321,6 +321,7 @@ SyncMetadataSnapshotToNode(WorkerNode *workerNode, bool raiseOnError)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#include "distributed/metadata/dependency.h"
|
||||
|
||||
/*
|
||||
|
@ -494,9 +495,6 @@ MetadataCreateCommands(void)
|
|||
List *viewList = GetDependingViews(cacheEntry->relationId);
|
||||
PropagateDependenciesOfViewList(viewList);
|
||||
|
||||
/* prevent recursive propagation */
|
||||
SendCommandToWorkersWithMetadata(DISABLE_DDL_PROPAGATION);
|
||||
|
||||
/* send the commands one by one */
|
||||
Oid viewId;
|
||||
List *viewCommandList = NIL;
|
||||
|
|
Loading…
Reference in New Issue