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
* and open it again after set tablespace.
*/
commands = list_make5(DISABLE_DDL_PROPAGATION,
COMMIT_TRANSACTION,
commands = list_make3(DISABLE_DDL_PROPAGATION,
sql,
BEGIN_TRANSACTION,
ENABLE_DDL_PROPAGATION);
return NontransactionalNodeDDLTask(NON_COORDINATOR_NODES, commands);
}
else
{
commands = list_make3(DISABLE_DDL_PROPAGATION,
(void *) sql,
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[] = {
{ "is_template", " IS_TEMPLATE %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 *
@ -119,7 +119,7 @@ AppendBasicAlterDatabaseOptions(StringInfo buf, DefElem *def, bool
{
if (!prefix_appended_for_basic_options)
{
appendStringInfo(buf, "ALTER DATABASE %s WITH ", quote_identifier(dbname));
appendStringInfo(buf, "ALTER DATABASE %s WITH", quote_identifier(dbname));
prefix_appended_for_basic_options = true;
}
optionToStatement(buf, def, alter_database_option_formats, lengthof(

View File

@ -1,29 +1,29 @@
set citus.log_remote_commands = true;
set citus.grep_remote_commands = '%ALTER DATABASE%';
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
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
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
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
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
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
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;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true;
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE true;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression with IS_TEMPLATE false;
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE false;
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE false;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE false;
NOTICE: issuing ALTER DATABASE regression WITH IS_TEMPLATE false;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database regression set default_transaction_read_only = true;
NOTICE: issuing ALTER DATABASE regression SET default_transaction_read_only = 'true'
@ -142,19 +142,19 @@ DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
set citus.enable_create_database_propagation=on;
create database regression2;
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
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
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
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
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;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE false;
NOTICE: issuing ALTER DATABASE regression2 WITH IS_TEMPLATE false;
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
\set alter_db_tablespace :abs_srcdir '/tmp_check/ts3'
CREATE TABLESPACE alter_db_tablespace LOCATION :'alter_db_tablespace';

View File

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