From f497a7a99437f6aa89ebeff60441b9dbaefea1a7 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Fri, 7 Feb 2020 01:37:54 +0100 Subject: [PATCH] extract cluster DistributeObjectOps --- src/backend/distributed/commands/cluster.c | 11 ++++++++++- .../distributed/commands/distribute_object_ops.c | 9 --------- src/include/distributed/commands.h | 3 --- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/backend/distributed/commands/cluster.c b/src/backend/distributed/commands/cluster.c index d1dd313fe..f5dfc778f 100644 --- a/src/backend/distributed/commands/cluster.c +++ b/src/backend/distributed/commands/cluster.c @@ -14,9 +14,18 @@ #include "distributed/commands.h" #include "distributed/metadata_cache.h" +static List * PreprocessClusterStmt(Node *node, const char *clusterCommand); +static DistributeObjectOps Any_Cluster = { + .deparse = NULL, + .qualify = NULL, + .preprocess = PreprocessClusterStmt, + .postprocess = NULL, + .address = NULL, +}; +REGISTER_DISTRIBUTED_OPERATION(ClusterStmt, Any_Cluster); /* placeholder for PreprocessClusterStmt */ -List * +static List * PreprocessClusterStmt(Node *node, const char *clusterCommand) { ClusterStmt *clusterStmt = castNode(ClusterStmt, node); diff --git a/src/backend/distributed/commands/distribute_object_ops.c b/src/backend/distributed/commands/distribute_object_ops.c index ddfb05841..10966ecbb 100644 --- a/src/backend/distributed/commands/distribute_object_ops.c +++ b/src/backend/distributed/commands/distribute_object_ops.c @@ -23,15 +23,6 @@ static DistributeObjectOps NoDistributeOps = { .address = NULL, }; -static DistributeObjectOps Any_Cluster = { - .deparse = NULL, - .qualify = NULL, - .preprocess = PreprocessClusterStmt, - .postprocess = NULL, - .address = NULL, -}; -REGISTER_DISTRIBUTED_OPERATION(ClusterStmt, Any_Cluster); - static DistributeObjectOps Any_Index = { .deparse = NULL, .qualify = NULL, diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index ab1960541..6f2a8e471 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -121,9 +121,6 @@ typedef struct DistributedObjectOpsContainer const DistributeObjectOps * GetDistributeObjectOps(Node *node); -/* cluster.c - forward declarations */ -extern List * PreprocessClusterStmt(Node *node, const char *clusterCommand); - /* call.c */ extern bool CallDistributedProcedureRemotely(CallStmt *callStmt, DestReceiver *dest);