aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2008-04-01 00:48:44 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2008-04-01 00:48:44 +0000
commite3a47483a20936b8d5c642904d623d5786f47b44 (patch)
tree1945aa3b1991a3ee1f3c4881e25738d9cdfef324 /src/backend/utils/cache/relcache.c
parentf82277c80de04a340b77daf930643af54b81400c (diff)
downloadpostgresql-e3a47483a20936b8d5c642904d623d5786f47b44.tar.gz
postgresql-e3a47483a20936b8d5c642904d623d5786f47b44.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/relcache.c')
-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 4c3669dfe81..e15a929d62c 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.266.2.1 2008/02/27 17:44:27 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.266.2.2 2008/04/01 00:48:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -3078,7 +3078,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
@@ -3148,7 +3148,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);