aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeSubplan.c
diff options
context:
space:
mode:
authorVadim B. Mikheev <vadim4o@yahoo.com>1998-02-19 04:47:07 +0000
committerVadim B. Mikheev <vadim4o@yahoo.com>1998-02-19 04:47:07 +0000
commited875a4132c0d72269cdeda2538c155ea23ace6d (patch)
tree3ea53b874412eeb357eeffd4fe786db23e65115f /src/backend/executor/nodeSubplan.c
parent015593fd00b0be704a5395711207b206b11fbe81 (diff)
downloadpostgresql-ed875a4132c0d72269cdeda2538c155ea23ace6d.tar.gz
postgresql-ed875a4132c0d72269cdeda2538c155ea23ace6d.zip
Fix for InitPlan-s: have to copy subselect' result tuple.
Diffstat (limited to 'src/backend/executor/nodeSubplan.c')
-rw-r--r--src/backend/executor/nodeSubplan.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c
index 610f0a09643..3c5560d13bd 100644
--- a/src/backend/executor/nodeSubplan.c
+++ b/src/backend/executor/nodeSubplan.c
@@ -95,6 +95,9 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext)
break;
}
+ if ( !found && sublink->subLinkType == ALL_SUBLINK )
+ return ((Datum) true);
+
return ((Datum) result);
}
@@ -193,6 +196,15 @@ ExecSetParamPlan (SubPlan *node)
break;
}
+ /*
+ * If this is uncorrelated subquery then its plan will be closed
+ * (see below) and this tuple will be free-ed - bad for not byval
+ * types... But is free-ing possible in the next ExecProcNode in
+ * this loop ? Who knows... Someday we'll keep track of saved
+ * tuples...
+ */
+ tup = heap_copytuple (tup);
+
foreach (lst, node->setParam)
{
ParamExecData *prm = &(plan->state->es_param_exec_vals[lfirsti(lst)]);