---------------------------------------------------------------- * ExecEndNode * * Recursively cleans up all the nodes in the plan rooted * at 'node'. * * After this operation, the query plan will not be able to be * processed any further. This should be called only after * the query plan has been fully executed. * ---------------------------------------------------------------- *
| 788 | * ---------------------------------------------------------------- |
| 789 | */ |
| 790 | void |
| 791 | ExecEndNode(PlanState *node) |
| 792 | { |
| 793 | /* |
| 794 | * do nothing when we get to the end of a leaf on tree. |
| 795 | */ |
| 796 | if (node == NULL) |
| 797 | return; |
| 798 | |
| 799 | /* |
| 800 | * Make sure there's enough stack available. Need to check here, in |
| 801 | * addition to ExecProcNode() (via ExecProcNodeFirst()), because it's not |
| 802 | * guaranteed that ExecProcNode() is reached for all nodes. |
| 803 | */ |
| 804 | check_stack_depth(); |
| 805 | |
| 806 | if (node->chgParam != NULL) |
| 807 | { |
| 808 | bms_free(node->chgParam); |
| 809 | node->chgParam = NULL; |
| 810 | } |
| 811 | |
| 812 | /* Free EXPLAIN ANALYZE buffer */ |
| 813 | if (node->cdbexplainbuf) |
| 814 | { |
| 815 | if (node->cdbexplainbuf->data) |
| 816 | pfree(node->cdbexplainbuf->data); |
| 817 | pfree(node->cdbexplainbuf); |
| 818 | node->cdbexplainbuf = NULL; |
| 819 | } |
| 820 | |
| 821 | switch (nodeTag(node)) |
| 822 | { |
| 823 | /* |
| 824 | * control nodes |
| 825 | */ |
| 826 | case T_ResultState: |
| 827 | ExecEndResult((ResultState *) node); |
| 828 | break; |
| 829 | |
| 830 | case T_ProjectSetState: |
| 831 | ExecEndProjectSet((ProjectSetState *) node); |
| 832 | break; |
| 833 | |
| 834 | case T_ModifyTableState: |
| 835 | ExecEndModifyTable((ModifyTableState *) node); |
| 836 | break; |
| 837 | |
| 838 | case T_AppendState: |
| 839 | ExecEndAppend((AppendState *) node); |
| 840 | break; |
| 841 | |
| 842 | case T_MergeAppendState: |
| 843 | ExecEndMergeAppend((MergeAppendState *) node); |
| 844 | break; |
| 845 | |
| 846 | case T_RecursiveUnionState: |
| 847 | ExecEndRecursiveUnion((RecursiveUnionState *) node); |
no test coverage detected