]> granicus.if.org Git - postgresql/commit
Prevent inlining a SQL function with multiple OUT parameters.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 1 Dec 2010 05:53:34 +0000 (00:53 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 1 Dec 2010 05:53:34 +0000 (00:53 -0500)
commit0d45e8c560793aa4c4b278a0ce7c002735f37ea5
tree0af110ce31afe17aecf2ebacde02a17e25c0b3a0
parent301a822aa0d4c066da06f5d2979699edc14ec0fa
Prevent inlining a SQL function with multiple OUT parameters.

There were corner cases in which the planner would attempt to inline such
a function, which would result in a failure at runtime due to loss of
information about exactly what the result record type is.  Fix by disabling
inlining when the function's recorded result type is RECORD.  There might
be some sub-cases where inlining could still be allowed, but this is a
simple and backpatchable fix, so leave refinements for another day.
Per bug #5777 from Nate Carson.

Back-patch to all supported branches.  8.1 happens to avoid a core-dump
here, but it still does the wrong thing.
src/backend/executor/functions.c
src/backend/optimizer/util/clauses.c
src/test/regress/expected/rangefuncs.out
src/test/regress/sql/rangefuncs.sql