* finalize_grouping_exprs - * Scan the given expression tree for GROUPING() and related calls, * and validate and process their arguments. * * This is split out from check_ungrouped_columns above because it needs * to modify the nodes (which it does in-place, not via a mutator) while * check_ungrouped_columns may see only a copy of the original thanks to * flattening of join alias vars.
| 1544 | * GROUPING argument as we see it before comparing it. |
| 1545 | */ |
| 1546 | static void |
| 1547 | finalize_grouping_exprs(Node *node, ParseState *pstate, Query *qry, |
| 1548 | List *groupClauses, bool hasJoinRTEs, |
| 1549 | bool have_non_var_grouping) |
| 1550 | { |
| 1551 | check_ungrouped_columns_context context; |
| 1552 | |
| 1553 | context.pstate = pstate; |
| 1554 | context.qry = qry; |
| 1555 | context.hasJoinRTEs = hasJoinRTEs; |
| 1556 | context.groupClauses = groupClauses; |
| 1557 | context.groupClauseCommonVars = NIL; |
| 1558 | context.have_non_var_grouping = have_non_var_grouping; |
| 1559 | context.func_grouped_rels = NULL; |
| 1560 | context.sublevels_up = 0; |
| 1561 | context.in_agg_direct_args = false; |
| 1562 | finalize_grouping_exprs_walker(node, &context); |
| 1563 | } |
| 1564 | |
| 1565 | static bool |
| 1566 | finalize_grouping_exprs_walker(Node *node, |
no test coverage detected