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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't crash on empty statements in SQL-standard function bodies.
Date: 2021-06-08 15:59:40
Message-ID: E1lqe8i-0003vO-W5@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tomas Vondra 2021-06-08 17:38:53 pgsql: Fix pg_visibility regression failure with CLOBBER_CACHE_ALWAYS
Previous Message Tom Lane 2021-06-08 14:57:55 pgsql: Fix contrib/seg regression test in v11.