Commit 96c41d0
committed
Fix updating of two single links with linkprops at once (#8932)
Mutating a single link with link properties works by compiling the
actual expression that defines the value into the link table update,
and then copying that value into the table itself by (ab/re)using the
rewrite machinery.
The rewrite machinery uses a "policy_ctx", which uses one of the input
tables as part of the overlay instead of an output table. The
"policy_ctx" has its overlay tables copied before being updated, but
it does the copy "just in time", which means that you can sometimes
get away with depending on things added to the context *after* the
policy_ctx was created.
Of course, this only worked *once*, after which the copy had been
made. As a result there was a bug where an 'except' overlay wasn't
being applied when populating a single link.
Be more explicit about all this by populating *both* overlay tables.
Also, it turns out that we do depend on incorporating unrelated
changes made to the overlay tables during compilation (like if an
INSERT is happening nested inside other DML), so we need to explicitly
reapply the policy overlays to the main one. (There was an existing bug
caused by this that this change made appear more easily.)
Possibly also fix some other policy related issues, since the code is
shared, but I haven't tracked it down too much.1 parent d94f5e8 commit 96c41d0
File tree
4 files changed
+85
-10
lines changed- edb/pgsql/compiler
- tests
- schemas
4 files changed
+85
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
810 | 810 | | |
811 | 811 | | |
812 | 812 | | |
813 | | - | |
| 813 | + | |
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| |||
861 | 861 | | |
862 | 862 | | |
863 | 863 | | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
864 | 869 | | |
865 | 870 | | |
866 | 871 | | |
| |||
1192 | 1197 | | |
1193 | 1198 | | |
1194 | 1199 | | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
1195 | 1219 | | |
1196 | 1220 | | |
1197 | 1221 | | |
| |||
1752 | 1776 | | |
1753 | 1777 | | |
1754 | 1778 | | |
1755 | | - | |
| 1779 | + | |
1756 | 1780 | | |
1757 | 1781 | | |
1758 | 1782 | | |
| |||
1806 | 1830 | | |
1807 | 1831 | | |
1808 | 1832 | | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1809 | 1838 | | |
1810 | 1839 | | |
1811 | 1840 | | |
| |||
2704 | 2733 | | |
2705 | 2734 | | |
2706 | 2735 | | |
2707 | | - | |
2708 | | - | |
2709 | | - | |
2710 | | - | |
2711 | | - | |
2712 | | - | |
2713 | | - | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
2714 | 2745 | | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
2715 | 2750 | | |
2716 | 2751 | | |
2717 | 2752 | | |
| |||
2918 | 2953 | | |
2919 | 2954 | | |
2920 | 2955 | | |
2921 | | - | |
2922 | 2956 | | |
2923 | 2957 | | |
2924 | 2958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
794 | 794 | | |
795 | 795 | | |
796 | 796 | | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
797 | 809 | | |
798 | 810 | | |
799 | 811 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1794 | 1794 | | |
1795 | 1795 | | |
1796 | 1796 | | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
1797 | 1823 | | |
1798 | 1824 | | |
1799 | 1825 | | |
| |||
0 commit comments