-
- Downloads
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.
Showing
- src/backend/executor/execJunk.c 13 additions, 1 deletionsrc/backend/executor/execJunk.c
- src/backend/executor/execMain.c 82 additions, 25 deletionssrc/backend/executor/execMain.c
- src/backend/executor/nodeLockRows.c 26 additions, 25 deletionssrc/backend/executor/nodeLockRows.c
- src/backend/executor/nodeModifyTable.c 22 additions, 20 deletionssrc/backend/executor/nodeModifyTable.c
- src/backend/nodes/copyfuncs.c 0 additions, 3 deletionssrc/backend/nodes/copyfuncs.c
- src/backend/nodes/outfuncs.c 0 additions, 3 deletionssrc/backend/nodes/outfuncs.c
- src/backend/optimizer/plan/planner.c 0 additions, 8 deletionssrc/backend/optimizer/plan/planner.c
- src/backend/optimizer/prep/preptlist.c 2 additions, 15 deletionssrc/backend/optimizer/prep/preptlist.c
- src/backend/optimizer/prep/prepunion.c 0 additions, 4 deletionssrc/backend/optimizer/prep/prepunion.c
- src/include/executor/executor.h 7 additions, 3 deletionssrc/include/executor/executor.h
- src/include/nodes/execnodes.h 25 additions, 9 deletionssrc/include/nodes/execnodes.h
- src/include/nodes/plannodes.h 15 additions, 6 deletionssrc/include/nodes/plannodes.h
Loading
Please register or sign in to comment