Skip to content

Commit e4d495a

Browse files
committed
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.
1 parent a2164c2 commit e4d495a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/executor/nodeLockRows.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/nodeLockRows.c,v 1.4 2010/02/26 02:00:42 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/nodeLockRows.c,v 1.4.4.1 2010/07/28 17:22:03 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -195,6 +195,13 @@ ExecLockRows(LockRowsState *node)
195195
HeapTupleData tuple;
196196
Buffer buffer;
197197

198+
/* ignore non-active child tables */
199+
if (!ItemPointerIsValid(&(erm->curCtid)))
200+
{
201+
Assert(erm->rti != erm->prti); /* check it's child table */
202+
continue;
203+
}
204+
198205
if (EvalPlanQualGetTuple(&node->lr_epqstate, erm->rti) != NULL)
199206
continue; /* it was updated and fetched above */
200207

0 commit comments

Comments
 (0)