---------------------------------------------------------------- * ExecEndForeignScan * * frees any storage allocated through C routines. * ---------------------------------------------------------------- */
| 308 | * ---------------------------------------------------------------- |
| 309 | */ |
| 310 | void |
| 311 | ExecEndForeignScan(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 |
no test coverage detected