mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Fix for select 1=1 or 2=2, select 1=1 and 2=2, and select sum(2+2).
This commit is contained in:
@ -534,6 +534,19 @@ ExecInitAgg(Agg *node, EState *estate, Plan *parent)
|
||||
outerPlan = outerPlan(node);
|
||||
ExecInitNode(outerPlan, estate, (Plan *) node);
|
||||
|
||||
/*
|
||||
* Result runs in its own context, but make it use our aggregates
|
||||
* fix for 'select sum(2+2)'
|
||||
*/
|
||||
if (nodeTag(outerPlan) == T_Result)
|
||||
{
|
||||
((Result *)outerPlan)->resstate->cstate.cs_ProjInfo->pi_exprContext->ecxt_values =
|
||||
econtext->ecxt_values;
|
||||
((Result *)outerPlan)->resstate->cstate.cs_ProjInfo->pi_exprContext->ecxt_nulls =
|
||||
econtext->ecxt_nulls;
|
||||
}
|
||||
|
||||
|
||||
/* ----------------
|
||||
* initialize tuple type.
|
||||
* ----------------
|
||||
|
Reference in New Issue
Block a user