]> granicus.if.org Git - postgresql/commit
Mop-up for letting VOID-returning SQL functions end with a SELECT.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Mar 2018 16:48:13 +0000 (12:48 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 16 Mar 2018 16:48:13 +0000 (12:48 -0400)
commit877cdf11eaa9cabcb9b1e3c1bef0760fe08efdc3
tree4f385e2eabbc6c4e67cd78c5b99f924bc64a28a5
parent84a3611cccfa41f29d14a5b1ab4bcc58fba9b25b
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
src/backend/optimizer/util/clauses.c
src/test/regress/expected/create_function_3.out
src/test/regress/sql/create_function_3.sql