]> granicus.if.org Git - postgresql/commitdiff
Make more stable regression tests of dummy_index_am for string validations
authorMichael Paquier <michael@paquier.xyz>
Wed, 25 Sep 2019 03:48:26 +0000 (12:48 +0900)
committerMichael Paquier <michael@paquier.xyz>
Wed, 25 Sep 2019 03:48:26 +0000 (12:48 +0900)
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
src/test/modules/dummy_index_am/sql/reloptions.sql

index c19e79a7c4dc5215cf57058bc62004c6db86433a..85b6b4402938711f6281d74b7f021556f66a0f41 100644 (file)
@@ -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);
index 004a19612896c0ef4bdf65560666577d09f074cd..be3457562f191bdb2ac409e26969a8a8ac2fa0fb 100644 (file)
@@ -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);