1
0
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:
Bruce Momjian
1997-12-22 05:42:25 +00:00
parent 78a055a659
commit d404f1006b
10 changed files with 69 additions and 56 deletions

View File

@ -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.
* ----------------