diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-09 15:46:11 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-01-09 15:46:11 +0000 |
commit | d04db370720ece56ffcad54e46cf03483c742ebb (patch) | |
tree | f446fa524bfef45b5152575dc188e49c43ea0a25 /src/backend/executor/execQual.c | |
parent | d3706cb6d217bc9c4676541f2df32171ef6555a2 (diff) | |
download | postgresql-d04db370720ece56ffcad54e46cf03483c742ebb.tar.gz postgresql-d04db370720ece56ffcad54e46cf03483c742ebb.zip |
Arrange for function default arguments to be processed properly in expressions
that are set up for execution with ExecPrepareExpr rather than going through
the full planner process. By introducing an explicit notion of "expression
planning", this patch also lays a bit of groundwork for maybe someday
allowing sub-selects in standalone expressions.
Diffstat (limited to 'src/backend/executor/execQual.c')
-rw-r--r-- | src/backend/executor/execQual.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/executor/execQual.c b/src/backend/executor/execQual.c index ed53a62e383..f74a5da6b28 100644 --- a/src/backend/executor/execQual.c +++ b/src/backend/executor/execQual.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.240 2009/01/01 17:23:41 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.241 2009/01/09 15:46:10 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -45,7 +45,7 @@ #include "miscadmin.h" #include "nodes/makefuncs.h" #include "nodes/nodeFuncs.h" -#include "optimizer/planmain.h" +#include "optimizer/planner.h" #include "pgstat.h" #include "utils/acl.h" #include "utils/builtins.h" @@ -4794,10 +4794,11 @@ ExecInitExpr(Expr *node, PlanState *parent) * Plan tree context. * * This differs from ExecInitExpr in that we don't assume the caller is - * already running in the EState's per-query context. Also, we apply - * fix_opfuncids() to the passed expression tree to be sure it is ready - * to run. (In ordinary Plan trees the planner will have fixed opfuncids, - * but callers outside the executor will not have done this.) + * already running in the EState's per-query context. Also, we run the + * passed expression tree through expression_planner() to prepare it for + * execution. (In ordinary Plan trees the regular planning process will have + * made the appropriate transformations on expressions, but for standalone + * expressions this won't have happened.) */ ExprState * ExecPrepareExpr(Expr *node, EState *estate) @@ -4805,10 +4806,10 @@ ExecPrepareExpr(Expr *node, EState *estate) ExprState *result; MemoryContext oldcontext; - fix_opfuncids((Node *) node); - oldcontext = MemoryContextSwitchTo(estate->es_query_cxt); + node = expression_planner(node); + result = ExecInitExpr(node, NULL); MemoryContextSwitchTo(oldcontext); |