From 1d97c19a0f748e94b9582dcbaec33ad74be062f9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 19 Apr 2009 19:46:33 +0000 Subject: Fix estimate_num_groups() to not fail on PlaceHolderVars, per report from Stefan Kaltenbrunner. The most reasonable behavior (at least for the near term) seems to be to ignore the PlaceHolderVar and examine its argument instead. In support of this, change the API of pull_var_clause() to allow callers to request recursion into PlaceHolderVars. Currently estimate_num_groups() is the only customer for that behavior, but where there's one there may be others. --- src/backend/optimizer/util/tlist.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/optimizer/util/tlist.c') diff --git a/src/backend/optimizer/util/tlist.c b/src/backend/optimizer/util/tlist.c index 5cf2839b37e..9526aefd9ac 100644 --- a/src/backend/optimizer/util/tlist.c +++ b/src/backend/optimizer/util/tlist.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/util/tlist.c,v 1.85 2009/01/01 17:23:45 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/util/tlist.c,v 1.86 2009/04/19 19:46:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -91,7 +91,8 @@ tlist_member_ignore_relabel(Node *node, List *targetlist) List * flatten_tlist(List *tlist) { - List *vlist = pull_var_clause((Node *) tlist, true); + List *vlist = pull_var_clause((Node *) tlist, + PVC_INCLUDE_PLACEHOLDERS); List *new_tlist; new_tlist = add_to_flat_tlist(NIL, vlist); -- cgit v1.2.3