Commit e0afac12 authored by Michael Paquier's avatar Michael Paquier

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 640c1986.
parent 640c1986
-- 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);
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment