* Like build_aggregate_transfn_expr, but creates an expression tree for the * combine function of an aggregate, rather than the transition function. */
| 2109 | * combine function of an aggregate, rather than the transition function. |
| 2110 | */ |
| 2111 | void |
| 2112 | build_aggregate_combinefn_expr(Oid agg_state_type, |
| 2113 | Oid agg_input_collation, |
| 2114 | Oid combinefn_oid, |
| 2115 | Expr **combinefnexpr) |
| 2116 | { |
| 2117 | Node *argp; |
| 2118 | List *args; |
| 2119 | FuncExpr *fexpr; |
| 2120 | |
| 2121 | /* combinefn takes two arguments of the aggregate state type */ |
| 2122 | argp = make_agg_arg(agg_state_type, agg_input_collation); |
| 2123 | |
| 2124 | args = list_make2(argp, argp); |
| 2125 | |
| 2126 | fexpr = makeFuncExpr(combinefn_oid, |
| 2127 | agg_state_type, |
| 2128 | args, |
| 2129 | InvalidOid, |
| 2130 | agg_input_collation, |
| 2131 | COERCE_EXPLICIT_CALL); |
| 2132 | /* combinefn is currently never treated as variadic */ |
| 2133 | *combinefnexpr = (Expr *) fexpr; |
| 2134 | } |
| 2135 | |
| 2136 | /* |
| 2137 | * Like build_aggregate_transfn_expr, but creates an expression tree for the |
no test coverage detected