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: Don't crash on empty statements in SQL-standard function bodies.
Date: Tue, 08 Jun 2021 15:59:40 +0000
Message-ID: <E1lqe8i-0003vO-W5@gemulon.postgresql.org> (raw)

Don't crash on empty statements in SQL-standard function bodies.

gram.y should discard NULL pointers (empty statements) when
assembling a routine_body_stmt_list, as it does for other
sorts of statement lists.

Julien Rouhaud and Tom Lane, per report from Noah Misch.

Discussion: https://postgr.es/m/20210606044418.GA297923@rfd.leadboat.com

Branch
------
master

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

Modified Files
--------------
src/backend/parser/gram.y                       | 6 +++++-
src/test/regress/expected/create_function_3.out | 2 +-
src/test/regress/sql/create_function_3.sql      | 2 +-
3 files changed, 7 insertions(+), 3 deletions(-)



Message-ID: <E1lqe8i-0003vO-W5@gemulon.postgresql.org>
Permalink:  ../E1lqe8i-0003vO-W5@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1lqe8i-0003vO-W5@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: Don't crash on empty statements in SQL-standard function bodies.
  In-Reply-To: <E1lqe8i-0003vO-W5@gemulon.postgresql.org>
  References: <E1lqe8i-0003vO-W5@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