summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2011-03-14 16:52:03 +0000
committerTom Lane2011-03-14 16:52:31 +0000
commitf12423d75a1181d75bd646869b140ba0c199fa99 (patch)
treed7be118fee1965476e38461d4c4c66de321931c6
parentb051a34fd8877635186ed84a857f2f38cd059468 (diff)
Adjust regression test to avoid platform-dependent failure.
We have a test that verifies that max(anyarray) will cope if the array column elements aren't all the same array type. However, it's now possible for that to produce a collation-related error message instead of the expected one, if the first two column elements happen to be of the same type and it's one that expects to be given collation info. Tweak the test to ensure this doesn't happen. Per buildfarm member pika.
-rw-r--r--src/test/regress/expected/polymorphism.out3
-rw-r--r--src/test/regress/sql/polymorphism.sql3
2 files changed, 4 insertions, 2 deletions
diff --git a/src/test/regress/expected/polymorphism.out b/src/test/regress/expected/polymorphism.out
index bae04a2719..4d1fc2beb0 100644
--- a/src/test/regress/expected/polymorphism.out
+++ b/src/test/regress/expected/polymorphism.out
@@ -623,7 +623,8 @@ where histogram_bounds is not null;
(1 row)
-- such functions must protect themselves if varying element type isn't OK
-select max(histogram_bounds) from pg_stats;
+-- (WHERE clause here is to avoid possibly getting a collation error instead)
+select max(histogram_bounds) from pg_stats where tablename = 'pg_am';
ERROR: cannot compare arrays of different element types
-- test variadic polymorphic functions
create function myleast(variadic anyarray) returns anyelement as $$
diff --git a/src/test/regress/sql/polymorphism.sql b/src/test/regress/sql/polymorphism.sql
index 2baebe9323..50e6905d4c 100644
--- a/src/test/regress/sql/polymorphism.sql
+++ b/src/test/regress/sql/polymorphism.sql
@@ -433,7 +433,8 @@ select distinct array_ndims(histogram_bounds) from pg_stats
where histogram_bounds is not null;
-- such functions must protect themselves if varying element type isn't OK
-select max(histogram_bounds) from pg_stats;
+-- (WHERE clause here is to avoid possibly getting a collation error instead)
+select max(histogram_bounds) from pg_stats where tablename = 'pg_am';
-- test variadic polymorphic functions