summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorRobert Haas2017-11-17 16:53:00 +0000
committerRobert Haas2017-11-17 16:53:00 +0000
commitbe92769e4e63de949fe3ba29e0bf5c0a96f54ae3 (patch)
tree959c1c12a7b0ab8db34430efc27c202ba1cb15bb /src/test
parent11e264517dff7a911d9e6494de86049cab42cde3 (diff)
Set proargmodes for satisfies_hash_partition.
It appears that proargmodes should always be set for variadic functions, but satifies_hash_partition had it as NULL. In addition to fixing the problem, add a regression test to guard against future mistakes of this type.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/type_sanity.out11
-rw-r--r--src/test/regress/sql/type_sanity.sql8
2 files changed, 19 insertions, 0 deletions
diff --git a/src/test/regress/expected/type_sanity.out b/src/test/regress/expected/type_sanity.out
index c6440060dcb..b1419d4bc21 100644
--- a/src/test/regress/expected/type_sanity.out
+++ b/src/test/regress/expected/type_sanity.out
@@ -147,6 +147,17 @@ AND case proargtypes[array_length(proargtypes, 1)-1]
-----+-------------+-------------
(0 rows)
+-- Check that all and only those functions with a variadic type have
+-- a variadic argument.
+SELECT oid::regprocedure, proargmodes, provariadic
+FROM pg_proc
+WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
+ IS DISTINCT FROM
+ (provariadic != 0);
+ oid | proargmodes | provariadic
+-----+-------------+-------------
+(0 rows)
+
-- As of 8.0, this check finds refcursor, which is borrowing
-- other types' I/O routines
SELECT p1.oid, p1.typname, p2.oid, p2.proname
diff --git a/src/test/regress/sql/type_sanity.sql b/src/test/regress/sql/type_sanity.sql
index 428c2d324dd..f9aeea32144 100644
--- a/src/test/regress/sql/type_sanity.sql
+++ b/src/test/regress/sql/type_sanity.sql
@@ -120,6 +120,14 @@ AND case proargtypes[array_length(proargtypes, 1)-1]
WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
END != provariadic;
+-- Check that all and only those functions with a variadic type have
+-- a variadic argument.
+SELECT oid::regprocedure, proargmodes, provariadic
+FROM pg_proc
+WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
+ IS DISTINCT FROM
+ (provariadic != 0);
+
-- As of 8.0, this check finds refcursor, which is borrowing
-- other types' I/O routines
SELECT p1.oid, p1.typname, p2.oid, p2.proname