From: Vadim B. Mikheev Date: Thu, 19 Feb 1998 04:47:07 +0000 (+0000) Subject: Fix for InitPlan-s: have to copy subselect' result tuple. X-Git-Tag: REL6_3~116 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed875a4132c0d72269cdeda2538c155ea23ace6d;p=postgresql Fix for InitPlan-s: have to copy subselect' result tuple. --- diff --git a/src/backend/executor/nodeSubplan.c b/src/backend/executor/nodeSubplan.c index 610f0a0964..3c5560d13b 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)]);