]> granicus.if.org Git - postgresql/commit
Give pull_var_clause() reject/recurse/return behavior for WindowFuncs too.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 10 Mar 2016 21:23:40 +0000 (16:23 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 10 Mar 2016 21:23:52 +0000 (16:23 -0500)
commitc82c92b111b7b636e80f8a432de10c62011b35b6
treecf0accbfe09768c55fbd19b41707f5b2c0d835af
parentfd31cd265138019dcccc9b5fe53043670898bc9f
Give pull_var_clause() reject/recurse/return behavior for WindowFuncs too.

All along, this function should have treated WindowFuncs in a manner
similar to Aggrefs, ie with an option whether or not to recurse into them.
By not considering the case, it was always recursing, which is OK for most
callers (although I suspect that the case in prepare_sort_from_pathkeys
might represent a bug).  But now we need return-without-recursing behavior
as well.  There are also more than a few callers that should never see a
WindowFunc, and now we'll get some error checking on that.
src/backend/optimizer/path/equivclass.c
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/initsplan.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/prep/preptlist.c
src/backend/optimizer/util/placeholder.c
src/backend/optimizer/util/var.c
src/backend/utils/adt/selfuncs.c
src/include/optimizer/var.h