From d060e921ea5aa47b6265174c32e1128cebdbc3df Mon Sep 17 00:00:00 2001 From: Amit Langote Date: Thu, 28 Sep 2023 09:44:39 +0900 Subject: Remove obsolete executor cleanup code This commit removes unnecessary ExecExprFreeContext() calls in ExecEnd* routines because the actual cleanup is managed by FreeExecutorState(). With no callers remaining for ExecExprFreeContext(), this commit also removes the function. This commit also drops redundant ExecClearTuple() calls, because ExecResetTupleTable() in ExecEndPlan() already takes care of resetting and dropping all TupleTableSlots initialized with ExecInitScanTupleSlot() and ExecInitExtraTupleSlot(). After these modifications, the ExecEnd*() routines for ValuesScan, NamedTuplestoreScan, and WorkTableScan became redundant. So, this commit removes them. Reviewed-by: Robert Haas Discussion: https://postgr.es/m/CA+HiwqFGkMSge6TgC9KQzde0ohpAycLQuV7ooitEEpbKB0O_mg@mail.gmail.com --- src/backend/executor/nodeFunctionscan.c | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'src/backend/executor/nodeFunctionscan.c') diff --git a/src/backend/executor/nodeFunctionscan.c b/src/backend/executor/nodeFunctionscan.c index dd06ef8aee8..2dddbcda141 100644 --- a/src/backend/executor/nodeFunctionscan.c +++ b/src/backend/executor/nodeFunctionscan.c @@ -523,18 +523,6 @@ ExecEndFunctionScan(FunctionScanState *node) { int i; - /* - * Free the exprcontext - */ - ExecFreeExprContext(&node->ss.ps); - - /* - * clean out the tuple table - */ - if (node->ss.ps.ps_ResultTupleSlot) - ExecClearTuple(node->ss.ps.ps_ResultTupleSlot); - ExecClearTuple(node->ss.ss_ScanTupleSlot); - /* * Release slots and tuplestore resources */ @@ -542,9 +530,6 @@ ExecEndFunctionScan(FunctionScanState *node) { FunctionScanPerFuncState *fs = &node->funcstates[i]; - if (fs->func_slot) - ExecClearTuple(fs->func_slot); - if (fs->tstore != NULL) { tuplestore_end(node->funcstates[i].tstore); -- cgit v1.2.3