diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-15 03:07:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2007-02-15 03:07:13 +0000 |
commit | bfe553fb49f00ef74021ca044794f27c13511342 (patch) | |
tree | 8e174f5148ef80fe44316d949748093b89e638a5 /src/backend/executor/nodeResult.c | |
parent | d19da98a7fd082f3369c4c8aa20a4b861400eed5 (diff) | |
download | postgresql-bfe553fb49f00ef74021ca044794f27c13511342.tar.gz postgresql-bfe553fb49f00ef74021ca044794f27c13511342.zip |
Repair oversight in 8.2 change that improved the handling of "pseudoconstant"
WHERE clauses. createplan.c is now willing to stick a gating Result node
almost anywhere in the plan tree, and in particular one can wind up directly
underneath a MergeJoin node. This means it had better be willing to handle
Mark/Restore. Fortunately, that's trivial in such cases, since we can just
pass off the call to the input node (which the planner has previously ensured
can handle Mark/Restore). Per report from Phil Frost.
Diffstat (limited to 'src/backend/executor/nodeResult.c')
-rw-r--r-- | src/backend/executor/nodeResult.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/src/backend/executor/nodeResult.c b/src/backend/executor/nodeResult.c index 9765103cbe2..2d20079569f 100644 --- a/src/backend/executor/nodeResult.c +++ b/src/backend/executor/nodeResult.c @@ -38,7 +38,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/executor/nodeResult.c,v 1.37 2007/02/02 00:07:03 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/executor/nodeResult.c,v 1.38 2007/02/15 03:07:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -167,6 +167,36 @@ ExecResult(ResultState *node) } /* ---------------------------------------------------------------- + * ExecResultMarkPos + * ---------------------------------------------------------------- + */ +void +ExecResultMarkPos(ResultState *node) +{ + PlanState *outerPlan = outerPlanState(node); + + if (outerPlan != NULL) + ExecMarkPos(outerPlan); + else + elog(DEBUG2, "Result nodes do not support mark/restore"); +} + +/* ---------------------------------------------------------------- + * ExecResultRestrPos + * ---------------------------------------------------------------- + */ +void +ExecResultRestrPos(ResultState *node) +{ + PlanState *outerPlan = outerPlanState(node); + + if (outerPlan != NULL) + ExecRestrPos(outerPlan); + else + elog(ERROR, "Result nodes do not support mark/restore"); +} + +/* ---------------------------------------------------------------- * ExecInitResult * * Creates the run-time state information for the result node @@ -180,8 +210,8 @@ ExecInitResult(Result *node, EState *estate, int eflags) ResultState *resstate; /* check for unsupported flags */ - Assert(!(eflags & EXEC_FLAG_MARK)); - Assert(!(eflags & EXEC_FLAG_BACKWARD) || outerPlan(node) != NULL); + Assert(!(eflags & (EXEC_FLAG_MARK | EXEC_FLAG_BACKWARD)) || + outerPlan(node) != NULL); /* * create state structure |