diff options
Diffstat (limited to 'src/backend/executor/nodeIndexscan.c')
-rw-r--r-- | src/backend/executor/nodeIndexscan.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/backend/executor/nodeIndexscan.c b/src/backend/executor/nodeIndexscan.c index ac7aa81f674..c06d07aa467 100644 --- a/src/backend/executor/nodeIndexscan.c +++ b/src/backend/executor/nodeIndexscan.c @@ -827,25 +827,27 @@ void ExecIndexMarkPos(IndexScanState *node) { EState *estate = node->ss.ps.state; + EPQState *epqstate = estate->es_epq_active; - if (estate->es_epqTupleSlot != NULL) + if (epqstate != NULL) { /* * We are inside an EvalPlanQual recheck. If a test tuple exists for * this relation, then we shouldn't access the index at all. We would * instead need to save, and later restore, the state of the - * es_epqScanDone flag, so that re-fetching the test tuple is - * possible. However, given the assumption that no caller sets a mark - * at the start of the scan, we can only get here with es_epqScanDone + * relsubs_done flag, so that re-fetching the test tuple is possible. + * However, given the assumption that no caller sets a mark at the + * start of the scan, we can only get here with relsubs_done[i] * already set, and so no state need be saved. */ Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid; Assert(scanrelid > 0); - if (estate->es_epqTupleSlot[scanrelid - 1] != NULL) + if (epqstate->relsubs_slot[scanrelid - 1] != NULL || + epqstate->relsubs_rowmark[scanrelid - 1] != NULL) { /* Verify the claim above */ - if (!estate->es_epqScanDone[scanrelid - 1]) + if (!epqstate->relsubs_done[scanrelid - 1]) elog(ERROR, "unexpected ExecIndexMarkPos call in EPQ recheck"); return; } @@ -862,17 +864,19 @@ void ExecIndexRestrPos(IndexScanState *node) { EState *estate = node->ss.ps.state; + EPQState *epqstate = estate->es_epq_active; - if (estate->es_epqTupleSlot != NULL) + if (estate->es_epq_active != NULL) { /* See comments in ExecIndexMarkPos */ Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid; Assert(scanrelid > 0); - if (estate->es_epqTupleSlot[scanrelid - 1] != NULL) + if (epqstate->relsubs_slot[scanrelid - 1] != NULL || + epqstate->relsubs_rowmark[scanrelid - 1] != NULL) { /* Verify the claim above */ - if (!estate->es_epqScanDone[scanrelid - 1]) + if (!epqstate->relsubs_done[scanrelid - 1]) elog(ERROR, "unexpected ExecIndexRestrPos call in EPQ recheck"); return; } |