Commit ed875a41 authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

Fix for InitPlan-s: have to copy subselect' result tuple.

parent 015593fd
...@@ -95,6 +95,9 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext) ...@@ -95,6 +95,9 @@ ExecSubPlan(SubPlan *node, List *pvar, ExprContext *econtext)
break; break;
} }
if ( !found && sublink->subLinkType == ALL_SUBLINK )
return ((Datum) true);
return ((Datum) result); return ((Datum) result);
} }
...@@ -193,6 +196,15 @@ ExecSetParamPlan (SubPlan *node) ...@@ -193,6 +196,15 @@ ExecSetParamPlan (SubPlan *node)
break; 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) foreach (lst, node->setParam)
{ {
ParamExecData *prm = &(plan->state->es_param_exec_vals[lfirsti(lst)]); ParamExecData *prm = &(plan->state->es_param_exec_vals[lfirsti(lst)]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment