]> 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:15:54 +0000 (02:15 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 14 Dec 2009 02:15:54 +0000 (02:15 +0000)
commita620d5005df6e4b6fc09ba914f19402dc07289dd
treec7213f3647c9b6600ed3d95e352790d8ae0f7744
parent84f910a7076e09e551bf69e0972473ec15d33c79
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