postgres.git / summary / log / commit / refs

commit    e0afac124ec7026a49909436ebcfc2bd999852a8
Author:   Michael Paquier <michael@paquier.xyz>
Date:     Wed Sep 25 03:48:26 2019 +0000

    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.


src/test/modules/dummy_index_am/expected/reloptions.out | 8 ++++++-- src/test/modules/dummy_index_am/sql/reloptions.sql | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/test/modules/dummy_index_am/expected/reloptions.out b/src/test/modules/dummy_index_am/expected/reloptions.out index c19e79a7c4d..85b6b440293 100644 --- a/src/test/modules/dummy_index_am/expected/reloptions.out +++ b/src/test/modules/dummy_index_am/expected/reloptions.out @@ -1,6 +1,8 @@ -- Tests for relation options CREATE EXTENSION dummy_index_am; CREATE TABLE dummy_test_tab (i int4); +-- Silence validation checks for strings +SET client_min_messages TO 'warning'; -- Test with default values. CREATE INDEX dummy_test_idx ON dummy_test_tab USING dummy_index_am (i); @@ -11,6 +13,8 @@ SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx'; DROP INDEX dummy_test_idx; -- Test with full set of options. +-- Allow validation checks for strings, just for the index creation +SET client_min_messages TO 'notice'; CREATE INDEX dummy_test_idx ON dummy_test_tab USING dummy_index_am (i) WITH ( option_bool = false, @@ -20,6 +24,8 @@ CREATE INDEX dummy_test_idx ON dummy_test_tab option_string_null = 'val'); NOTICE: new option value for string parameter null NOTICE: new option value for string parameter val +-- Silence again validation checks for strings until the end of the test. +SET client_min_messages TO 'warning'; SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx'; unnest ------------------------ @@ -30,8 +36,6 @@ SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx'; option_string_null=val (5 rows) --- Silence validation checks for strings -SET client_min_messages TO 'warning'; -- ALTER INDEX .. SET ALTER INDEX dummy_test_idx SET (option_int = 10); ALTER INDEX dummy_test_idx SET (option_bool = true); diff --git a/src/test/modules/dummy_index_am/sql/reloptions.sql b/src/test/modules/dummy_index_am/sql/reloptions.sql index 004a1961289..be3457562f1 100644 --- a/src/test/modules/dummy_index_am/sql/reloptions.sql +++ b/src/test/modules/dummy_index_am/sql/reloptions.sql @@ -3,6 +3,9 @@ CREATE EXTENSION dummy_index_am; CREATE TABLE dummy_test_tab (i int4); +-- Silence validation checks for strings +SET client_min_messages TO 'warning'; + -- Test with default values. CREATE INDEX dummy_test_idx ON dummy_test_tab USING dummy_index_am (i); @@ -10,6 +13,8 @@ SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx'; DROP INDEX dummy_test_idx; -- Test with full set of options. +-- Allow validation checks for strings, just for the index creation +SET client_min_messages TO 'notice'; CREATE INDEX dummy_test_idx ON dummy_test_tab USING dummy_index_am (i) WITH ( option_bool = false, @@ -17,10 +22,9 @@ CREATE INDEX dummy_test_idx ON dummy_test_tab option_real = 3.1, option_string_val = NULL, option_string_null = 'val'); -SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx'; - --- Silence validation checks for strings +-- Silence again validation checks for strings until the end of the test. SET client_min_messages TO 'warning'; +SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx'; -- ALTER INDEX .. SET ALTER INDEX dummy_test_idx SET (option_int = 10); [parent: 640c19869f8c]