Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e0afac1

Browse files
committed
Make more stable regression tests of dummy_index_am for string validations
Several buildfarm members (crake, loach and spurfowl) are complaining about two queries looking up at pg_class.reloptions which trigger the validation routines for string reloptions with default values. This commit limits the routines to be triggered only when building an index with all custom options set in CREATE INDEX, which is sufficient for the coverage. Introduced by 640c198.
1 parent 640c198 commit e0afac1

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

src/test/modules/dummy_index_am/expected/reloptions.out

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
-- Tests for relation options
22
CREATE EXTENSION dummy_index_am;
33
CREATE TABLE dummy_test_tab (i int4);
4+
-- Silence validation checks for strings
5+
SET client_min_messages TO 'warning';
46
-- Test with default values.
57
CREATE INDEX dummy_test_idx ON dummy_test_tab
68
USING dummy_index_am (i);
@@ -11,6 +13,8 @@ SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
1113

1214
DROP INDEX dummy_test_idx;
1315
-- Test with full set of options.
16+
-- Allow validation checks for strings, just for the index creation
17+
SET client_min_messages TO 'notice';
1418
CREATE INDEX dummy_test_idx ON dummy_test_tab
1519
USING dummy_index_am (i) WITH (
1620
option_bool = false,
@@ -20,6 +24,8 @@ CREATE INDEX dummy_test_idx ON dummy_test_tab
2024
option_string_null = 'val');
2125
NOTICE: new option value for string parameter null
2226
NOTICE: new option value for string parameter val
27+
-- Silence again validation checks for strings until the end of the test.
28+
SET client_min_messages TO 'warning';
2329
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
2430
unnest
2531
------------------------
@@ -30,8 +36,6 @@ SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
3036
option_string_null=val
3137
(5 rows)
3238

33-
-- Silence validation checks for strings
34-
SET client_min_messages TO 'warning';
3539
-- ALTER INDEX .. SET
3640
ALTER INDEX dummy_test_idx SET (option_int = 10);
3741
ALTER INDEX dummy_test_idx SET (option_bool = true);

src/test/modules/dummy_index_am/sql/reloptions.sql

+7-3
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@ CREATE EXTENSION dummy_index_am;
33

44
CREATE TABLE dummy_test_tab (i int4);
55

6+
-- Silence validation checks for strings
7+
SET client_min_messages TO 'warning';
8+
69
-- Test with default values.
710
CREATE INDEX dummy_test_idx ON dummy_test_tab
811
USING dummy_index_am (i);
912
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
1013
DROP INDEX dummy_test_idx;
1114

1215
-- Test with full set of options.
16+
-- Allow validation checks for strings, just for the index creation
17+
SET client_min_messages TO 'notice';
1318
CREATE INDEX dummy_test_idx ON dummy_test_tab
1419
USING dummy_index_am (i) WITH (
1520
option_bool = false,
1621
option_int = 5,
1722
option_real = 3.1,
1823
option_string_val = NULL,
1924
option_string_null = 'val');
20-
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
21-
22-
-- Silence validation checks for strings
25+
-- Silence again validation checks for strings until the end of the test.
2326
SET client_min_messages TO 'warning';
27+
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
2428

2529
-- ALTER INDEX .. SET
2630
ALTER INDEX dummy_test_idx SET (option_int = 10);

0 commit comments

Comments
 (0)