Skip to content

Commit

Permalink
Simplify test_create_extension
Browse files Browse the repository at this point in the history
  • Loading branch information
silent-observer committed Nov 22, 2024
1 parent d24ee4d commit 61779eb
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 105 deletions.
19 changes: 7 additions & 12 deletions tests/isolation2/expected/test_create_extension.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
38 changes: 0 additions & 38 deletions tests/isolation2/expected7/test_create_extension.out

This file was deleted.

29 changes: 21 additions & 8 deletions tests/isolation2/sql/test_create_extension.sql
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
16 changes: 6 additions & 10 deletions tests/regress/expected/test_create_extension.out
Original file line number Diff line number Diff line change
@@ -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
Expand Down
29 changes: 0 additions & 29 deletions tests/regress/expected7/test_create_extension.out

This file was deleted.

29 changes: 21 additions & 8 deletions tests/regress/sql/test_create_extension.sql
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit 61779eb

Please sign in to comment.