diff --git a/src/backend/distributed/commands/distribute_object_ops.c b/src/backend/distributed/commands/distribute_object_ops.c index 10966ecbb..acd6f81a9 100644 --- a/src/backend/distributed/commands/distribute_object_ops.c +++ b/src/backend/distributed/commands/distribute_object_ops.c @@ -23,24 +23,6 @@ static DistributeObjectOps NoDistributeOps = { .address = NULL, }; -static DistributeObjectOps Any_Index = { - .deparse = NULL, - .qualify = NULL, - .preprocess = PreprocessIndexStmt, - .postprocess = PostprocessIndexStmt, - .address = NULL, -}; -REGISTER_DISTRIBUTED_OPERATION(IndexStmt, Any_Index); - -static DistributeObjectOps Any_Reindex = { - .deparse = NULL, - .qualify = NULL, - .preprocess = PreprocessReindexStmt, - .postprocess = NULL, - .address = NULL, -}; -REGISTER_DISTRIBUTED_OPERATION(ReindexStmt, Any_Reindex); - static DistributeObjectOps Any_Rename = { .deparse = NULL, .qualify = NULL, @@ -117,15 +99,6 @@ static DistributeObjectOps Collation_Rename = { REGISTER_DISTRIBUTED_OPERATION_NESTED(RenameStmt, renameType, OBJECT_COLLATION, Collation_Rename); -static DistributeObjectOps Index_Drop = { - .deparse = NULL, - .qualify = NULL, - .preprocess = PreprocessDropIndexStmt, - .postprocess = NULL, - .address = NULL, -}; -REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_INDEX, Index_Drop); - static DistributeObjectOps Schema_Drop = { .deparse = NULL, .qualify = NULL, diff --git a/src/backend/distributed/commands/index.c b/src/backend/distributed/commands/index.c index b5ff77d46..1a9764e68 100644 --- a/src/backend/distributed/commands/index.c +++ b/src/backend/distributed/commands/index.c @@ -51,6 +51,38 @@ static void ErrorIfUnsupportedIndexStmt(IndexStmt *createIndexStatement); static void ErrorIfUnsupportedDropIndexStmt(DropStmt *dropIndexStatement); static List * DropIndexTaskList(Oid relationId, Oid indexId, DropStmt *dropStmt); +/* DistributeObjectOps */ +static List * PreprocessIndexStmt(Node *node, const char *createIndexCommand); +static List * PostprocessIndexStmt(Node *node, const char *queryString); +static DistributeObjectOps Any_Index = { + .deparse = NULL, + .qualify = NULL, + .preprocess = PreprocessIndexStmt, + .postprocess = PostprocessIndexStmt, + .address = NULL, +}; +REGISTER_DISTRIBUTED_OPERATION(IndexStmt, Any_Index); + +static List * PreprocessReindexStmt(Node *node, const char *reindexCommand); +static DistributeObjectOps Any_Reindex = { + .deparse = NULL, + .qualify = NULL, + .preprocess = PreprocessReindexStmt, + .postprocess = NULL, + .address = NULL, +}; +REGISTER_DISTRIBUTED_OPERATION(ReindexStmt, Any_Reindex); + +static List * PreprocessDropIndexStmt(Node *node, const char *dropIndexCommand); +static DistributeObjectOps Index_Drop = { + .deparse = NULL, + .qualify = NULL, + .preprocess = PreprocessDropIndexStmt, + .postprocess = NULL, + .address = NULL, +}; +REGISTER_DISTRIBUTED_OPERATION_NESTED(DropStmt, removeType, OBJECT_INDEX, Index_Drop); + /* * This struct defines the state for the callback for drop statements. @@ -104,7 +136,7 @@ IsIndexRenameStmt(RenameStmt *renameStmt) * during the worker node portion of DDL execution before returning that DDLJob * in a List. If no distributed table is involved, this function returns NIL. */ -List * +static List * PreprocessIndexStmt(Node *node, const char *createIndexCommand) { IndexStmt *createIndexStatement = castNode(IndexStmt, node); @@ -196,7 +228,7 @@ PreprocessIndexStmt(Node *node, const char *createIndexCommand) * during the worker node portion of DDL execution before returning that DDLJob * in a List. If no distributed table is involved, this function returns NIL. */ -List * +static List * PreprocessReindexStmt(Node *node, const char *reindexCommand) { ReindexStmt *reindexStatement = castNode(ReindexStmt, node); @@ -304,7 +336,7 @@ PreprocessReindexStmt(Node *node, const char *reindexCommand) * during the worker node portion of DDL execution before returning that DDLJob * in a List. If no distributed table is involved, this function returns NIL. */ -List * +static List * PreprocessDropIndexStmt(Node *node, const char *dropIndexCommand) { DropStmt *dropIndexStatement = castNode(DropStmt, node); @@ -393,7 +425,7 @@ PreprocessDropIndexStmt(Node *node, const char *dropIndexCommand) * state if an error is raised, otherwise a sub-sequent change to valid will be * committed. */ -List * +static List * PostprocessIndexStmt(Node *node, const char *queryString) { IndexStmt *indexStmt = castNode(IndexStmt, node); diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index 6f2a8e471..922775e41 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -166,14 +166,6 @@ extern bool ConstraintIsAForeignKey(char *constraintName, Oid relationId); /* index.c - forward declarations */ extern bool IsIndexRenameStmt(RenameStmt *renameStmt); -extern List * PreprocessIndexStmt(Node *createIndexStatement, - const char *createIndexCommand); -extern List * PreprocessReindexStmt(Node *ReindexStatement, - const char *ReindexCommand); -extern List * PreprocessDropIndexStmt(Node *dropIndexStatement, - const char *dropIndexCommand); -extern List * PostprocessIndexStmt(Node *node, - const char *queryString); extern void ErrorIfUnsupportedAlterIndexStmt(AlterTableStmt *alterTableStatement); /* objectaddress.c - forward declarations */