aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeSubqueryscan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-05-08 19:47:02 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-05-08 19:47:02 +0000
commit5708a56729dcf4d75feb6cdb8c9ffb45147738e9 (patch)
tree22c2b62d1e0fc5117780de826d154bb7bd424e31 /src/backend/executor/nodeSubqueryscan.c
parentc3fa600d8cb773d032f199990455eaab0ead5c0c (diff)
downloadpostgresql-5708a56729dcf4d75feb6cdb8c9ffb45147738e9.tar.gz
postgresql-5708a56729dcf4d75feb6cdb8c9ffb45147738e9.zip
Append and SubqueryScan nodes were not passing changed-parameter signals down
to their children, leading to misbehavior if they had any children that paid attention to chgParam (most plan node types don't). Append's bug has been there a long time, but nobody had noticed because it used to be difficult to create a query where an Append would be used below the top level of a plan; so there were never any parameters getting passed down. SubqueryScan is new in 7.1 ... and I'd modeled its behavior on Append :-(
Diffstat (limited to 'src/backend/executor/nodeSubqueryscan.c')
-rw-r--r--src/backend/executor/nodeSubqueryscan.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/backend/executor/nodeSubqueryscan.c b/src/backend/executor/nodeSubqueryscan.c
index 54dec2d1eec..5eb0af0352c 100644
--- a/src/backend/executor/nodeSubqueryscan.c
+++ b/src/backend/executor/nodeSubqueryscan.c
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/executor/nodeSubqueryscan.c,v 1.6 2001/03/22 06:16:13 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/executor/nodeSubqueryscan.c,v 1.7 2001/05/08 19:47:02 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -267,7 +267,18 @@ ExecSubqueryReScan(SubqueryScan *node, ExprContext *exprCtxt, Plan *parent)
return;
}
- ExecReScan(node->subplan, NULL, node->subplan);
+ /*
+ * ExecReScan doesn't know about my subplan, so I have to do
+ * changed-parameter signaling myself.
+ */
+ if (node->scan.plan.chgParam != NULL)
+ SetChangedParamList(node->subplan, node->scan.plan.chgParam);
+ /*
+ * if chgParam of subnode is not null then plan will be re-scanned by
+ * first ExecProcNode.
+ */
+ if (node->subplan->chgParam == NULL)
+ ExecReScan(node->subplan, NULL, node->subplan);
subquerystate->csstate.css_ScanTupleSlot = NULL;
}