Commit 5fc4c26
committed
Allow FDWs to push down quals without breaking EvalPlanQual rechecks.
This fixes a long-standing bug which was discovered while investigating
the interaction between the new join pushdown code and the EvalPlanQual
machinery: if a ForeignScan appears on the inner side of a paramaterized
nestloop, an EPQ recheck would re-return the original tuple even if
it no longer satisfied the pushed-down quals due to changed parameter
values.
This fix adds a new member to ForeignScan and ForeignScanState and a
new argument to make_foreignscan, and requires changes to FDWs which
push down quals to populate that new argument with a list of quals they
have chosen to push down. Therefore, I'm only back-patching to 9.5,
even though the bug is not new in 9.5.
Etsuro Fujita, reviewed by me and by Kyotaro Horiguchi.1 parent 817588b commit 5fc4c26
File tree
13 files changed
+71
-13
lines changed- contrib
- file_fdw
- postgres_fdw
- doc/src/sgml
- src
- backend
- executor
- nodes
- optimizer/plan
- include
- nodes
- optimizer
13 files changed
+71
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
563 | 563 | | |
564 | 564 | | |
565 | 565 | | |
566 | | - | |
| 566 | + | |
| 567 | + | |
567 | 568 | | |
568 | 569 | | |
569 | 570 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| 751 | + | |
751 | 752 | | |
752 | 753 | | |
753 | 754 | | |
| |||
769 | 770 | | |
770 | 771 | | |
771 | 772 | | |
772 | | - | |
773 | | - | |
| 773 | + | |
| 774 | + | |
774 | 775 | | |
775 | 776 | | |
776 | 777 | | |
| |||
784 | 785 | | |
785 | 786 | | |
786 | 787 | | |
| 788 | + | |
787 | 789 | | |
| 790 | + | |
| 791 | + | |
788 | 792 | | |
789 | 793 | | |
790 | 794 | | |
| 795 | + | |
791 | 796 | | |
| 797 | + | |
| 798 | + | |
792 | 799 | | |
793 | 800 | | |
794 | 801 | | |
| |||
874 | 881 | | |
875 | 882 | | |
876 | 883 | | |
877 | | - | |
| 884 | + | |
| 885 | + | |
878 | 886 | | |
879 | 887 | | |
880 | 888 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1135 | 1135 | | |
1136 | 1136 | | |
1137 | 1137 | | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1138 | 1147 | | |
1139 | 1148 | | |
1140 | 1149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
75 | | - | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
| |||
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
138 | 153 | | |
139 | 154 | | |
140 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
| 651 | + | |
651 | 652 | | |
652 | 653 | | |
653 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
594 | 594 | | |
595 | 595 | | |
596 | 596 | | |
| 597 | + | |
597 | 598 | | |
598 | 599 | | |
599 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1798 | 1798 | | |
1799 | 1799 | | |
1800 | 1800 | | |
| 1801 | + | |
1801 | 1802 | | |
1802 | 1803 | | |
1803 | 1804 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2153 | 2153 | | |
2154 | 2154 | | |
2155 | 2155 | | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
2156 | 2159 | | |
2157 | 2160 | | |
2158 | 2161 | | |
| |||
3738 | 3741 | | |
3739 | 3742 | | |
3740 | 3743 | | |
3741 | | - | |
| 3744 | + | |
| 3745 | + | |
3742 | 3746 | | |
3743 | 3747 | | |
3744 | 3748 | | |
| |||
3754 | 3758 | | |
3755 | 3759 | | |
3756 | 3760 | | |
| 3761 | + | |
3757 | 3762 | | |
3758 | 3763 | | |
3759 | 3764 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1133 | 1133 | | |
1134 | 1134 | | |
1135 | 1135 | | |
1136 | | - | |
| 1136 | + | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | 1140 | | |
1141 | 1141 | | |
1142 | 1142 | | |
| 1143 | + | |
| 1144 | + | |
1143 | 1145 | | |
1144 | 1146 | | |
1145 | 1147 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2394 | 2394 | | |
2395 | 2395 | | |
2396 | 2396 | | |
2397 | | - | |
2398 | | - | |
2399 | | - | |
2400 | | - | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
2401 | 2409 | | |
2402 | 2410 | | |
2403 | 2411 | | |
| |||
0 commit comments