forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitca08ea5
committed
Fix usage of whole-row variables in WCO and RLS policy expressions.
Since WITH CHECK OPTION was introduced, ExecInitModifyTable hasinitialized WCO expressions with the wrong plan node as parent -- that is,it passed its input subplan not the ModifyTable node itself. Up to nowwe thought this was harmless, but bug #16006 from Vinay Banakar shows it'snot: if the input node is a SubqueryScan then ExecInitWholeRowVar can getconfused into doing the wrong thing. (The fact that ExecInitWholeRowVarcontains such logic is certainly a horrid kluge that doesn't deserve tolive, but figuring out another way to do that is a task for some other day.)Andres had already noticed the wrong-parent mistake and fixed it in commit148e632, but not being aware of any user-visible consequences, he quitereasonably didn't back-patch. This patch is simply a back-patch of148e632, plus addition of a test case based on bug #16006. I also addedthe test case to v12/HEAD, even though the bug is already fixed there.Back-patch to all supported branches. 9.4 lacks RLS policies so thenew test case doesn't work there, but I'm pretty sure a test could bedevised based on using a whole-row Var in a plain WITH CHECK OPTIONcondition. (I lack the cycles to do so myself, though.)Andres Freund and Tom LaneDiscussion:https://postgr.es/m/16006-99290d2e4642cbd5@postgresql.orgDiscussion:https://postgr.es/m/20181205225213.hiwa3kgoxeybqcqv@alap3.anarazel.de1 parent1f705e6 commitca08ea5
File tree
2 files changed
+15
-15
lines changed- src
- backend/executor
- test/regress/expected
2 files changed
+15
-15
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1198 | 1198 |
| |
1199 | 1199 |
| |
1200 | 1200 |
| |
1201 |
| - | |
| 1201 | + | |
1202 | 1202 |
| |
1203 | 1203 |
| |
1204 | 1204 |
| |
|
Lines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1604 | 1604 |
| |
1605 | 1605 |
| |
1606 | 1606 |
| |
1607 |
| - | |
1608 |
| - | |
| 1607 | + | |
| 1608 | + | |
1609 | 1609 |
| |
1610 | 1610 |
| |
1611 |
| - | |
1612 |
| - | |
1613 |
| - | |
1614 |
| - | |
1615 |
| - | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
1616 | 1616 |
| |
1617 | 1617 |
| |
1618 | 1618 |
| |
1619 |
| - | |
1620 |
| - | |
| 1619 | + | |
| 1620 | + | |
1621 | 1621 |
| |
1622 | 1622 |
| |
1623 | 1623 |
| |
1624 | 1624 |
| |
1625 | 1625 |
| |
1626 | 1626 |
| |
1627 |
| - | |
1628 |
| - | |
1629 |
| - | |
1630 |
| - | |
1631 |
| - | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1632 | 1632 |
| |
1633 | 1633 |
| |
1634 | 1634 |
| |
|
0 commit comments
Comments
(0)