From 2e0b395c26c0bbeed41b8b3a36b5ba6c2d181181 Mon Sep 17 00:00:00 2001 From: Nils Dijk Date: Fri, 7 Feb 2020 01:30:54 +0100 Subject: [PATCH] extract role DistributeObjectOps --- .../distributed/commands/distribute_object_ops.c | 9 --------- src/backend/distributed/commands/role.c | 13 ++++++++++++- src/include/distributed/commands.h | 1 - 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/backend/distributed/commands/distribute_object_ops.c b/src/backend/distributed/commands/distribute_object_ops.c index 33ac9492e..7974b9fd5 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_AlterRole = { - .deparse = DeparseAlterRoleStmt, - .qualify = NULL, - .preprocess = NULL, - .postprocess = PostprocessAlterRoleStmt, - .address = NULL, -}; -REGISTER_DISTRIBUTED_OPERATION(AlterRoleStmt, Any_AlterRole); - static DistributeObjectOps Any_AlterTableMoveAll = { .deparse = NULL, .qualify = NULL, diff --git a/src/backend/distributed/commands/role.c b/src/backend/distributed/commands/role.c index 127e92528..b17af23b1 100644 --- a/src/backend/distributed/commands/role.c +++ b/src/backend/distributed/commands/role.c @@ -37,12 +37,23 @@ static DefElem * makeDefElemInt(char *name, int value); /* controlled via GUC */ bool EnableAlterRolePropagation = false; +/* DistributeObjectOps */ +static List * PostprocessAlterRoleStmt(Node *node, const char *queryString); +static DistributeObjectOps Any_AlterRole = { + .deparse = DeparseAlterRoleStmt, + .qualify = NULL, + .preprocess = NULL, + .postprocess = PostprocessAlterRoleStmt, + .address = NULL, +}; +REGISTER_DISTRIBUTED_OPERATION(AlterRoleStmt, Any_AlterRole); + /* * PostprocessAlterRoleStmt actually creates the plan we need to execute for alter * role statement. We need to do it this way because we need to use the encrypted * password, which is, in some cases, created at standardProcessUtility. */ -List * +static List * PostprocessAlterRoleStmt(Node *node, const char *queryString) { AlterRoleStmt *stmt = castNode(AlterRoleStmt, node); diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index d54893fbb..928a03ab2 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -205,7 +205,6 @@ extern List * PreprocessRenameAttributeStmt(Node *stmt, const char *queryString) /* role.c - forward declarations*/ -extern List * PostprocessAlterRoleStmt(Node *stmt, const char *queryString); extern List * GenerateAlterRoleIfExistsCommandAllRoles(void);