From 1963257331d440092f5b99a6be07d8382ff5602c Mon Sep 17 00:00:00 2001 From: gindibay Date: Mon, 4 Sep 2023 21:37:00 +0300 Subject: [PATCH] Fixes unit tests --- .../expected/alter_database_propagation.out | 15 ++++++++------- .../expected/alter_database_propagation_1.out | 12 +++++++----- .../regress/sql/alter_database_propagation.sql | 13 +++---------- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/test/regress/expected/alter_database_propagation.out b/src/test/regress/expected/alter_database_propagation.out index acbc7ce5e..269460116 100644 --- a/src/test/regress/expected/alter_database_propagation.out +++ b/src/test/regress/expected/alter_database_propagation.out @@ -38,27 +38,28 @@ select datistemplate from pg_database where datname = 'regression'; DO $$ DECLARE - v_version_num numeric; + v_version_num int; BEGIN SELECT current_setting('server_version_num')::numeric INTO v_version_num; IF v_version_num >= 150000 THEN set citus.log_remote_commands = true; set citus.grep_remote_commands = '%ALTER DATABASE%'; - alter database regression REFRESH COLLATION VERSION; + execute 'alter database regression REFRESH COLLATION VERSION'; set citus.log_remote_commands = false; ELSE - RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14'; + RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL version < 15.'; END IF; END; -$$; +$$ +language plpgsql; NOTICE: version has not changed CONTEXT: SQL statement "alter database regression REFRESH COLLATION VERSION" -PL/pgSQL function inline_code_block line XX at SQL statement +PL/pgSQL function inline_code_block line XX at EXECUTE NOTICE: issuing ALTER DATABASE regression REFRESH COLLATION VERSION; DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx CONTEXT: SQL statement "alter database regression REFRESH COLLATION VERSION" -PL/pgSQL function inline_code_block line XX at SQL statement +PL/pgSQL function inline_code_block line XX at EXECUTE NOTICE: issuing ALTER DATABASE regression REFRESH COLLATION VERSION; DETAIL: on server postgres@localhost:xxxxx connectionId: xxxxxxx CONTEXT: SQL statement "alter database regression REFRESH COLLATION VERSION" -PL/pgSQL function inline_code_block line XX at SQL statement \ No newline at end of file +PL/pgSQL function inline_code_block line XX at EXECUTE diff --git a/src/test/regress/expected/alter_database_propagation_1.out b/src/test/regress/expected/alter_database_propagation_1.out index ed7d41026..9f2601b20 100644 --- a/src/test/regress/expected/alter_database_propagation_1.out +++ b/src/test/regress/expected/alter_database_propagation_1.out @@ -38,17 +38,19 @@ select datistemplate from pg_database where datname = 'regression'; DO $$ DECLARE - v_version_num numeric; + v_version_num int; BEGIN SELECT current_setting('server_version_num')::numeric INTO v_version_num; IF v_version_num >= 150000 THEN set citus.log_remote_commands = true; set citus.grep_remote_commands = '%ALTER DATABASE%'; - alter database regression REFRESH COLLATION VERSION; + execute 'alter database regression REFRESH COLLATION VERSION'; set citus.log_remote_commands = false; ELSE - RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14'; + RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL version < 15.'; END IF; END; -$$; -Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL 14 +$$ +language plpgsql; +NOTICE: Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL version < 15. + diff --git a/src/test/regress/sql/alter_database_propagation.sql b/src/test/regress/sql/alter_database_propagation.sql index 66ba004a7..22c147e4b 100644 --- a/src/test/regress/sql/alter_database_propagation.sql +++ b/src/test/regress/sql/alter_database_propagation.sql @@ -33,21 +33,14 @@ DECLARE v_version_num int; BEGIN SELECT current_setting('server_version_num')::numeric INTO v_version_num; - raise notice 'v_version_num: %', v_version_num; IF v_version_num >= 150000 THEN set citus.log_remote_commands = true; set citus.grep_remote_commands = '%ALTER DATABASE%'; - alter database regression REFRESH COLLATION VERSION; + execute 'alter database regression REFRESH COLLATION VERSION'; set citus.log_remote_commands = false; ELSE RAISE NOTICE 'Skipping alter database .. REFRESH COLLATION VERSION for PostgreSQL version < 15.'; END IF; END; -$$; - - - - - - - +$$ +language plpgsql;