]> granicus.if.org Git - postgresql/blobdiff - src/backend/optimizer/util/clauses.c
Fix an oversight I made in a cleanup patch over a year ago:
[postgresql] / src / backend / optimizer / util / clauses.c
index 95e5077d38cd5d9a3081252a221a36ef27c38580..2322ec8c509de13fe7a2f84fde6b3f7dcabc68b0 100644 (file)
@@ -8,7 +8,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.256 2008/03/25 22:42:43 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/optimizer/util/clauses.c,v 1.257 2008/04/01 00:48:33 tgl Exp $
  *
  * HISTORY
  *       AUTHOR                        DATE                    MAJOR EVENT
@@ -1687,16 +1687,22 @@ rowtype_field_matches(Oid rowtypeid, int fieldnum,
  * We assume that the tree has already been type-checked and contains
  * only operators and functions that are reasonable to try to execute.
  *
+ * NOTE: "root" can be passed as NULL if the caller never wants to do any
+ * Param substitutions.
+ *
  * NOTE: the planner assumes that this will always flatten nested AND and
  * OR clauses into N-argument form.  See comments in prepqual.c.
  *--------------------
  */
 Node *
-eval_const_expressions(Node *node)
+eval_const_expressions(PlannerInfo *root, Node *node)
 {
        eval_const_expressions_context context;
 
-       context.boundParams = NULL; /* don't use any bound params */
+       if (root)
+               context.boundParams = root->glob->boundParams;  /* bound Params */
+       else
+               context.boundParams = NULL;
        context.active_fns = NIL;       /* nothing being recursively simplified */
        context.case_val = NULL;        /* no CASE being examined */
        context.estimate = false;       /* safe transformations only */