diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2008-04-01 00:48:33 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2008-04-01 00:48:33 +0000 |
| commit | 6b73d7e5676298fe7891014adc56a0a32c807117 (patch) | |
| tree | 698fa8db400ab8082d35826c9861fa6b711feb57 /src/backend/optimizer/path | |
| parent | d344115519a5c88bfa8bf8551258f4eaaa1185be (diff) | |
Fix an oversight I made in a cleanup patch over a year ago:
eval_const_expressions needs to be passed the PlannerInfo ("root") structure,
because in some cases we want it to substitute values for Param nodes.
(So "constant" is not so constant as all that ...) This mistake partially
disabled optimization of unnamed extended-Query statements in 8.3: in
particular the LIKE-to-indexscan optimization would never be applied if the
LIKE pattern was passed as a parameter, and constraint exclusion depending
on a parameter value didn't work either.
Diffstat (limited to 'src/backend/optimizer/path')
| -rw-r--r-- | src/backend/optimizer/path/allpaths.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c index adbf95b31de..e6728f39fe4 100644 --- a/src/backend/optimizer/path/allpaths.c +++ b/src/backend/optimizer/path/allpaths.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.169 2008/03/24 21:53:03 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.170 2008/04/01 00:48:33 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -205,7 +205,7 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte) * set_append_rel_pathlist(). */ if (rel->reloptkind == RELOPT_BASEREL && - relation_excluded_by_constraints(rel, rte)) + relation_excluded_by_constraints(root, rel, rte)) { set_dummy_rel_pathlist(rel); return; @@ -321,7 +321,7 @@ set_append_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, adjust_appendrel_attrs((Node *) rel->baserestrictinfo, appinfo); - if (relation_excluded_by_constraints(childrel, childRTE)) + if (relation_excluded_by_constraints(root, childrel, childRTE)) { /* * This child need not be scanned, so we can omit it from the |
