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 EXIT out of outermost block in plpgsql.
Date: Mon, 13 Sep 2021 16:42:40 +0000
Message-ID: <E1mPp2W-0004g1-Ip@gemulon.postgresql.org> (raw)

Fix EXIT out of outermost block in plpgsql.

Ordinarily, using EXIT this way would draw "control reached end of
function without RETURN".  However, if the function is one where we
don't require an explicit RETURN (such as a DO block), that should
not happen.  It did anyway, because add_dummy_return() neglected to
account for the case.

Per report from Herwig Goemans.  Back-patch to all supported branches.

Discussion: https://postgr.es/m/868ae948-e3ca-c7ec-95a6-83cfc08ef750@gmail.com

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4ffd3fe4d6ccc9ff36271e5a21ea3b065621b982

Modified Files
--------------
src/pl/plpgsql/src/expected/plpgsql_control.out | 11 +++++++++++
src/pl/plpgsql/src/pl_comp.c                    |  6 ++++--
src/pl/plpgsql/src/sql/plpgsql_control.sql      | 12 ++++++++++++
3 files changed, 27 insertions(+), 2 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1mPp2W-0004g1-Ip@gemulon.postgresql.org>
Permalink:  ../E1mPp2W-0004g1-Ip@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mPp2W-0004g1-Ip@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 EXIT out of outermost block in plpgsql.
  In-Reply-To: <E1mPp2W-0004g1-Ip@gemulon.postgresql.org>
  References: <E1mPp2W-0004g1-Ip@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