MCPcopy Create free account
hub / github.com/apache/cloudberry / ExecEndNode

Function ExecEndNode

src/backend/executor/execProcnode.c:790–1071  ·  view source on GitHub ↗

---------------------------------------------------------------- * 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. * ---------------------------------------------------------------- *

Source from the content-addressed store, hash-verified

788 * ----------------------------------------------------------------
789 */
790void
791ExecEndNode(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);

Callers 15

ExecEndPlanFunction · 0.85
EvalPlanQualEndFunction · 0.85
ExecEndSetOpFunction · 0.85
ExecEndShareInputScanFunction · 0.85
ExecEndUniqueFunction · 0.85
ExecEndMotionFunction · 0.85
ExecEndMergeJoinFunction · 0.85
ExecEndRuntimeFilterFunction · 0.85
ExecEndWindowAggFunction · 0.85
ExecEndBitmapOrFunction · 0.85
ExecEndAssertOpFunction · 0.85

Calls 15

check_stack_depthFunction · 0.85
bms_freeFunction · 0.85
ExecEndResultFunction · 0.85
ExecEndProjectSetFunction · 0.85
ExecEndModifyTableFunction · 0.85
ExecEndAppendFunction · 0.85
ExecEndMergeAppendFunction · 0.85
ExecEndRecursiveUnionFunction · 0.85
ExecEndSequenceFunction · 0.85
ExecEndBitmapAndFunction · 0.85
ExecEndBitmapOrFunction · 0.85
ExecEndSeqScanFunction · 0.85

Tested by

no test coverage detected