From 63e3738f464522395f9f28b7cf9bfb76258006d3 Mon Sep 17 00:00:00 2001 From: gindibay Date: Wed, 22 Nov 2023 03:33:03 +0300 Subject: [PATCH] Fixes pre review check results --- src/backend/distributed/commands/database.c | 2 +- .../distributed/deparser/deparse_database_stmts.c | 10 ---------- src/include/distributed/commands.h | 3 --- .../expected/create_drop_database_propagation.out | 5 +++++ .../regress/sql/create_drop_database_propagation.sql | 8 ++++++++ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/backend/distributed/commands/database.c b/src/backend/distributed/commands/database.c index dcd627919..12c884b12 100644 --- a/src/backend/distributed/commands/database.c +++ b/src/backend/distributed/commands/database.c @@ -73,7 +73,7 @@ static char * GetTablespaceName(Oid tablespaceOid); static ObjectAddress * GetDatabaseAddressFromDatabaseName(char *databaseName, bool missingOk); -static Oid get_database_owner(Oid db_oid); +static Oid get_database_owner(Oid dbId); /* controlled via GUC */ diff --git a/src/backend/distributed/deparser/deparse_database_stmts.c b/src/backend/distributed/deparser/deparse_database_stmts.c index 3a12a2374..6267baef5 100644 --- a/src/backend/distributed/deparser/deparse_database_stmts.c +++ b/src/backend/distributed/deparser/deparse_database_stmts.c @@ -20,7 +20,6 @@ #include "utils/builtins.h" #include "commands/defrem.h" -#include "distributed/deparser.h" #include "distributed/commands.h" #include "distributed/citus_ruleutils.h" #include "distributed/deparser.h" @@ -97,15 +96,6 @@ DeparseAlterDatabaseOwnerStmt(Node *node) } -/* - * - * AppendAlterDatabaseOwnerStmt - * Append an ALTER DATABASE statement for changing the owner of a database to the given StringInfo buffer. - * - * Parameters: - * - buf: The StringInfo buffer to append the statement to. - * - stmt: The AlterOwnerStmt representing the ALTER DATABASE statement to append. - */ static void AppendAlterDatabaseOwnerStmt(StringInfo buf, AlterOwnerStmt *stmt) { diff --git a/src/include/distributed/commands.h b/src/include/distributed/commands.h index 854d49b01..9dc2d0392 100644 --- a/src/include/distributed/commands.h +++ b/src/include/distributed/commands.h @@ -244,10 +244,7 @@ extern List * DropDatabaseStmtObjectAddress(Node *node, bool missingOk, extern List * CreateDatabaseStmtObjectAddress(Node *node, bool missingOk, bool isPostprocess); extern List * GenerateGrantDatabaseCommandList(void); - - extern List * PostprocessAlterDatabaseRenameStmt(Node *node, const char *queryString); - extern void EnsureSupportedCreateDatabaseCommand(CreatedbStmt *stmt); extern char * CreateDatabaseDDLCommand(Oid dbId); diff --git a/src/test/regress/expected/create_drop_database_propagation.out b/src/test/regress/expected/create_drop_database_propagation.out index eb637f8c2..066ec6889 100644 --- a/src/test/regress/expected/create_drop_database_propagation.out +++ b/src/test/regress/expected/create_drop_database_propagation.out @@ -932,6 +932,11 @@ SELECT * FROM public.check_database_on_all_nodes('test_db') ORDER BY node_type; REVOKE CONNECT ON DATABASE test_db FROM propagated_role; DROP DATABASE test_db; DROP ROLE propagated_role, non_propagated_role; +--test that create database with oid option failed when citus.enable_create_database_propagation is on +set citus.enable_create_database_propagation TO on; +CREATE DATABASE db_oid_test WITH OID 123; +ERROR: CREATE DATABASE option "oid" is not supported +set citus.enable_create_database_propagation TO off; --clean up resources created by this test -- DROP TABLESPACE is not supported, so we need to drop it manually. SELECT result FROM run_command_on_all_nodes( diff --git a/src/test/regress/sql/create_drop_database_propagation.sql b/src/test/regress/sql/create_drop_database_propagation.sql index 1e31a7c10..97bec905a 100644 --- a/src/test/regress/sql/create_drop_database_propagation.sql +++ b/src/test/regress/sql/create_drop_database_propagation.sql @@ -536,6 +536,14 @@ REVOKE CONNECT ON DATABASE test_db FROM propagated_role; DROP DATABASE test_db; DROP ROLE propagated_role, non_propagated_role; +--test that create database with oid option failed when citus.enable_create_database_propagation is on +set citus.enable_create_database_propagation TO on; +CREATE DATABASE db_oid_test WITH OID 123; + +set citus.enable_create_database_propagation TO off; + + + --clean up resources created by this test -- DROP TABLESPACE is not supported, so we need to drop it manually.