Enriches tests

pull/7563/head
gurkanindibay 2024-03-26 13:02:43 +03:00
parent 6472292593
commit 56171a4a17
3 changed files with 41 additions and 3 deletions

View File

@ -19,9 +19,18 @@ set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set tablespace "ts-needs\!escape2";
NOTICE: issuing ALTER DATABASE "altered_database!'2" SET TABLESPACE "ts-needs\!escape2"
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
\c test_alter_db_from_nonmain_db - - :worker_1_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set tablespace "pg_default";
NOTICE: issuing ALTER DATABASE "altered_database!'2" SET TABLESPACE pg_default
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database "altered_database!'2" rename to altered_database_renamed;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" RENAME TO altered_database_renamed', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
\c test_alter_db_from_nonmain_db - - :worker_2_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database altered_database_renamed rename to "altered_database!'2";
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE altered_database_renamed RENAME TO "altered_database!''2"', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
@ -46,6 +55,9 @@ set citus.enable_create_database_propagation=on;
alter database "altered_database!'2" owner to test_owner_non_main_db;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" OWNER TO test_owner_non_main_db;', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
\c test_alter_db_from_nonmain_db - - :worker_1_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" owner to CURRENT_USER;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" OWNER TO postgres;', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
@ -53,6 +65,9 @@ alter database "altered_database!'2" set default_transaction_read_only = true;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" SET default_transaction_read_only = ''true''', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
set default_transaction_read_only = false;
\c test_alter_db_from_nonmain_db - - :worker_2_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set default_transaction_read_only from current;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" SET default_transaction_read_only FROM CURRENT', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
@ -68,6 +83,9 @@ DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
alter database "altered_database!'2" set TIME ZONE LOCAL;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" SET timezone TO DEFAULT', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx
\c test_alter_db_from_nonmain_db
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set TIME ZONE DEFAULT;
NOTICE: issuing SELECT citus_internal.execute_command_on_remote_nodes_as_user('ALTER DATABASE "altered_database!''2" SET timezone TO DEFAULT', 'postgres')
DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx

View File

@ -18,13 +18,20 @@ CREATE TABLESPACE "ts-needs\!escape2" LOCATION :'alter_db_tablespace';
CREATE TABLESPACE "ts-needs\!escape2" LOCATION :'alter_db_tablespace';
\c test_alter_db_from_nonmain_db
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set tablespace "ts-needs\!escape2";
\c test_alter_db_from_nonmain_db - - :worker_1_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set tablespace "pg_default";
alter database "altered_database!'2" rename to altered_database_renamed;
\c test_alter_db_from_nonmain_db - - :worker_2_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database altered_database_renamed rename to "altered_database!'2";
alter database "altered_database!'2" with
@ -38,19 +45,32 @@ alter database "altered_database!'2" with
\c regression
create role test_owner_non_main_db;
\c test_alter_db_from_nonmain_db
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
set citus.enable_create_database_propagation=on;
alter database "altered_database!'2" owner to test_owner_non_main_db;
\c test_alter_db_from_nonmain_db - - :worker_1_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" owner to CURRENT_USER;
alter database "altered_database!'2" set default_transaction_read_only = true;
set default_transaction_read_only = false;
\c test_alter_db_from_nonmain_db - - :worker_2_port
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set default_transaction_read_only from current;
alter database "altered_database!'2" set default_transaction_read_only to DEFAULT;
alter database "altered_database!'2" RESET default_transaction_read_only;
alter database "altered_database!'2" SET TIME ZONE '-7';
alter database "altered_database!'2" set TIME ZONE LOCAL;
\c test_alter_db_from_nonmain_db
set citus.log_remote_commands = true;
set citus.grep_remote_commands = "%ALTER DATABASE%";
alter database "altered_database!'2" set TIME ZONE DEFAULT;
alter database "altered_database!'2" RESET TIME ZONE;
alter database "altered_database!'2" SET TIME ZONE INTERVAL '-08:00' HOUR TO MINUTE;
@ -71,6 +91,7 @@ alter database "altered_database!'2" set lock_timeout from current;
alter database "altered_database!'2" set lock_timeout to DEFAULT;
alter database "altered_database!'2" RESET lock_timeout;
ALTER DATABASE "altered_database!'2" RESET ALL;
\c regression
set citus.enable_create_database_propagation=on;
drop database "altered_database!'2";

View File

@ -41,4 +41,3 @@ DROP TABLE test_dist;
ALTER SEQUENCE pg_catalog.pg_dist_node_nodeid_seq RESTART 30;
ALTER SEQUENCE pg_catalog.pg_dist_groupid_seq RESTART 18;
ALTER SEQUENCE pg_catalog.pg_dist_placement_placementid_seq RESTART 83;
select result from run_command_on_all_nodes($$show citus.enable_ddl_propagation$$);