---------------------------------------------------------------- * ExecEndIndexScan * ---------------------------------------------------------------- */
| 785 | * ---------------------------------------------------------------- |
| 786 | */ |
| 787 | void |
| 788 | ExecEndIndexScan(IndexScanState *node) |
| 789 | { |
| 790 | Relation indexRelationDesc; |
| 791 | IndexScanDesc indexScanDesc; |
| 792 | |
| 793 | /* |
| 794 | * extract information from the node |
| 795 | */ |
| 796 | indexRelationDesc = node->iss_RelationDesc; |
| 797 | indexScanDesc = node->iss_ScanDesc; |
| 798 | |
| 799 | /* |
| 800 | * Free the exprcontext(s) ... now dead code, see ExecFreeExprContext |
| 801 | * |
| 802 | * GPDB: This is not dead code in GPDB, because we don't want to leak |
| 803 | * exprcontexts in a dynamic index scan. |
| 804 | */ |
| 805 | #if 1 |
| 806 | ExecFreeExprContext(&node->ss.ps); |
| 807 | if (node->iss_RuntimeContext) |
| 808 | { |
| 809 | FreeExprContext(node->iss_RuntimeContext, true); |
| 810 | node->iss_RuntimeContext = NULL; |
| 811 | } |
| 812 | #endif |
| 813 | |
| 814 | /* |
| 815 | * clear out tuple table slots |
| 816 | */ |
| 817 | if (node->ss.ps.ps_ResultTupleSlot) |
| 818 | ExecClearTuple(node->ss.ps.ps_ResultTupleSlot); |
| 819 | ExecClearTuple(node->ss.ss_ScanTupleSlot); |
| 820 | |
| 821 | /* |
| 822 | * close the index relation (no-op if we didn't open it) |
| 823 | */ |
| 824 | if (indexScanDesc) |
| 825 | index_endscan(node->iss_ScanDesc); |
| 826 | if (indexRelationDesc) |
| 827 | index_close(indexRelationDesc, NoLock); |
| 828 | } |
| 829 | |
| 830 | /* ---------------------------------------------------------------- |
| 831 | * ExecIndexMarkPos |
no test coverage detected