pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix missing error handling in plperl_sv_to_literal().
Date: Tue, 10 Nov 2026 21:33:04 +0000
Message-ID: <E1xQtSi-00000000Dvh-0de5@gemulon.postgresql.org> (raw)

Fix missing error handling in plperl_sv_to_literal().

This function should have logic to trap Postgres errors and
convert them to Perl croak(), but it was missing that.
We'd somehow managed not to notice, even though the case of
an error was tested, until commits daafcbd11 et al added more
complexity to the interaction of Postgres and Perl errors.
Even then it mostly worked, but a few PPC64 buildfarm animals
are showing failures that trace to this.  Alexander Lakhin
then found that the crash is repeatable on other platforms
if you repeat the test a few times.

This patch basically just copies-and-pastes the error handling
from plperl_spi_exec() into plperl_sv_to_literal().

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/209e8c88dcef5ed1c3105f52c04cfdbf83653337

Modified Files
--------------
src/pl/plperl/expected/plperl_util.out | 12 ++++-
src/pl/plperl/plperl.c                 | 88 ++++++++++++++++++++++++++--------
src/pl/plperl/sql/plperl_util.sql      |  4 ++
3 files changed, 83 insertions(+), 21 deletions(-)



view thread (6+ messages)  latest in thread

Message-ID: <E1xQtSi-00000000Dvh-0de5@gemulon.postgresql.org>
Permalink:  ../E1xQtSi-00000000Dvh-0de5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1xQtSi-00000000Dvh-0de5@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix missing error handling in plperl_sv_to_literal().
  In-Reply-To: <E1xQtSi-00000000Dvh-0de5@gemulon.postgresql.org>
  References: <E1xQtSi-00000000Dvh-0de5@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox