postgresql/src
Tom Lane 9548bee2b1 Make contain_volatile_functions/contain_mutable_functions look into SubLinks.
This change prevents us from doing inappropriate subquery flattening in
cases such as dangerous functions hidden inside a sub-SELECT in the
targetlist of another sub-SELECT.  That could result in unexpected behavior
due to multiple evaluations of a volatile function, as in a recent
complaint from Etienne Dube.  It's been questionable from the very
beginning whether these functions should look into subqueries (as noted in
their comments), and this case seems to provide proof that they should.

Because the new code only descends into SubLinks, not SubPlans or
InitPlans, the change only affects the planner's behavior during
prepjointree processing and not later on --- for example, you can still get
it to use a volatile function in an indexqual if you wrap the function in
(SELECT ...).  That's a historical behavior, for sure, but it's reasonable
given that the executor's evaluation rules for subplans don't depend on
whether there are volatile functions inside them.  In any case, we need to
constrain the behavioral change as narrowly as we can to make this
reasonable to back-patch.
2013-11-08 11:37:00 -05:00
..
backend Make contain_volatile_functions/contain_mutable_functions look into SubLinks. 2013-11-08 11:37:00 -05:00
bin Fix parsing of xlog file name in pg_receivexlog. 2013-11-04 10:59:02 +02:00
common pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
include Fix some odd behaviors when using a SQL-style simple GMT offset timezone. 2013-11-01 12:13:23 -04:00
interfaces Changed test case slightly so it doesn't have an unused typedef. 2013-11-03 15:39:55 +01:00
makefiles Revert "Backpatch pgxs vpath build and installation fixes." 2013-10-07 22:32:04 -04:00
pl Translation updates 2013-10-07 16:27:04 -04:00
port Stamp 9.3.1. 2013-10-07 23:17:38 -04:00
template Remove _FORTIFY_SOURCE 2012-10-10 21:42:38 -04:00
test Make contain_volatile_functions/contain_mutable_functions look into SubLinks. 2013-11-08 11:37:00 -05:00
timezone Fix some odd behaviors when using a SQL-style simple GMT offset timezone. 2013-11-01 12:13:23 -04:00
tools Minor spelling fixes 2013-06-01 10:18:59 -04:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:20:32 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Revert "Backpatch pgxs vpath build and installation fixes." 2013-10-07 22:32:04 -04:00
Makefile.shlib Add pkg-config files for libpq and ecpg libraries 2013-03-31 16:58:40 -04:00
nls-global.mk NLS: Use msgmerge --previous option 2012-12-13 23:12:12 -05:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00