forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit64d926f
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 parent728c497 commit64d926f
File tree
4 files changed
+68
-15
lines changed- src
- backend/executor
- test/regress
- expected
- sql
4 files changed
+68
-15
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2375 | 2375 |
| |
2376 | 2376 |
| |
2377 | 2377 |
| |
2378 |
| - | |
| 2378 | + | |
2379 | 2379 |
| |
2380 | 2380 |
| |
2381 | 2381 |
| |
|
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3959 | 3959 |
| |
3960 | 3960 |
| |
3961 | 3961 |
| |
| 3962 | + | |
| 3963 | + | |
| 3964 | + | |
| 3965 | + | |
| 3966 | + | |
| 3967 | + | |
| 3968 | + | |
| 3969 | + | |
| 3970 | + | |
| 3971 | + | |
| 3972 | + | |
| 3973 | + | |
| 3974 | + | |
| 3975 | + | |
| 3976 | + | |
| 3977 | + | |
| 3978 | + | |
| 3979 | + | |
| 3980 | + | |
| 3981 | + | |
| 3982 | + | |
| 3983 | + | |
| 3984 | + | |
| 3985 | + | |
| 3986 | + | |
| 3987 | + | |
| 3988 | + | |
| 3989 | + | |
| 3990 | + | |
| 3991 | + | |
| 3992 | + | |
| 3993 | + | |
| 3994 | + | |
| 3995 | + | |
3962 | 3996 |
| |
3963 | 3997 |
| |
3964 | 3998 |
| |
|
Lines changed: 14 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1782 | 1782 |
| |
1783 | 1783 |
| |
1784 | 1784 |
| |
1785 |
| - | |
1786 |
| - | |
| 1785 | + | |
| 1786 | + | |
1787 | 1787 |
| |
1788 | 1788 |
| |
1789 |
| - | |
1790 |
| - | |
1791 |
| - | |
1792 |
| - | |
1793 |
| - | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
1794 | 1794 |
| |
1795 | 1795 |
| |
1796 | 1796 |
| |
1797 |
| - | |
1798 |
| - | |
| 1797 | + | |
| 1798 | + | |
1799 | 1799 |
| |
1800 | 1800 |
| |
1801 | 1801 |
| |
1802 | 1802 |
| |
1803 | 1803 |
| |
1804 | 1804 |
| |
1805 |
| - | |
1806 |
| - | |
1807 |
| - | |
1808 |
| - | |
1809 |
| - | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
1810 | 1810 |
| |
1811 | 1811 |
| |
1812 | 1812 |
| |
|
Lines changed: 19 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1813 | 1813 |
| |
1814 | 1814 |
| |
1815 | 1815 |
| |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
1816 | 1835 |
| |
1817 | 1836 |
| |
1818 | 1837 |
| |
|
0 commit comments
Comments
(0)