forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfeeb526
committed
Fix ExecOpenScanRelation to take a lock on a ROW_MARK_COPY relation.
ExecOpenScanRelation assumed that any relation listed in the ExecRowMarklist has been locked by InitPlan; but this is not true if the rel'smarkType is ROW_MARK_COPY, which is possible if it's a foreign table.In most (possibly all) cases, failure to acquire a lock here isn't reallyproblematic because the parser, planner, or plancache would have taken theappropriate lock already. In principle though it might leave us vulnerableto working with a relation that we hold no lock on, and in any case if theexecutor isn't depending on previously-taken locks otherwise then it shouldnot do so for ROW_MARK_COPY relations.Noted by Etsuro Fujita. Back-patch to all active versions, since theinconsistency has been there a long time. (It's almost certainlyirrelevant in 9.0, since that predates foreign tables, but the code'sstill wrong on its own terms.)1 parente5f455f commitfeeb526
2 files changed
+7
-1
lines changedLines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
817 | 817 |
| |
818 | 818 |
| |
819 | 819 |
| |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
820 | 824 |
| |
821 | 825 |
| |
822 | 826 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
820 | 820 |
| |
821 | 821 |
| |
822 | 822 |
| |
823 |
| - | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
824 | 826 |
| |
825 | 827 |
| |
826 | 828 |
| |
|
0 commit comments
Comments
(0)