Skip to content

Commit be92769

Browse files
committed
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.
1 parent 11e2645 commit be92769

File tree

4 files changed

+21
-2
lines changed

4 files changed

+21
-2
lines changed

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,6 @@
5353
*/
5454

5555
/* yyyymmddN */
56-
#define CATALOG_VERSION_NO 201711092
56+
#define CATALOG_VERSION_NO 201711171
5757

5858
#endif

src/include/catalog/pg_proc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5523,7 +5523,7 @@ DATA(insert OID = 3354 ( pg_ls_waldir PGNSP PGUID 12 10 20 0 0 f f f f t t
55235523
DESCR("list of files in the WAL directory");
55245524

55255525
/* hash partitioning constraint function */
5526-
DATA(insert OID = 5028 ( satisfies_hash_partition PGNSP PGUID 12 1 0 2276 0 f f f f f f i s 4 0 16 "26 23 23 2276" _null_ _null_ _null_ _null_ _null_ satisfies_hash_partition _null_ _null_ _null_ ));
5526+
DATA(insert OID = 5028 ( satisfies_hash_partition PGNSP PGUID 12 1 0 2276 0 f f f f f f i s 4 0 16 "26 23 23 2276" _null_ "{i,i,i,v}" _null_ _null_ _null_ satisfies_hash_partition _null_ _null_ _null_ ));
55275527
DESCR("hash partition CHECK constraint");
55285528

55295529
/*

src/test/regress/expected/type_sanity.out

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,17 @@ AND case proargtypes[array_length(proargtypes, 1)-1]
147147
-----+-------------+-------------
148148
(0 rows)
149149

150+
-- Check that all and only those functions with a variadic type have
151+
-- a variadic argument.
152+
SELECT oid::regprocedure, proargmodes, provariadic
153+
FROM pg_proc
154+
WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
155+
IS DISTINCT FROM
156+
(provariadic != 0);
157+
oid | proargmodes | provariadic
158+
-----+-------------+-------------
159+
(0 rows)
160+
150161
-- As of 8.0, this check finds refcursor, which is borrowing
151162
-- other types' I/O routines
152163
SELECT p1.oid, p1.typname, p2.oid, p2.proname

src/test/regress/sql/type_sanity.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ AND case proargtypes[array_length(proargtypes, 1)-1]
120120
WHERE t.typarray = proargtypes[array_length(proargtypes, 1)-1])
121121
END != provariadic;
122122

123+
-- Check that all and only those functions with a variadic type have
124+
-- a variadic argument.
125+
SELECT oid::regprocedure, proargmodes, provariadic
126+
FROM pg_proc
127+
WHERE (proargmodes IS NOT NULL AND 'v' = any(proargmodes))
128+
IS DISTINCT FROM
129+
(provariadic != 0);
130+
123131
-- As of 8.0, this check finds refcursor, which is borrowing
124132
-- other types' I/O routines
125133
SELECT p1.oid, p1.typname, p2.oid, p2.proname

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy