From 2b3a556f3400f5871901f130194e6a37db8b70dd Mon Sep 17 00:00:00 2001 From: gindibay Date: Fri, 27 Oct 2023 17:40:37 +0300 Subject: [PATCH] Fixes pg14 tests --- .../create_drop_database_propagation.out | 40 ++++--------------- .../sql/create_drop_database_propagation.sql | 28 ++----------- 2 files changed, 10 insertions(+), 58 deletions(-) diff --git a/src/test/regress/expected/create_drop_database_propagation.out b/src/test/regress/expected/create_drop_database_propagation.out index 239048eef..fd7173ce2 100644 --- a/src/test/regress/expected/create_drop_database_propagation.out +++ b/src/test/regress/expected/create_drop_database_propagation.out @@ -164,7 +164,8 @@ CREATE DATABASE my_template_database WITH TEMPLATE = 'template0' OWNER = create_drop_db_test_user ENCODING = 'UTF8' - LOCALE = 'en_US.utf8' + LC_COLLATE = 'C' + LC_CTYPE = 'C' TABLESPACE = create_drop_db_tablespace ALLOW_CONNECTIONS = false IS_TEMPLATE = true; @@ -183,40 +184,13 @@ SELECT result from run_command_on_all_nodes( ) q2 $$ ) ORDER BY result; - result + result --------------------------------------------------------------------- - [{"datacl": null, "datname": "my_template_database", "datctype": "en_US.utf8", "encoding": "UTF8", "datcollate": "en_US.utf8", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] - [{"datacl": null, "datname": "my_template_database", "datctype": "en_US.utf8", "encoding": "UTF8", "datcollate": "en_US.utf8", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] - [{"datacl": null, "datname": "my_template_database", "datctype": "en_US.utf8", "encoding": "UTF8", "datcollate": "en_US.utf8", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] + [{"datacl": null, "datname": "my_template_database", "datctype": "C", "encoding": "UTF8", "datcollate": "C", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] + [{"datacl": null, "datname": "my_template_database", "datctype": "C", "encoding": "UTF8", "datcollate": "C", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] + [{"datacl": null, "datname": "my_template_database", "datctype": "C", "encoding": "UTF8", "datcollate": "C", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] (3 rows) -SET citus.log_remote_commands = true; -set citus.grep_remote_commands = '%DROP DATABASE%'; -drop database my_template_database; -ERROR: cannot drop a template database -SET citus.log_remote_commands = false; -SELECT result from run_command_on_all_nodes( - $$ - SELECT jsonb_agg(to_jsonb(q2.*)) FROM ( - SELECT pd.datname, pg_encoding_to_char(pd.encoding) as encoding, - pd.datistemplate, pd.datallowconn, pd.datconnlimit, - pd.datcollate , pd. datctype , pd.datacl, - pa.rolname AS database_owner, pt.spcname AS tablespace - FROM pg_database pd - JOIN pg_authid pa ON pd.datdba = pa.oid - join pg_tablespace pt on pd.dattablespace = pt.oid - WHERE datname = 'my_template_database' - ) q2 - $$ -) ORDER BY result; - result ---------------------------------------------------------------------- - [{"datacl": null, "datname": "my_template_database", "datctype": "en_US.utf8", "encoding": "UTF8", "datcollate": "en_US.utf8", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] - [{"datacl": null, "datname": "my_template_database", "datctype": "en_US.utf8", "encoding": "UTF8", "datcollate": "en_US.utf8", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] - [{"datacl": null, "datname": "my_template_database", "datctype": "en_US.utf8", "encoding": "UTF8", "datcollate": "en_US.utf8", "tablespace": "create_drop_db_tablespace", "datallowconn": false, "datconnlimit": -1, "datistemplate": true, "database_owner": "create_drop_db_test_user"}] -(3 rows) - -SET citus.log_remote_commands = true; --template databases could not be dropped so we need to change the template flag SELECT result from run_command_on_all_nodes( $$ @@ -230,7 +204,7 @@ SELECT result from run_command_on_all_nodes( UPDATE 1 (3 rows) -; +SET citus.log_remote_commands = true; set citus.grep_remote_commands = '%DROP DATABASE%'; drop database my_template_database; NOTICE: issuing DROP DATABASE my_template_database diff --git a/src/test/regress/sql/create_drop_database_propagation.sql b/src/test/regress/sql/create_drop_database_propagation.sql index 8e898e420..540d6a9e6 100644 --- a/src/test/regress/sql/create_drop_database_propagation.sql +++ b/src/test/regress/sql/create_drop_database_propagation.sql @@ -142,7 +142,8 @@ CREATE DATABASE my_template_database WITH TEMPLATE = 'template0' OWNER = create_drop_db_test_user ENCODING = 'UTF8' - LOCALE = 'en_US.utf8' + LC_COLLATE = 'C' + LC_CTYPE = 'C' TABLESPACE = create_drop_db_tablespace ALLOW_CONNECTIONS = false IS_TEMPLATE = true; @@ -164,29 +165,6 @@ SELECT result from run_command_on_all_nodes( $$ ) ORDER BY result; -SET citus.log_remote_commands = true; -set citus.grep_remote_commands = '%DROP DATABASE%'; -drop database my_template_database; - -SET citus.log_remote_commands = false; - -SELECT result from run_command_on_all_nodes( - $$ - SELECT jsonb_agg(to_jsonb(q2.*)) FROM ( - SELECT pd.datname, pg_encoding_to_char(pd.encoding) as encoding, - pd.datistemplate, pd.datallowconn, pd.datconnlimit, - pd.datcollate , pd. datctype , pd.datacl, - pa.rolname AS database_owner, pt.spcname AS tablespace - FROM pg_database pd - JOIN pg_authid pa ON pd.datdba = pa.oid - join pg_tablespace pt on pd.dattablespace = pt.oid - WHERE datname = 'my_template_database' - ) q2 - $$ -) ORDER BY result; - -SET citus.log_remote_commands = true; - --template databases could not be dropped so we need to change the template flag SELECT result from run_command_on_all_nodes( $$ @@ -194,7 +172,7 @@ SELECT result from run_command_on_all_nodes( $$ ) ORDER BY result; -; +SET citus.log_remote_commands = true; set citus.grep_remote_commands = '%DROP DATABASE%'; drop database my_template_database;