aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/selfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-03-10 16:23:40 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2016-03-10 16:23:52 -0500
commitc82c92b111b7b636e80f8a432de10c62011b35b6 (patch)
treecf0accbfe09768c55fbd19b41707f5b2c0d835af /src/backend/utils/adt/selfuncs.c
parentfd31cd265138019dcccc9b5fe53043670898bc9f (diff)
downloadpostgresql-c82c92b111b7b636e80f8a432de10c62011b35b6.tar.gz
postgresql-c82c92b111b7b636e80f8a432de10c62011b35b6.zip
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.
Diffstat (limited to 'src/backend/utils/adt/selfuncs.c')
-rw-r--r--src/backend/utils/adt/selfuncs.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index 6e75a39bf3f..d396ef142f9 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -3329,6 +3329,7 @@ estimate_num_groups(PlannerInfo *root, List *groupExprs, double input_rows,
*/
varshere = pull_var_clause(groupexpr,
PVC_RECURSE_AGGREGATES |
+ PVC_RECURSE_WINDOWFUNCS |
PVC_RECURSE_PLACEHOLDERS);
/*