]> granicus.if.org Git - postgresql/commit
Fix a bug introduced when set-returning SQL functions were made inline-able:
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Dec 2009 02:16:04 +0000 (02:16 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Dec 2009 02:16:04 +0000 (02:16 +0000)
commite5fddc52902f565f55f68df9f08ad0c1f62e8190
tree76ed3e82af21c4278f82cd3afff8a9cfce2aa3de
parente2668636ca5e306c213eef52082a6e2ed1246608
Fix a bug introduced when set-returning SQL functions were made inline-able:
we have to cope with the possibility that the declared result rowtype contains
dropped columns.  This fails in 8.4, as per bug #5240.

While at it, be more paranoid about inserting binary coercions when inlining.
The pre-8.4 code did not really need to worry about that because it could not
inline at all in any case where an added coercion could change the behavior
of the function's statement.  However, when inlining a SRF we allow sorting,
grouping, and set-ops such as UNION.  In these cases, modifying one of the
targetlist entries that the sort/group/setop depends on could conceivably
change the behavior of the function's statement --- so don't inline when
such a case applies.
src/backend/catalog/pg_proc.c
src/backend/executor/execQual.c
src/backend/executor/functions.c
src/backend/optimizer/util/clauses.c
src/include/executor/functions.h
src/test/regress/expected/rangefuncs.out
src/test/regress/sql/rangefuncs.sql