pgsql: Fix EXIT out of outermost block in plpgsql.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix EXIT out of outermost block in plpgsql.
Date: 2021-09-13 16:42:40
Message-ID: E1mPp2W-0004gA-K8@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/bdd6ce48d0356fbfaa0fe4a1fee20068f99abb70

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-09-13 18:27:07 pgsql: Doc: improve documentation of CREATE/ALTER SUBSCRIPTION.
Previous Message Bruce Momjian 2021-09-13 14:42:47 pgsql: doc: fix PG 14 release note typo