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

Function ExecEndForeignScan

src/backend/executor/nodeForeignscan.c:310–336  ·  view source on GitHub ↗

---------------------------------------------------------------- * ExecEndForeignScan * * frees any storage allocated through C routines. * ---------------------------------------------------------------- */

Source from the content-addressed store, hash-verified

308 * ----------------------------------------------------------------
309 */
310void
311ExecEndForeignScan(ForeignScanState *node)
312{
313 ForeignScan *plan = (ForeignScan *) node->ss.ps.plan;
314 EState *estate = node->ss.ps.state;
315
316 /* Let the FDW shut down */
317 if (plan->operation != CMD_SELECT)
318 {
319 if (estate->es_epq_active == NULL)
320 node->fdwroutine->EndDirectModify(node);
321 }
322 else
323 node->fdwroutine->EndForeignScan(node);
324
325 /* Shut down any outer plan. */
326 if (outerPlanState(node))
327 ExecEndNode(outerPlanState(node));
328
329 /* Free the exprcontext */
330 ExecFreeExprContext(&node->ss.ps);
331
332 /* clean out the tuple table */
333 if (node->ss.ps.ps_ResultTupleSlot)
334 ExecClearTuple(node->ss.ps.ps_ResultTupleSlot);
335 ExecClearTuple(node->ss.ss_ScanTupleSlot);
336}
337
338/* ----------------------------------------------------------------
339 * ExecReScanForeignScan

Callers 2

CleanupOnePartitionFunction · 0.85
ExecEndNodeFunction · 0.85

Calls 3

ExecEndNodeFunction · 0.85
ExecFreeExprContextFunction · 0.85
ExecClearTupleFunction · 0.85

Tested by

no test coverage detected