Commit 77c75076 authored by Tom Lane's avatar Tom Lane

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.
parent 2dbbda02
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* *
* *
* IDENTIFICATION * 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: ...@@ -195,6 +195,13 @@ lnext:
HeapTupleData tuple; HeapTupleData tuple;
Buffer buffer; 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) if (EvalPlanQualGetTuple(&node->lr_epqstate, erm->rti) != NULL)
continue; /* it was updated and fetched above */ continue; /* it was updated and fetched above */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment