From fed8dcdb84d255088d22efa3156a193f3399e792 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 12 Jan 2011 20:47:09 -0500 Subject: Fix PlanRowMark/ExecRowMark structures to handle inheritance correctly. In an inherited UPDATE/DELETE, each target table has its own subplan, because it might have a column set different from other targets. This means that the resjunk columns we add to support EvalPlanQual might be at different physical column numbers in each subplan. The EvalPlanQual rewrite I did for 9.0 failed to account for this, resulting in possible misbehavior or even crashes during concurrent updates to the same row, as seen in a recent report from Gordon Shannon. Revise the data structure so that we track resjunk column numbers separately for each subplan. I also chose to move responsibility for identifying the physical column numbers back to executor startup, instead of assuming that numbers derived during preprocess_targetlist would stay valid throughout subsequent massaging of the plan. That's a bit slower, so we might want to consider undoing it someday; but it would complicate the patch considerably and didn't seem justifiable in a bug fix that has to be back-patched to 9.0. --- src/backend/nodes/outfuncs.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/backend/nodes/outfuncs.c') diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 030a675b7b6..032150e1bb7 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -759,9 +759,6 @@ _outPlanRowMark(StringInfo str, PlanRowMark *node) WRITE_ENUM_FIELD(markType, RowMarkType); WRITE_BOOL_FIELD(noWait); WRITE_BOOL_FIELD(isParent); - WRITE_INT_FIELD(ctidAttNo); - WRITE_INT_FIELD(toidAttNo); - WRITE_INT_FIELD(wholeAttNo); } static void -- cgit v1.2.3