From bdde9fb537e9c197284331a907ac97785ddcf018 Mon Sep 17 00:00:00 2001 From: "Chao Li (Evan)" Date: Mon, 22 Jun 2026 11:37:24 +0800 Subject: [PATCH v1] Mark uuid-to-bytea cast as leakproof The uuid-to-bytea cast just serializes a valid uuid datum to its fixed 16-byte representation. It does not have an input-dependent error path, like the existing integer-to-bytea casts, so mark its pg_proc entry as leakproof. Update opr_sanity's expected list of built-in leakproof functions accordingly. Author: Chao Li --- src/include/catalog/pg_proc.dat | 4 ++-- src/test/regress/expected/opr_sanity.out | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/include/catalog/pg_proc.dat b/src/include/catalog/pg_proc.dat index be157a5fbe9..d0c11559743 100644 --- a/src/include/catalog/pg_proc.dat +++ b/src/include/catalog/pg_proc.dat @@ -1209,8 +1209,8 @@ prosrc => 'bytea_int8' }, { oid => '6510', descr => 'convert uuid to bytea', - proname => 'bytea', prorettype => 'bytea', proargtypes => 'uuid', - prosrc => 'uuid_bytea' }, + proname => 'bytea', proleakproof => 't', prorettype => 'bytea', + proargtypes => 'uuid', prosrc => 'uuid_bytea' }, { oid => '6511', descr => 'convert bytea to uuid', proname => 'uuid', prorettype => 'uuid', proargtypes => 'bytea', prosrc => 'bytea_uuid' }, diff --git a/src/test/regress/expected/opr_sanity.out b/src/test/regress/expected/opr_sanity.out index cfdc6b1a17a..4083bdd3216 100644 --- a/src/test/regress/expected/opr_sanity.out +++ b/src/test/regress/expected/opr_sanity.out @@ -887,6 +887,7 @@ oid8le(oid8,oid8) oid8gt(oid8,oid8) oid8ge(oid8,oid8) btoid8cmp(oid8,oid8) +bytea(uuid) tid_block(tid) tid_offset(tid) -- Check that functions without argument are not marked as leakproof. -- 2.50.1 (Apple Git-155)