---------------------------------------------------------------- * ExecIndexMarkPos * * Note: we assume that no caller attempts to set a mark before having read * at least one tuple. Otherwise, iss_ScanDesc might still be NULL. * ---------------------------------------------------------------- */
| 835 | * ---------------------------------------------------------------- |
| 836 | */ |
| 837 | void |
| 838 | ExecIndexMarkPos(IndexScanState *node) |
| 839 | { |
| 840 | EState *estate = node->ss.ps.state; |
| 841 | EPQState *epqstate = estate->es_epq_active; |
| 842 | |
| 843 | if (epqstate != NULL) |
| 844 | { |
| 845 | /* |
| 846 | * We are inside an EvalPlanQual recheck. If a test tuple exists for |
| 847 | * this relation, then we shouldn't access the index at all. We would |
| 848 | * instead need to save, and later restore, the state of the |
| 849 | * relsubs_done flag, so that re-fetching the test tuple is possible. |
| 850 | * However, given the assumption that no caller sets a mark at the |
| 851 | * start of the scan, we can only get here with relsubs_done[i] |
| 852 | * already set, and so no state need be saved. |
| 853 | */ |
| 854 | Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid; |
| 855 | |
| 856 | Assert(scanrelid > 0); |
| 857 | if (epqstate->relsubs_slot[scanrelid - 1] != NULL || |
| 858 | epqstate->relsubs_rowmark[scanrelid - 1] != NULL) |
| 859 | { |
| 860 | /* Verify the claim above */ |
| 861 | if (!epqstate->relsubs_done[scanrelid - 1]) |
| 862 | elog(ERROR, "unexpected ExecIndexMarkPos call in EPQ recheck"); |
| 863 | return; |
| 864 | } |
| 865 | } |
| 866 | |
| 867 | index_markpos(node->iss_ScanDesc); |
| 868 | } |
| 869 | |
| 870 | /* ---------------------------------------------------------------- |
| 871 | * ExecIndexRestrPos |
no test coverage detected