aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeLockRows.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-07-28 17:21:56 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-07-28 17:21:56 +0000
commit77c75076f3f49ef19b5e59eae531f1836613ed56 (patch)
treec84eddf2986ed0df48888973aeb94d1a7d3548ba /src/backend/executor/nodeLockRows.c
parent2dbbda02e7e688311e161a912a0ce00cde9bb6fc (diff)
downloadpostgresql-77c75076f3f49ef19b5e59eae531f1836613ed56.tar.gz
postgresql-77c75076f3f49ef19b5e59eae531f1836613ed56.zip
Fix oversight in new EvalPlanQual logic: the second loop over the ExecRowMark
list in ExecLockRows() forgot to allow for the possibility that some of the rowmarks are for child tables that aren't relevant to the current row. Per report from Kenichiro Tanaka.
Diffstat (limited to 'src/backend/executor/nodeLockRows.c')
-rw-r--r--src/backend/executor/nodeLockRows.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/backend/executor/nodeLockRows.c b/src/backend/executor/nodeLockRows.c
index d573853eba9..a84b64b0952 100644
--- a/src/backend/executor/nodeLockRows.c
+++ b/src/backend/executor/nodeLockRows.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/executor/nodeLockRows.c,v 1.5 2010/07/12 17:01:05 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/executor/nodeLockRows.c,v 1.6 2010/07/28 17:21:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -195,6 +195,13 @@ lnext:
HeapTupleData tuple;
Buffer buffer;
+ /* ignore non-active child tables */
+ if (!ItemPointerIsValid(&(erm->curCtid)))
+ {
+ Assert(erm->rti != erm->prti); /* check it's child table */
+ continue;
+ }
+
if (EvalPlanQualGetTuple(&node->lr_epqstate, erm->rti) != NULL)
continue; /* it was updated and fetched above */