From 96e7e1bc08919ceb34d95140834f0db94266da2e Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Wed, 14 Aug 2019 13:37:48 +0900 Subject: [PATCH] Fix random regression failure in test case "collate.icu.utf8" This is a fix similar to 2d7d67cc, where slight plan alteration can cause a random failure of this regression test because of an incorect tuple ordering, except that this one involves lookups of pg_type. Similarly to the other case, add ORDER BY clauses to ensure the output order. The failure has been seen at least once on buildfarm member skink. Reported-by: Thomas Munro Discussion: https://postgr.es/m/CA+hUKGLjR9ZBvhXcr9b-NSBHPw9aRgbjyzGE+kqLsT4vwX+nkQ@mail.gmail.com Backpatch-through: 12 --- src/test/regress/expected/collate.icu.utf8.out | 6 ++++-- src/test/regress/sql/collate.icu.utf8.sql | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/test/regress/expected/collate.icu.utf8.out b/src/test/regress/expected/collate.icu.utf8.out index 50d1e6e0cc..2b86ce9028 100644 --- a/src/test/regress/expected/collate.icu.utf8.out +++ b/src/test/regress/expected/collate.icu.utf8.out @@ -1651,14 +1651,16 @@ SELECT relname FROM pg_class WHERE 'PG_CLASS'::text = relname COLLATE case_insen pg_class (1 row) -SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND typname <> 'INT2'::text COLLATE case_insensitive; +SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND typname <> 'INT2'::text + COLLATE case_insensitive ORDER BY typname; typname --------- int4 int8 (2 rows) -SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND 'INT2'::text <> typname COLLATE case_insensitive;; +SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND 'INT2'::text <> typname + COLLATE case_insensitive ORDER BY typname; typname --------- int4 diff --git a/src/test/regress/sql/collate.icu.utf8.sql b/src/test/regress/sql/collate.icu.utf8.sql index 5ed63601e0..67de7d9794 100644 --- a/src/test/regress/sql/collate.icu.utf8.sql +++ b/src/test/regress/sql/collate.icu.utf8.sql @@ -603,8 +603,10 @@ SELECT 'ὀδυσσεύς' = 'ὈΔΥΣΣΕΎΣ' COLLATE case_insensitive; SELECT relname FROM pg_class WHERE relname = 'PG_CLASS'::text COLLATE case_insensitive; SELECT relname FROM pg_class WHERE 'PG_CLASS'::text = relname COLLATE case_insensitive; -SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND typname <> 'INT2'::text COLLATE case_insensitive; -SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND 'INT2'::text <> typname COLLATE case_insensitive;; +SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND typname <> 'INT2'::text + COLLATE case_insensitive ORDER BY typname; +SELECT typname FROM pg_type WHERE typname LIKE 'int_' AND 'INT2'::text <> typname + COLLATE case_insensitive ORDER BY typname; -- test case adapted from subselect.sql CREATE TEMP TABLE outer_text (f1 text COLLATE case_insensitive, f2 text); -- 2.40.0