]> granicus.if.org Git - postgresql/commitdiff
Fix oversight in new EvalPlanQual logic: the second loop over the ExecRowMark
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 28 Jul 2010 17:21:56 +0000 (17:21 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 28 Jul 2010 17:21:56 +0000 (17:21 +0000)
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.

src/backend/executor/nodeLockRows.c

index d573853eba9fdf69ad7e2cea33271a9131267f94..a84b64b0952e28d5034e0ed68b47be20de4c524a 100644 (file)
@@ -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 */