fix calls to build_aggregate_fnexprs in nodeWindowAgg
authorTomas Vondra <[email protected]>
Wed, 9 Nov 2016 14:38:31 +0000 (15:38 +0100)
committerTomas Vondra <[email protected]>
Wed, 9 Nov 2016 14:38:31 +0000 (15:38 +0100)
But it's as broken as nodeAgg.c.

src/backend/executor/nodeWindowAgg.c

index 064ab4ac0215c8a3c00946ceabcfca21c74d9dd0..7c8259dc01b70b1b35efbbc3512f790b213f132d 100644 (file)
@@ -2240,29 +2240,21 @@ initialize_peragg(WindowAggState *winstate, WindowFunc *wfunc,
                                                                                           numArguments);
 
        /* build expression trees using actual argument & result types */
-       build_aggregate_fnexprs(inputTypes,
-                                                       numArguments,
-                                                       0,      /* no ordered-set window functions yet */
-                                                       peraggstate->numFinalArgs,
-                                                       false,          /* no variadic window functions yet */
-                                                       aggtranstype,
-#ifdef XCP
-                                                       aggcollecttype,
-#endif
-                                                       wfunc->wintype,
-                                                       wfunc->inputcollid,
-                                                       transfn_oid,
-#ifdef XCP
-                                                       collectfn_oid,
-#endif
-                                                       invtransfn_oid,
-                                                       finalfn_oid,
-                                                       &transfnexpr,
-                                                       &invtransfnexpr,
-#ifdef XCP
-                                                       &collectfnexpr,
-#endif
-                                                       &finalfnexpr);
+
+       /* build expression trees using actual argument & result types */
+       build_aggregate_transfn_expr(inputTypes,
+                                                                numArguments,
+                                                                0,             /* no ordered-set window functions yet */
+                                                                false, /* no variadic window functions yet */
+                                                                aggtranstype,
+                                                                aggcollecttype,
+                                                                wfunc->inputcollid,
+                                                                transfn_oid,
+                                                                collectfn_oid,
+                                                                invtransfn_oid,
+                                                                &transfnexpr,
+                                                                &invtransfnexpr,
+                                                                &collectfnexpr);
 
        /* set up infrastructure for calling the transfn(s) and finalfn */
        fmgr_info(transfn_oid, &peraggstate->transfn);