Fixes review notes

pull/7253/head
gindibay 2023-10-31 13:41:50 +03:00
parent 75f1e691c1
commit 328e34969d
4 changed files with 22 additions and 23 deletions

View File

@ -214,20 +214,20 @@ PreprocessAlterDatabaseStmt(Node *node, const char *queryString,
/*Set tablespace does not work inside a transaction.Therefore, we close the transaction before set tablespace /*Set tablespace does not work inside a transaction.Therefore, we close the transaction before set tablespace
* and open it again after set tablespace. * and open it again after set tablespace.
*/ */
commands = list_make5(DISABLE_DDL_PROPAGATION, commands = list_make3(DISABLE_DDL_PROPAGATION,
COMMIT_TRANSACTION,
sql, sql,
BEGIN_TRANSACTION,
ENABLE_DDL_PROPAGATION); ENABLE_DDL_PROPAGATION);
return NontransactionalNodeDDLTask(NON_COORDINATOR_NODES, commands);
} }
else else
{ {
commands = list_make3(DISABLE_DDL_PROPAGATION, commands = list_make3(DISABLE_DDL_PROPAGATION,
(void *) sql, (void *) sql,
ENABLE_DDL_PROPAGATION); ENABLE_DDL_PROPAGATION);
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands);
} }
return NodeDDLTaskList(NON_COORDINATOR_NODES, commands); return NIL;
} }

View File

@ -52,7 +52,7 @@ const struct option_format create_database_option_formats[] = {
const struct option_format alter_database_option_formats[] = { const struct option_format alter_database_option_formats[] = {
{ "is_template", " IS_TEMPLATE %s", OPTION_FORMAT_BOOLEAN }, { "is_template", " IS_TEMPLATE %s", OPTION_FORMAT_BOOLEAN },
{ "allow_connections", " ALLOW_CONNECTIONS %s", OPTION_FORMAT_BOOLEAN }, { "allow_connections", " ALLOW_CONNECTIONS %s", OPTION_FORMAT_BOOLEAN },
{ "connection_limit", " CONNECTION_LIMIT %d", OPTION_FORMAT_INTEGER }, { "connection_limit", " CONNECTION LIMIT %d", OPTION_FORMAT_INTEGER },
}; };
char * char *

View File

@ -1,19 +1,19 @@
set citus.log_remote_commands = true; set citus.log_remote_commands = true;
set citus.grep_remote_commands = '%ALTER DATABASE%'; set citus.grep_remote_commands = '%ALTER DATABASE%';
alter database regression with CONNECTION LIMIT 100; alter database regression with CONNECTION LIMIT 100;
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION_LIMIT 100; NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT 100;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION_LIMIT 100; NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT 100;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression with IS_TEMPLATE true CONNECTION LIMIT 50; alter database regression with IS_TEMPLATE true CONNECTION LIMIT 50;
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true CONNECTION_LIMIT 50; NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true CONNECTION LIMIT 50;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true CONNECTION_LIMIT 50; NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true CONNECTION LIMIT 50;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression with CONNECTION LIMIT -1; alter database regression with CONNECTION LIMIT -1;
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION_LIMIT -1; NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT -1;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression WITH CONNECTION_LIMIT -1; NOTICE: issuing ALTER DATABASE regression WITH CONNECTION LIMIT -1;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression with IS_TEMPLATE true; alter database regression with IS_TEMPLATE true;
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true; NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true;
@ -142,14 +142,14 @@ DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
set citus.enable_create_database_propagation=on; set citus.enable_create_database_propagation=on;
create database regression2; create database regression2;
alter database regression2 with CONNECTION LIMIT 100; alter database regression2 with CONNECTION LIMIT 100;
NOTICE: issuing ALTER DATABASE regression2 WITH CONNECTION_LIMIT 100; NOTICE: issuing ALTER DATABASE regression2 WITH CONNECTION LIMIT 100;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression2 WITH CONNECTION_LIMIT 100; NOTICE: issuing ALTER DATABASE regression2 WITH CONNECTION LIMIT 100;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression2 with IS_TEMPLATE true CONNECTION LIMIT 50; alter database regression2 with IS_TEMPLATE true CONNECTION LIMIT 50;
NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE true CONNECTION_LIMIT 50; NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE true CONNECTION LIMIT 50;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE true CONNECTION_LIMIT 50; NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE true CONNECTION LIMIT 50;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression2 with IS_TEMPLATE false; alter database regression2 with IS_TEMPLATE false;
NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE false; NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE false;

View File

@ -58,7 +58,6 @@ test: alter_database_propagation
test: citus_shards test: citus_shards
# ---------- # ----------
# multi_citus_tools tests utility functions written for citus tools # multi_citus_tools tests utility functions written for citus tools
# ---------- # ----------