From 5b446b11372043ccb5648b561ef8816dfc0f5635 Mon Sep 17 00:00:00 2001 From: Onur Tirtir Date: Mon, 13 Nov 2023 11:27:29 +0300 Subject: [PATCH] make tests passing --- .../distributed/metadata/metadata_sync.c | 4 +++- .../create_drop_database_propagation.out | 20 +++++++++---------- .../sql/create_drop_database_propagation.sql | 8 ++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/backend/distributed/metadata/metadata_sync.c b/src/backend/distributed/metadata/metadata_sync.c index e612a468a..0c04502e6 100644 --- a/src/backend/distributed/metadata/metadata_sync.c +++ b/src/backend/distributed/metadata/metadata_sync.c @@ -3958,7 +3958,9 @@ citus_internal_database_command(PG_FUNCTION_ARGS) } else { - ereport(ERROR, (errmsg("unsupported command type %d", nodeTag(parseTree)))); + ereport(ERROR, (errmsg("citus_internal_database_command() can only be used " + "for CREATE DATABASE and DROP DATABASE commands by " + "Citus."))); } /* rollback GUCs to the state before this session */ diff --git a/src/test/regress/expected/create_drop_database_propagation.out b/src/test/regress/expected/create_drop_database_propagation.out index 6bc94e7a1..00f95c7c3 100644 --- a/src/test/regress/expected/create_drop_database_propagation.out +++ b/src/test/regress/expected/create_drop_database_propagation.out @@ -25,9 +25,9 @@ SELECT pg_catalog.citus_internal_database_command(null); ERROR: command cannot be NULL -- fails on non create / drop db command SELECT pg_catalog.citus_internal_database_command('CREATE TABLE foo_bar(a int)'); -ERROR: unsupported command type 255 +ERROR: citus_internal_database_command() can only be used for CREATE DATABASE and DROP DATABASE commands by Citus. SELECT pg_catalog.citus_internal_database_command('SELECT 1'); -ERROR: unsupported command type 242 +ERROR: citus_internal_database_command() can only be used for CREATE DATABASE and DROP DATABASE commands by Citus. SELECT pg_catalog.citus_internal_database_command('asfsfdsg'); ERROR: syntax error at or near "asfsfdsg" SELECT pg_catalog.citus_internal_database_command(''); @@ -140,17 +140,17 @@ SELECT * FROM public.check_database_on_all_nodes('mydatabase_1') ORDER BY node_t -- Test LC / LOCALE settings that don't match the ones provided in template db. -- All should throw an error on the coordinator. -CREATE DATABASE lc_collate_test LC_COLLATE = 'en_US.UTF-8'; -ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (C) +CREATE DATABASE lc_collate_test LC_COLLATE = 'C.UTF-8'; +ERROR: new collation (C.UTF-8) is incompatible with the collation of the template database (C) HINT: Use the same collation as in the template database, or use template0 as template. -CREATE DATABASE lc_ctype_test LC_CTYPE = 'en_US.UTF-8'; -ERROR: new LC_CTYPE (en_US.UTF-8) is incompatible with the LC_CTYPE of the template database (C) +CREATE DATABASE lc_ctype_test LC_CTYPE = 'C.UTF-8'; +ERROR: new LC_CTYPE (C.UTF-8) is incompatible with the LC_CTYPE of the template database (C) HINT: Use the same LC_CTYPE as in the template database, or use template0 as template. -CREATE DATABASE locale_test LOCALE = 'en_US.UTF-8'; -ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (C) +CREATE DATABASE locale_test LOCALE = 'C.UTF-8'; +ERROR: new collation (C.UTF-8) is incompatible with the collation of the template database (C) HINT: Use the same collation as in the template database, or use template0 as template. -CREATE DATABASE lc_collate_lc_ctype_test LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8'; -ERROR: new collation (en_US.UTF-8) is incompatible with the collation of the template database (C) +CREATE DATABASE lc_collate_lc_ctype_test LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8'; +ERROR: new collation (C.UTF-8) is incompatible with the collation of the template database (C) HINT: Use the same collation as in the template database, or use template0 as template. -- Test LC / LOCALE settings that match the ones provided in template db. CREATE DATABASE lc_collate_test LC_COLLATE = 'C'; diff --git a/src/test/regress/sql/create_drop_database_propagation.sql b/src/test/regress/sql/create_drop_database_propagation.sql index d75ecdf9f..6e6ecacb5 100644 --- a/src/test/regress/sql/create_drop_database_propagation.sql +++ b/src/test/regress/sql/create_drop_database_propagation.sql @@ -96,10 +96,10 @@ SELECT * FROM public.check_database_on_all_nodes('mydatabase_1') ORDER BY node_t -- Test LC / LOCALE settings that don't match the ones provided in template db. -- All should throw an error on the coordinator. -CREATE DATABASE lc_collate_test LC_COLLATE = 'en_US.UTF-8'; -CREATE DATABASE lc_ctype_test LC_CTYPE = 'en_US.UTF-8'; -CREATE DATABASE locale_test LOCALE = 'en_US.UTF-8'; -CREATE DATABASE lc_collate_lc_ctype_test LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8'; +CREATE DATABASE lc_collate_test LC_COLLATE = 'C.UTF-8'; +CREATE DATABASE lc_ctype_test LC_CTYPE = 'C.UTF-8'; +CREATE DATABASE locale_test LOCALE = 'C.UTF-8'; +CREATE DATABASE lc_collate_lc_ctype_test LC_COLLATE = 'C.UTF-8' LC_CTYPE = 'C.UTF-8'; -- Test LC / LOCALE settings that match the ones provided in template db. CREATE DATABASE lc_collate_test LC_COLLATE = 'C';