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

Started by Tom Laneabout 5 years ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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: /messages/by-id/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(-)