aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/executor/execUtils.c')
-rw-r--r--src/backend/executor/execUtils.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c
index 88ba16bc6da..0da8e53e816 100644
--- a/src/backend/executor/execUtils.c
+++ b/src/backend/executor/execUtils.c
@@ -805,20 +805,11 @@ ExecOpenScanRelation(EState *estate, Index scanrelid, int eflags)
lockmode = NoLock;
else
{
- ListCell *l;
+ /* Keep this check in sync with InitPlan! */
+ ExecRowMark *erm = ExecFindRowMark(estate, scanrelid, true);
- foreach(l, estate->es_rowMarks)
- {
- ExecRowMark *erm = lfirst(l);
-
- /* Keep this check in sync with InitPlan! */
- if (erm->rti == scanrelid &&
- erm->relation != NULL)
- {
- lockmode = NoLock;
- break;
- }
- }
+ if (erm != NULL && erm->relation != NULL)
+ lockmode = NoLock;
}
/* Open the relation and acquire lock as needed */