mirror of https://github.com/citusdata/citus.git
Fixes review notes
parent
1fd5a2b8c9
commit
23d8e16f51
|
@ -1,12 +1,12 @@
|
||||||
-- Create a new database
|
-- Create a new database
|
||||||
set citus.enable_create_database_propagation to on;
|
set citus.enable_create_database_propagation to on;
|
||||||
CREATE DATABASE test_db;
|
CREATE DATABASE role_operations_test_db;
|
||||||
SET citus.superuser TO 'postgres';
|
SET citus.superuser TO 'postgres';
|
||||||
-- Connect to the new database
|
-- Connect to the new database
|
||||||
\c test_db
|
\c role_operations_test_db
|
||||||
-- Test CREATE ROLE with various options
|
-- Test CREATE ROLE with various options
|
||||||
CREATE ROLE test_role1 WITH LOGIN PASSWORD 'password1';
|
CREATE ROLE test_role1 WITH LOGIN PASSWORD 'password1';
|
||||||
\c test_db - - :worker_1_port
|
\c role_operations_test_db - - :worker_1_port
|
||||||
CREATE USER "test_role2-needs\!escape"
|
CREATE USER "test_role2-needs\!escape"
|
||||||
WITH
|
WITH
|
||||||
SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN REPLICATION BYPASSRLS CONNECTION
|
SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN REPLICATION BYPASSRLS CONNECTION
|
||||||
|
@ -30,10 +30,10 @@ $$);
|
||||||
[{"rolname":"test_role1","rolsuper":false,"rolinherit":true,"rolcreaterole":false,"rolcreatedb":false,"rolcanlogin":true,"rolreplication":false,"rolbypassrls":false,"rolconnlimit":-1,"pass_not_empty":true,"date":null},{"rolname":"test_role2-needs\\!escape","rolsuper":true,"rolinherit":true,"rolcreaterole":true,"rolcreatedb":true,"rolcanlogin":true,"rolreplication":true,"rolbypassrls":true,"rolconnlimit":10,"pass_not_empty":null,"date":"2023-01-01"}]
|
[{"rolname":"test_role1","rolsuper":false,"rolinherit":true,"rolcreaterole":false,"rolcreatedb":false,"rolcanlogin":true,"rolreplication":false,"rolbypassrls":false,"rolconnlimit":-1,"pass_not_empty":true,"date":null},{"rolname":"test_role2-needs\\!escape","rolsuper":true,"rolinherit":true,"rolcreaterole":true,"rolcreatedb":true,"rolcanlogin":true,"rolreplication":true,"rolbypassrls":true,"rolconnlimit":10,"pass_not_empty":null,"date":"2023-01-01"}]
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
\c test_db - - :master_port
|
\c role_operations_test_db - - :master_port
|
||||||
-- Test ALTER ROLE with various options
|
-- Test ALTER ROLE with various options
|
||||||
ALTER ROLE test_role1 WITH PASSWORD 'new_password1';
|
ALTER ROLE test_role1 WITH PASSWORD 'new_password1';
|
||||||
\c test_db - - :worker_1_port
|
\c role_operations_test_db - - :worker_1_port
|
||||||
ALTER USER "test_role2-needs\!escape"
|
ALTER USER "test_role2-needs\!escape"
|
||||||
WITH
|
WITH
|
||||||
NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION
|
NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION
|
||||||
|
@ -57,11 +57,11 @@ $$);
|
||||||
[{"rolname":"test_role1","rolsuper":false,"rolinherit":true,"rolcreaterole":false,"rolcreatedb":false,"rolcanlogin":true,"rolreplication":false,"rolbypassrls":false,"rolconnlimit":-1,"pass_not_empty":true,"date":null},{"rolname":"test_role2-needs\\!escape","rolsuper":false,"rolinherit":false,"rolcreaterole":false,"rolcreatedb":false,"rolcanlogin":false,"rolreplication":false,"rolbypassrls":false,"rolconnlimit":5,"pass_not_empty":null,"date":"2024-01-01"}]
|
[{"rolname":"test_role1","rolsuper":false,"rolinherit":true,"rolcreaterole":false,"rolcreatedb":false,"rolcanlogin":true,"rolreplication":false,"rolbypassrls":false,"rolconnlimit":-1,"pass_not_empty":true,"date":null},{"rolname":"test_role2-needs\\!escape","rolsuper":false,"rolinherit":false,"rolcreaterole":false,"rolcreatedb":false,"rolcanlogin":false,"rolreplication":false,"rolbypassrls":false,"rolconnlimit":5,"pass_not_empty":null,"date":"2024-01-01"}]
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
\c test_db - - :master_port
|
\c role_operations_test_db - - :master_port
|
||||||
-- Test DROP ROLE
|
-- Test DROP ROLE
|
||||||
DROP ROLE IF EXISTS test_role1, "test_role2-needs\!escape";
|
DROP ROLE IF EXISTS test_role1, "test_role2-needs\!escape";
|
||||||
-- Clean up: drop the database
|
-- Clean up: drop the database
|
||||||
\c regression - - :master_port
|
\c regression - - :master_port
|
||||||
set citus.enable_create_database_propagation to on;
|
set citus.enable_create_database_propagation to on;
|
||||||
DROP DATABASE test_db;
|
DROP DATABASE role_operations_test_db;
|
||||||
reset citus.enable_create_database_propagation;
|
reset citus.enable_create_database_propagation;
|
||||||
|
|
|
@ -372,5 +372,5 @@ ORDER BY 1;
|
||||||
view citus_stat_tenants_local
|
view citus_stat_tenants_local
|
||||||
view pg_dist_shard_placement
|
view pg_dist_shard_placement
|
||||||
view time_partitions
|
view time_partitions
|
||||||
(361 rows)
|
(362 rows)
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,7 @@ test: object_propagation_debug
|
||||||
test: undistribute_table
|
test: undistribute_table
|
||||||
test: run_command_on_all_nodes
|
test: run_command_on_all_nodes
|
||||||
test: background_task_queue_monitor
|
test: background_task_queue_monitor
|
||||||
test: other_databases grant_role_from_non_maindb
|
test: other_databases grant_role_from_non_maindb role_operations_from_non_maindb
|
||||||
test: role_operations_from_non_maindb
|
|
||||||
test: citus_internal_access
|
test: citus_internal_access
|
||||||
|
|
||||||
# Causal clock test
|
# Causal clock test
|
||||||
|
|
|
@ -99,8 +99,6 @@ select result FROM run_command_on_all_nodes($$
|
||||||
) t
|
) t
|
||||||
$$);
|
$$);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
--test for alter user
|
--test for alter user
|
||||||
select 1 from citus_remove_node('localhost', :worker_2_port);
|
select 1 from citus_remove_node('localhost', :worker_2_port);
|
||||||
\c metadata_sync_2pc_db - - :master_port
|
\c metadata_sync_2pc_db - - :master_port
|
||||||
|
@ -154,7 +152,6 @@ $$);
|
||||||
|
|
||||||
set citus.enable_create_database_propagation to on;
|
set citus.enable_create_database_propagation to on;
|
||||||
drop database metadata_sync_2pc_db;
|
drop database metadata_sync_2pc_db;
|
||||||
|
|
||||||
drop schema metadata_sync_2pc_schema;
|
drop schema metadata_sync_2pc_schema;
|
||||||
|
|
||||||
reset citus.enable_create_database_propagation;
|
reset citus.enable_create_database_propagation;
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
-- Create a new database
|
-- Create a new database
|
||||||
set citus.enable_create_database_propagation to on;
|
set citus.enable_create_database_propagation to on;
|
||||||
|
CREATE DATABASE role_operations_test_db;
|
||||||
CREATE DATABASE test_db;
|
|
||||||
|
|
||||||
SET citus.superuser TO 'postgres';
|
SET citus.superuser TO 'postgres';
|
||||||
-- Connect to the new database
|
-- Connect to the new database
|
||||||
\c test_db
|
\c role_operations_test_db
|
||||||
-- Test CREATE ROLE with various options
|
-- Test CREATE ROLE with various options
|
||||||
CREATE ROLE test_role1 WITH LOGIN PASSWORD 'password1';
|
CREATE ROLE test_role1 WITH LOGIN PASSWORD 'password1';
|
||||||
\c test_db - - :worker_1_port
|
|
||||||
|
|
||||||
|
\c role_operations_test_db - - :worker_1_port
|
||||||
CREATE USER "test_role2-needs\!escape"
|
CREATE USER "test_role2-needs\!escape"
|
||||||
WITH
|
WITH
|
||||||
SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN REPLICATION BYPASSRLS CONNECTION
|
SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN REPLICATION BYPASSRLS CONNECTION
|
||||||
|
@ -29,20 +27,17 @@ select result FROM run_command_on_all_nodes($$
|
||||||
) t
|
) t
|
||||||
$$);
|
$$);
|
||||||
|
|
||||||
|
\c role_operations_test_db - - :master_port
|
||||||
\c test_db - - :master_port
|
|
||||||
-- Test ALTER ROLE with various options
|
-- Test ALTER ROLE with various options
|
||||||
ALTER ROLE test_role1 WITH PASSWORD 'new_password1';
|
ALTER ROLE test_role1 WITH PASSWORD 'new_password1';
|
||||||
|
|
||||||
\c test_db - - :worker_1_port
|
\c role_operations_test_db - - :worker_1_port
|
||||||
ALTER USER "test_role2-needs\!escape"
|
ALTER USER "test_role2-needs\!escape"
|
||||||
WITH
|
WITH
|
||||||
NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION
|
NOSUPERUSER NOCREATEDB NOCREATEROLE NOINHERIT NOLOGIN NOREPLICATION NOBYPASSRLS CONNECTION
|
||||||
LIMIT 5 VALID UNTIL '2024-01-01';
|
LIMIT 5 VALID UNTIL '2024-01-01';
|
||||||
|
|
||||||
|
|
||||||
\c regression - - :master_port
|
\c regression - - :master_port
|
||||||
|
|
||||||
select result FROM run_command_on_all_nodes($$
|
select result FROM run_command_on_all_nodes($$
|
||||||
SELECT array_to_json(array_agg(row_to_json(t)))
|
SELECT array_to_json(array_agg(row_to_json(t)))
|
||||||
FROM (
|
FROM (
|
||||||
|
@ -55,17 +50,12 @@ select result FROM run_command_on_all_nodes($$
|
||||||
) t
|
) t
|
||||||
$$);
|
$$);
|
||||||
|
|
||||||
|
\c role_operations_test_db - - :master_port
|
||||||
\c test_db - - :master_port
|
|
||||||
|
|
||||||
-- Test DROP ROLE
|
-- Test DROP ROLE
|
||||||
DROP ROLE IF EXISTS test_role1, "test_role2-needs\!escape";
|
DROP ROLE IF EXISTS test_role1, "test_role2-needs\!escape";
|
||||||
|
|
||||||
-- Clean up: drop the database
|
-- Clean up: drop the database
|
||||||
|
|
||||||
\c regression - - :master_port
|
\c regression - - :master_port
|
||||||
set citus.enable_create_database_propagation to on;
|
set citus.enable_create_database_propagation to on;
|
||||||
|
DROP DATABASE role_operations_test_db;
|
||||||
DROP DATABASE test_db;
|
|
||||||
|
|
||||||
reset citus.enable_create_database_propagation;
|
reset citus.enable_create_database_propagation;
|
||||||
|
|
Loading…
Reference in New Issue