aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-01 00:48:33 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-01 00:48:33 +0000
commit6b73d7e5676298fe7891014adc56a0a32c807117 (patch)
tree698fa8db400ab8082d35826c9861fa6b711feb57 /src/backend/utils/cache
parentd344115519a5c88bfa8bf8551258f4eaaa1185be (diff)
downloadpostgresql-6b73d7e5676298fe7891014adc56a0a32c807117.tar.gz
postgresql-6b73d7e5676298fe7891014adc56a0a32c807117.zip
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/utils/cache')
-rw-r--r--src/backend/utils/cache/relcache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 4b49099568a..9a32fd5845e 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.269 2008/03/26 21:10:39 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.270 2008/04/01 00:48:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3068,7 +3068,7 @@ RelationGetIndexExpressions(Relation relation)
* them to similarly-processed qual clauses, and may fail to detect valid
* matches without this. We don't bother with canonicalize_qual, however.
*/
- result = (List *) eval_const_expressions((Node *) result);
+ result = (List *) eval_const_expressions(NULL, (Node *) result);
/*
* Also mark any coercion format fields as "don't care", so that the
@@ -3138,7 +3138,7 @@ RelationGetIndexPredicate(Relation relation)
* stuff involving subqueries, however, since we don't allow any in index
* predicates.)
*/
- result = (List *) eval_const_expressions((Node *) result);
+ result = (List *) eval_const_expressions(NULL, (Node *) result);
result = (List *) canonicalize_qual((Expr *) result);