----------------- * ExecEndWindowAgg * ----------------- */
| 2892 | * ----------------- |
| 2893 | */ |
| 2894 | void |
| 2895 | ExecEndWindowAgg(WindowAggState *node) |
| 2896 | { |
| 2897 | PlanState *outerPlan; |
| 2898 | int i; |
| 2899 | |
| 2900 | release_partition(node); |
| 2901 | |
| 2902 | ExecClearTuple(node->ss.ss_ScanTupleSlot); |
| 2903 | ExecClearTuple(node->first_part_slot); |
| 2904 | ExecClearTuple(node->agg_row_slot); |
| 2905 | ExecClearTuple(node->temp_slot_1); |
| 2906 | ExecClearTuple(node->temp_slot_2); |
| 2907 | if (node->framehead_slot) |
| 2908 | ExecClearTuple(node->framehead_slot); |
| 2909 | if (node->frametail_slot) |
| 2910 | ExecClearTuple(node->frametail_slot); |
| 2911 | |
| 2912 | /* |
| 2913 | * Free both the expr contexts. |
| 2914 | */ |
| 2915 | ExecFreeExprContext(&node->ss.ps); |
| 2916 | node->ss.ps.ps_ExprContext = node->tmpcontext; |
| 2917 | ExecFreeExprContext(&node->ss.ps); |
| 2918 | |
| 2919 | for (i = 0; i < node->numaggs; i++) |
| 2920 | { |
| 2921 | if (node->peragg[i].aggcontext != node->aggcontext) |
| 2922 | MemoryContextDelete(node->peragg[i].aggcontext); |
| 2923 | } |
| 2924 | MemoryContextDelete(node->partcontext); |
| 2925 | MemoryContextDelete(node->aggcontext); |
| 2926 | |
| 2927 | pfree(node->perfunc); |
| 2928 | pfree(node->peragg); |
| 2929 | |
| 2930 | outerPlan = outerPlanState(node); |
| 2931 | ExecEndNode(outerPlan); |
| 2932 | } |
| 2933 | |
| 2934 | /* ----------------- |
| 2935 | * ExecReScanWindowAgg |
no test coverage detected