Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 398d3e3

Browse files
Unmark gen_random_uuid() function leakproof.
The functions without arguments don't need to be marked leakproof. This commit unmarks gen_random_uuid() leakproof for consistency with upcoming UUID generation functions. Also, this commit adds a regression test to prevent reintroducing such cases. Bump catalog version. Reported-by: Peter Eisentraut Reviewed-by: Andres Freund Discussion: https://postgr.es/m/CAD21AoBE1ePPWY1NQEgk3DkqjYzLPZwYTzCySHm0e%2B9a69PfZw%40mail.gmail.com
1 parent 0e033f5 commit 398d3e3

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

src/include/catalog/catversion.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
*/
5858

5959
/* yyyymmddN */
60-
#define CATALOG_VERSION_NO 202412021
60+
#define CATALOG_VERSION_NO 202412111
6161

6262
#endif

src/include/catalog/pg_proc.dat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9345,7 +9345,7 @@
93459345
proname => 'uuid_hash_extended', prorettype => 'int8',
93469346
proargtypes => 'uuid int8', prosrc => 'uuid_hash_extended' },
93479347
{ oid => '3432', descr => 'generate random UUID',
9348-
proname => 'gen_random_uuid', proleakproof => 't', provolatile => 'v',
9348+
proname => 'gen_random_uuid', provolatile => 'v',
93499349
prorettype => 'uuid', proargtypes => '', prosrc => 'gen_random_uuid' },
93509350
{ oid => '6342', descr => 'extract timestamp from UUID',
93519351
proname => 'uuid_extract_timestamp', proleakproof => 't',

src/test/regress/expected/opr_sanity.out

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,6 @@ sha224(bytea)
855855
sha256(bytea)
856856
sha384(bytea)
857857
sha512(bytea)
858-
gen_random_uuid()
859858
starts_with(text,text)
860859
macaddr8_eq(macaddr8,macaddr8)
861860
macaddr8_lt(macaddr8,macaddr8)
@@ -878,6 +877,12 @@ crc32(bytea)
878877
crc32c(bytea)
879878
bytea_larger(bytea,bytea)
880879
bytea_smaller(bytea,bytea)
880+
-- Check that functions without argument are not marked as leakproof.
881+
SELECT p1.oid::regprocedure
882+
FROM pg_proc p1 JOIN pg_namespace pn
883+
ON pronamespace = pn.oid
884+
WHERE nspname = 'pg_catalog' AND proleakproof AND pronargs = 0
885+
ORDER BY 1;
881886
-- restore normal output mode
882887
\a\t
883888
-- List of functions used by libpq's fe-lobj.c

src/test/regress/sql/opr_sanity.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@ FROM pg_proc p1 JOIN pg_namespace pn
399399
WHERE nspname = 'pg_catalog' AND proleakproof
400400
ORDER BY 1;
401401

402+
-- Check that functions without argument are not marked as leakproof.
403+
SELECT p1.oid::regprocedure
404+
FROM pg_proc p1 JOIN pg_namespace pn
405+
ON pronamespace = pn.oid
406+
WHERE nspname = 'pg_catalog' AND proleakproof AND pronargs = 0
407+
ORDER BY 1;
408+
402409
-- restore normal output mode
403410
\a\t
404411

0 commit comments

Comments
 (0)