forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitec0925c
Fix ENABLE/DISABLE TRIGGER to handle recursion correctly
Using ATSimpleRecursion() in ATPrepCmd() to do so asbbb927b did isnot correct, because ATPrepCmd() can't distinguish between triggers thatmay be cloned and those that may not, so would wrongly try to recursefor the latter category of triggers.So this commit restores the code in EnableDisableTrigger() that86f5759 had added to do the recursion, which would do it only fortriggers that may be cloned, that is, row-level triggers. This alsochanges tablecmds.c such that ATExecCmd() is able to pass the value ofONLY flag down to EnableDisableTrigger() using its new 'recurse'parameter.This also fixes what seems like an oversight of86f5759 that therecursion to partition triggers would only occur if EnableDisableTrigger()had actually changed the trigger. It is more apt to recurse to inspectpartition triggers even if the parent's trigger didn't need to bechanged: only then can we be certain that all descendants share the samestate afterwards.Backpatch all the way back to 11, likebbb927b. Care is taken notto break ABI compatibility (and that no catversion bump is needed.)Co-authored-by: Amit Langote <amitlangote09@gmail.com>Reviewed-by: Dmitry Koval <d.koval@postgrespro.ru>Discussion:https://postgr.es/m/CA+HiwqG-cZT3XzGAnEgZQLoQbyfJApVwOTQaCaas1mhpf+4V5A@mail.gmail.com1 parentd2e1508 commitec0925c
File tree
6 files changed
+117
-34
lines changed- src
- backend/commands
- include
- commands
- nodes
- test/regress
- expected
- sql
6 files changed
+117
-34
lines changedLines changed: 44 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
580 | 580 |
| |
581 | 581 |
| |
582 | 582 |
| |
583 |
| - | |
| 583 | + | |
| 584 | + | |
584 | 585 |
| |
585 | 586 |
| |
586 | 587 |
| |
| |||
4057 | 4058 |
| |
4058 | 4059 |
| |
4059 | 4060 |
| |
4060 |
| - | |
4061 |
| - | |
4062 |
| - | |
| 4061 | + | |
4063 | 4062 |
| |
4064 | 4063 |
| |
4065 | 4064 |
| |
4066 | 4065 |
| |
4067 | 4066 |
| |
4068 | 4067 |
| |
4069 | 4068 |
| |
| 4069 | + | |
| 4070 | + | |
| 4071 | + | |
| 4072 | + | |
| 4073 | + | |
| 4074 | + | |
4070 | 4075 |
| |
4071 | 4076 |
| |
4072 | 4077 |
| |
| |||
4487 | 4492 |
| |
4488 | 4493 |
| |
4489 | 4494 |
| |
4490 |
| - | |
4491 |
| - | |
4492 |
| - | |
4493 |
| - | |
| 4495 | + | |
| 4496 | + | |
| 4497 | + | |
| 4498 | + | |
4494 | 4499 |
| |
4495 | 4500 |
| |
4496 | 4501 |
| |
| |||
4777 | 4782 |
| |
4778 | 4783 |
| |
4779 | 4784 |
| |
4780 |
| - | |
4781 |
| - | |
| 4785 | + | |
| 4786 | + | |
| 4787 | + | |
4782 | 4788 |
| |
4783 | 4789 |
| |
4784 | 4790 |
| |
| |||
5119 | 5125 |
| |
5120 | 5126 |
| |
5121 | 5127 |
| |
5122 |
| - | |
| 5128 | + | |
| 5129 | + | |
| 5130 | + | |
5123 | 5131 |
| |
5124 | 5132 |
| |
5125 | 5133 |
| |
5126 |
| - | |
| 5134 | + | |
| 5135 | + | |
| 5136 | + | |
5127 | 5137 |
| |
5128 | 5138 |
| |
5129 | 5139 |
| |
5130 |
| - | |
| 5140 | + | |
| 5141 | + | |
| 5142 | + | |
5131 | 5143 |
| |
5132 | 5144 |
| |
5133 | 5145 |
| |
5134 |
| - | |
| 5146 | + | |
| 5147 | + | |
| 5148 | + | |
5135 | 5149 |
| |
5136 | 5150 |
| |
5137 | 5151 |
| |
5138 |
| - | |
| 5152 | + | |
| 5153 | + | |
| 5154 | + | |
5139 | 5155 |
| |
5140 | 5156 |
| |
5141 | 5157 |
| |
5142 |
| - | |
| 5158 | + | |
| 5159 | + | |
| 5160 | + | |
5143 | 5161 |
| |
5144 | 5162 |
| |
5145 | 5163 |
| |
5146 |
| - | |
| 5164 | + | |
| 5165 | + | |
| 5166 | + | |
5147 | 5167 |
| |
5148 | 5168 |
| |
5149 | 5169 |
| |
5150 |
| - | |
| 5170 | + | |
| 5171 | + | |
| 5172 | + | |
5151 | 5173 |
| |
5152 | 5174 |
| |
5153 | 5175 |
| |
| |||
14660 | 14682 |
| |
14661 | 14683 |
| |
14662 | 14684 |
| |
14663 |
| - | |
| 14685 | + | |
| 14686 | + | |
14664 | 14687 |
| |
14665 |
| - | |
| 14688 | + | |
| 14689 | + | |
14666 | 14690 |
| |
14667 | 14691 |
| |
14668 | 14692 |
| |
|
Lines changed: 31 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1752 | 1752 |
| |
1753 | 1753 |
| |
1754 | 1754 |
| |
| 1755 | + | |
1755 | 1756 |
| |
1756 | 1757 |
| |
1757 | 1758 |
| |
1758 | 1759 |
| |
1759 | 1760 |
| |
1760 | 1761 |
| |
1761 | 1762 |
| |
1762 |
| - | |
| 1763 | + | |
| 1764 | + | |
1763 | 1765 |
| |
1764 | 1766 |
| |
1765 | 1767 |
| |
| |||
1825 | 1827 |
| |
1826 | 1828 |
| |
1827 | 1829 |
| |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
1828 | 1858 |
| |
1829 | 1859 |
| |
1830 | 1860 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
174 |
| - | |
| 174 | + | |
| 175 | + | |
175 | 176 |
| |
176 | 177 |
| |
177 | 178 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2328 | 2328 |
| |
2329 | 2329 |
| |
2330 | 2330 |
| |
| 2331 | + | |
2331 | 2332 |
| |
2332 | 2333 |
| |
2333 | 2334 |
| |
|
Lines changed: 29 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2681 | 2681 |
| |
2682 | 2682 |
| |
2683 | 2683 |
| |
| 2684 | + | |
| 2685 | + | |
2684 | 2686 |
| |
2685 | 2687 |
| |
2686 | 2688 |
| |
2687 |
| - | |
2688 |
| - | |
2689 |
| - | |
2690 |
| - | |
2691 |
| - | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
| 2694 | + | |
2692 | 2695 |
| |
2693 |
| - | |
| 2696 | + | |
| 2697 | + | |
2694 | 2698 |
| |
2695 | 2699 |
| |
2696 | 2700 |
| |
2697 |
| - | |
2698 |
| - | |
2699 |
| - | |
2700 |
| - | |
2701 |
| - | |
| 2701 | + | |
| 2702 | + | |
| 2703 | + | |
| 2704 | + | |
| 2705 | + | |
| 2706 | + | |
| 2707 | + | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
| 2711 | + | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
| 2715 | + | |
| 2716 | + | |
| 2717 | + | |
| 2718 | + | |
| 2719 | + | |
2702 | 2720 |
| |
2703 | 2721 |
| |
2704 | 2722 |
| |
|
Lines changed: 10 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1865 | 1865 |
| |
1866 | 1866 |
| |
1867 | 1867 |
| |
| 1868 | + | |
| 1869 | + | |
1868 | 1870 |
| |
1869 | 1871 |
| |
1870 | 1872 |
| |
1871 |
| - | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
1872 | 1881 |
| |
1873 | 1882 |
| |
1874 | 1883 |
| |
|
0 commit comments
Comments
(0)