mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
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
.
This commit is contained in:
@ -1,6 +1,8 @@
|
|||||||
-- Tests for relation options
|
-- Tests for relation options
|
||||||
CREATE EXTENSION dummy_index_am;
|
CREATE EXTENSION dummy_index_am;
|
||||||
CREATE TABLE dummy_test_tab (i int4);
|
CREATE TABLE dummy_test_tab (i int4);
|
||||||
|
-- Silence validation checks for strings
|
||||||
|
SET client_min_messages TO 'warning';
|
||||||
-- Test with default values.
|
-- Test with default values.
|
||||||
CREATE INDEX dummy_test_idx ON dummy_test_tab
|
CREATE INDEX dummy_test_idx ON dummy_test_tab
|
||||||
USING dummy_index_am (i);
|
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;
|
DROP INDEX dummy_test_idx;
|
||||||
-- Test with full set of options.
|
-- 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
|
CREATE INDEX dummy_test_idx ON dummy_test_tab
|
||||||
USING dummy_index_am (i) WITH (
|
USING dummy_index_am (i) WITH (
|
||||||
option_bool = false,
|
option_bool = false,
|
||||||
@ -20,6 +24,8 @@ CREATE INDEX dummy_test_idx ON dummy_test_tab
|
|||||||
option_string_null = 'val');
|
option_string_null = 'val');
|
||||||
NOTICE: new option value for string parameter null
|
NOTICE: new option value for string parameter null
|
||||||
NOTICE: new option value for string parameter val
|
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';
|
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
|
||||||
unnest
|
unnest
|
||||||
------------------------
|
------------------------
|
||||||
@ -30,8 +36,6 @@ SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
|
|||||||
option_string_null=val
|
option_string_null=val
|
||||||
(5 rows)
|
(5 rows)
|
||||||
|
|
||||||
-- Silence validation checks for strings
|
|
||||||
SET client_min_messages TO 'warning';
|
|
||||||
-- ALTER INDEX .. SET
|
-- ALTER INDEX .. SET
|
||||||
ALTER INDEX dummy_test_idx SET (option_int = 10);
|
ALTER INDEX dummy_test_idx SET (option_int = 10);
|
||||||
ALTER INDEX dummy_test_idx SET (option_bool = true);
|
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);
|
CREATE TABLE dummy_test_tab (i int4);
|
||||||
|
|
||||||
|
-- Silence validation checks for strings
|
||||||
|
SET client_min_messages TO 'warning';
|
||||||
|
|
||||||
-- Test with default values.
|
-- Test with default values.
|
||||||
CREATE INDEX dummy_test_idx ON dummy_test_tab
|
CREATE INDEX dummy_test_idx ON dummy_test_tab
|
||||||
USING dummy_index_am (i);
|
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;
|
DROP INDEX dummy_test_idx;
|
||||||
|
|
||||||
-- Test with full set of options.
|
-- 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
|
CREATE INDEX dummy_test_idx ON dummy_test_tab
|
||||||
USING dummy_index_am (i) WITH (
|
USING dummy_index_am (i) WITH (
|
||||||
option_bool = false,
|
option_bool = false,
|
||||||
@ -17,10 +22,9 @@ CREATE INDEX dummy_test_idx ON dummy_test_tab
|
|||||||
option_real = 3.1,
|
option_real = 3.1,
|
||||||
option_string_val = NULL,
|
option_string_val = NULL,
|
||||||
option_string_null = 'val');
|
option_string_null = 'val');
|
||||||
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
|
-- Silence again validation checks for strings until the end of the test.
|
||||||
|
|
||||||
-- Silence validation checks for strings
|
|
||||||
SET client_min_messages TO 'warning';
|
SET client_min_messages TO 'warning';
|
||||||
|
SELECT unnest(reloptions) FROM pg_class WHERE relname = 'dummy_test_idx';
|
||||||
|
|
||||||
-- ALTER INDEX .. SET
|
-- ALTER INDEX .. SET
|
||||||
ALTER INDEX dummy_test_idx SET (option_int = 10);
|
ALTER INDEX dummy_test_idx SET (option_int = 10);
|
||||||
|
Reference in New Issue
Block a user