pgsql: Mop-up for letting VOID-returning SQL functions end with a SELEC

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Mop-up for letting VOID-returning SQL functions end with a SELEC
Date: 2018-03-16 16:48:27
Message-ID: E1ewsWp-00035S-P7@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Mop-up for letting VOID-returning SQL functions end with a SELECT.

Part of the intent in commit fd1a421fe was to allow SQL functions that are
declared to return VOID to contain anything, including an unrelated final
SELECT, the same as SQL-language procedures can. However, the planner's
inlining logic didn't get that memo. Fix it, and add some regression tests
covering this area, since evidently we had none.

In passing, clean up some typos in comments in create_function_3.sql,
and get rid of its none-too-safe assumption that DROP CASCADE notice
output is immutably ordered.

Per report from Prabhat Sahu.

Discussion: https://postgr.es/m/CANEvxPqxAj6nNHVcaXxpTeEFPmh24Whu+23emgjiuKrhJSct0A@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/877cdf11eaa9cabcb9b1e3c1bef0760fe08efdc3

Modified Files
--------------
src/backend/optimizer/util/clauses.c | 25 +++++--
src/test/regress/expected/create_function_3.out | 90 +++++++++++++++++++------
src/test/regress/sql/create_function_3.sql | 48 +++++++++++--
3 files changed, 130 insertions(+), 33 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2018-03-16 17:28:05 pgsql: Simplify parse representation of savepoint commands
Previous Message David Steele 2018-03-16 13:36:36 Re: pgsql: Add tests for reinit.c