From 61779eb17d9406596162172751c6ec3ca2e3ddce Mon Sep 17 00:00:00 2001 From: Maksim Michkov Date: Fri, 22 Nov 2024 14:50:35 +0300 Subject: [PATCH] Simplify test_create_extension --- .../expected/test_create_extension.out | 19 ++++------ .../expected7/test_create_extension.out | 38 ------------------- .../isolation2/sql/test_create_extension.sql | 29 ++++++++++---- .../expected/test_create_extension.out | 16 +++----- .../expected7/test_create_extension.out | 29 -------------- tests/regress/sql/test_create_extension.sql | 29 ++++++++++---- 6 files changed, 55 insertions(+), 105 deletions(-) delete mode 100644 tests/isolation2/expected7/test_create_extension.out delete mode 100644 tests/regress/expected7/test_create_extension.out diff --git a/tests/isolation2/expected/test_create_extension.out b/tests/isolation2/expected/test_create_extension.out index 52077f31..e53290de 100644 --- a/tests/isolation2/expected/test_create_extension.out +++ b/tests/isolation2/expected/test_create_extension.out @@ -1,23 +1,18 @@ -- check that diskquota ignores global flag appendonly=true --- for GPDB 6 -SET gp_default_storage_options='appendonly=true'; -SET --- for GPDB 7 -SET default_table_access_method='ao_row'; -ERROR: unrecognized configuration parameter "default_table_access_method" +-- start_matchsubs +-- m/CREATE EXTENSION$/ +-- s/CREATE EXTENSION$/CREATE/ +-- m/DROP EXTENSION$/ +-- s/DROP EXTENSION$/DROP/ +-- end_matchsubs + CREATE EXTENSION diskquota; CREATE DROP EXTENSION diskquota; DROP --- for GPDB 6 -SET gp_default_storage_options='appendonly=false'; -SET --- for GPDB 7 -SET default_table_access_method='heap'; -ERROR: unrecognized configuration parameter "default_table_access_method" CREATE EXTENSION diskquota; CREATE diff --git a/tests/isolation2/expected7/test_create_extension.out b/tests/isolation2/expected7/test_create_extension.out deleted file mode 100644 index 2079ae36..00000000 --- a/tests/isolation2/expected7/test_create_extension.out +++ /dev/null @@ -1,38 +0,0 @@ --- check that diskquota ignores global flag appendonly=true - --- for GPDB 6 -SET gp_default_storage_options='appendonly=true'; -ERROR: invalid storage option "appendonly" -HINT: For table access methods use "default_table_access_method" instead. --- for GPDB 7 -SET default_table_access_method='ao_row'; -SET - -CREATE EXTENSION diskquota; -CREATE EXTENSION -DROP EXTENSION diskquota; -DROP EXTENSION - --- for GPDB 6 -SET gp_default_storage_options='appendonly=false'; -ERROR: invalid storage option "appendonly" -HINT: For table access methods use "default_table_access_method" instead. --- for GPDB 7 -SET default_table_access_method='heap'; -SET - -CREATE EXTENSION diskquota; -CREATE EXTENSION - -SELECT diskquota.init_table_size_table(); - init_table_size_table ------------------------ - -(1 row) - --- Wait after init so that diskquota.state is clean -SELECT diskquota.wait_for_worker_new_epoch(); - wait_for_worker_new_epoch ---------------------------- - t -(1 row) diff --git a/tests/isolation2/sql/test_create_extension.sql b/tests/isolation2/sql/test_create_extension.sql index 7b1e4670..1313310b 100644 --- a/tests/isolation2/sql/test_create_extension.sql +++ b/tests/isolation2/sql/test_create_extension.sql @@ -1,17 +1,30 @@ -- check that diskquota ignores global flag appendonly=true --- for GPDB 6 -SET gp_default_storage_options='appendonly=true'; --- for GPDB 7 -SET default_table_access_method='ao_row'; +-- start_matchsubs +-- m/CREATE EXTENSION$/ +-- s/CREATE EXTENSION$/CREATE/ +-- m/DROP EXTENSION$/ +-- s/DROP EXTENSION$/DROP/ +-- end_matchsubs + +-- start_ignore +SELECT CASE + WHEN current_setting('server_version_num')::int > 120000 + THEN set_config('default_table_access_method', 'ao_row', false) + ELSE set_config('gp_default_storage_options', 'appendonly=true', false) +END; +-- end_ignore CREATE EXTENSION diskquota; DROP EXTENSION diskquota; --- for GPDB 6 -SET gp_default_storage_options='appendonly=false'; --- for GPDB 7 -SET default_table_access_method='heap'; +-- start_ignore +SELECT CASE + WHEN current_setting('server_version_num')::int > 120000 + THEN set_config('default_table_access_method', 'heap', false) + ELSE set_config('gp_default_storage_options', 'appendonly=false', false) +END; +-- end_ignore CREATE EXTENSION diskquota; diff --git a/tests/regress/expected/test_create_extension.out b/tests/regress/expected/test_create_extension.out index ff119aea..7f7d6055 100644 --- a/tests/regress/expected/test_create_extension.out +++ b/tests/regress/expected/test_create_extension.out @@ -1,16 +1,12 @@ -- check that diskquota ignores global flag appendonly=true --- for GPDB 6 -SET gp_default_storage_options='appendonly=true'; --- for GPDB 7 -SET default_table_access_method='ao_row'; -ERROR: unrecognized configuration parameter "default_table_access_method" +-- start_matchsubs +-- m/CREATE EXTENSION$/ +-- s/CREATE EXTENSION$/CREATE/ +-- m/DROP EXTENSION$/ +-- s/DROP EXTENSION$/DROP/ +-- end_matchsubs CREATE EXTENSION diskquota; DROP EXTENSION diskquota; --- for GPDB 6 -SET gp_default_storage_options='appendonly=false'; --- for GPDB 7 -SET default_table_access_method='heap'; -ERROR: unrecognized configuration parameter "default_table_access_method" CREATE EXTENSION diskquota; SELECT diskquota.init_table_size_table(); init_table_size_table diff --git a/tests/regress/expected7/test_create_extension.out b/tests/regress/expected7/test_create_extension.out deleted file mode 100644 index b100c406..00000000 --- a/tests/regress/expected7/test_create_extension.out +++ /dev/null @@ -1,29 +0,0 @@ --- check that diskquota ignores global flag appendonly=true --- for GPDB 6 -SET gp_default_storage_options='appendonly=true'; -ERROR: invalid storage option "appendonly" -HINT: For table access methods use "default_table_access_method" instead. --- for GPDB 7 -SET default_table_access_method='ao_row'; -CREATE EXTENSION diskquota; -DROP EXTENSION diskquota; --- for GPDB 6 -SET gp_default_storage_options='appendonly=false'; -ERROR: invalid storage option "appendonly" -HINT: For table access methods use "default_table_access_method" instead. --- for GPDB 7 -SET default_table_access_method='heap'; -CREATE EXTENSION diskquota; -SELECT diskquota.init_table_size_table(); - init_table_size_table ------------------------ - -(1 row) - --- Wait after init so that diskquota.state is clean -SELECT diskquota.wait_for_worker_new_epoch(); - wait_for_worker_new_epoch ---------------------------- - t -(1 row) - diff --git a/tests/regress/sql/test_create_extension.sql b/tests/regress/sql/test_create_extension.sql index 2e20348a..39eb27bb 100644 --- a/tests/regress/sql/test_create_extension.sql +++ b/tests/regress/sql/test_create_extension.sql @@ -1,17 +1,30 @@ -- check that diskquota ignores global flag appendonly=true --- for GPDB 6 -SET gp_default_storage_options='appendonly=true'; --- for GPDB 7 -SET default_table_access_method='ao_row'; +-- start_matchsubs +-- m/CREATE EXTENSION$/ +-- s/CREATE EXTENSION$/CREATE/ +-- m/DROP EXTENSION$/ +-- s/DROP EXTENSION$/DROP/ +-- end_matchsubs + +-- start_ignore +SELECT CASE + WHEN current_setting('server_version_num')::int > 120000 + THEN set_config('default_table_access_method', 'ao_row', false) + ELSE set_config('gp_default_storage_options', 'appendonly=true', false) +END; +-- end_ignore CREATE EXTENSION diskquota; DROP EXTENSION diskquota; --- for GPDB 6 -SET gp_default_storage_options='appendonly=false'; --- for GPDB 7 -SET default_table_access_method='heap'; +-- start_ignore +SELECT CASE + WHEN current_setting('server_version_num')::int > 120000 + THEN set_config('default_table_access_method', 'heap', false) + ELSE set_config('gp_default_storage_options', 'appendonly=false', false) +END; +-- end_ignore CREATE EXTENSION diskquota;