aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeIndexonlyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/nodeIndexonlyscan.c')
-rw-r--r--src/backend/executor/nodeIndexonlyscan.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/backend/executor/nodeIndexonlyscan.c b/src/backend/executor/nodeIndexonlyscan.c
index 652a9afc752..784486f0c80 100644
--- a/src/backend/executor/nodeIndexonlyscan.c
+++ b/src/backend/executor/nodeIndexonlyscan.c
@@ -420,25 +420,27 @@ void
ExecIndexOnlyMarkPos(IndexOnlyScanState *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 ExecIndexOnlyMarkPos call in EPQ recheck");
return;
}
@@ -455,17 +457,19 @@ void
ExecIndexOnlyRestrPos(IndexOnlyScanState *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 ExecIndexOnlyMarkPos */
+ /* See comments in ExecIndexMarkPos */
Index scanrelid = ((Scan *) node->ss.ps.plan)->scanrelid;
Assert(scanrelid > 0);
- if (estate->es_epqTupleSlot[scanrelid - 1])
+ 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 ExecIndexOnlyRestrPos call in EPQ recheck");
return;
}