* Project the result of a group (whose aggs have already been calculated by * finalize_aggregates). Returns the result slot, or NULL if no row is * projected (suppressed by qual). */
| 1420 | * projected (suppressed by qual). |
| 1421 | */ |
| 1422 | static TupleTableSlot * |
| 1423 | project_aggregates(AggState *aggstate) |
| 1424 | { |
| 1425 | ExprContext *econtext = aggstate->ss.ps.ps_ExprContext; |
| 1426 | |
| 1427 | /* |
| 1428 | * Check the qual (HAVING clause); if the group does not match, ignore it. |
| 1429 | */ |
| 1430 | if (ExecQual(aggstate->ss.ps.qual, econtext)) |
| 1431 | { |
| 1432 | /* |
| 1433 | * Form and return projection tuple using the aggregate results and |
| 1434 | * the representative input tuple. |
| 1435 | */ |
| 1436 | return ExecProject(aggstate->ss.ps.ps_ProjInfo); |
| 1437 | } |
| 1438 | else |
| 1439 | InstrCountFiltered1(aggstate, 1); |
| 1440 | |
| 1441 | return NULL; |
| 1442 | } |
| 1443 | |
| 1444 | /* |
| 1445 | * Find input-tuple columns that are needed, dividing them into |
no test coverage detected