forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbe3d900
committed
Fix run-time partition pruning code to handle NULL values properly.
The previous coding just ignored pruning constraints that compare apartition key to a null-valued expression. This is silly, since reallywhat we can do there is conclude that all partitions are rejected: thepruning operator is known strict so the comparison must always fail.This also fixes the logic to not ignore constisnull for a Const comparisonvalue. That's probably an unreachable case, since the planner wouldnormally have simplified away a strict operator with a constant-null input.But this code has no business assuming that.David Rowley, per a gripe from meDiscussion:https://postgr.es/m/26279.1528670981@sss.pgh.pa.us1 parent387543f commitbe3d900
File tree
3 files changed
+53
-13
lines changed- src
- backend/partitioning
- test/regress
- expected
- sql
3 files changed
+53
-13
lines changedLines changed: 35 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
173 |
| - | |
| 173 | + | |
| 174 | + | |
174 | 175 |
| |
175 | 176 |
| |
176 | 177 |
| |
| |||
184 | 185 |
| |
185 | 186 |
| |
186 | 187 |
| |
187 |
| - | |
188 |
| - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
189 | 191 |
| |
190 | 192 |
| |
191 | 193 |
| |
| |||
2835 | 2837 |
| |
2836 | 2838 |
| |
2837 | 2839 |
| |
| 2840 | + | |
2838 | 2841 |
| |
2839 | 2842 |
| |
2840 | 2843 |
| |
2841 | 2844 |
| |
2842 |
| - | |
| 2845 | + | |
| 2846 | + | |
2843 | 2847 |
| |
2844 | 2848 |
| |
2845 | 2849 |
| |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
2846 | 2867 |
| |
2847 | 2868 |
| |
2848 | 2869 |
| |
| |||
3072 | 3093 |
| |
3073 | 3094 |
| |
3074 | 3095 |
| |
3075 |
| - | |
3076 |
| - | |
| 3096 | + | |
| 3097 | + | |
3077 | 3098 |
| |
3078 | 3099 |
| |
3079 | 3100 |
| |
| |||
3082 | 3103 |
| |
3083 | 3104 |
| |
3084 | 3105 |
| |
3085 |
| - | |
| 3106 | + | |
| 3107 | + | |
3086 | 3108 |
| |
3087 | 3109 |
| |
3088 | 3110 |
| |
3089 |
| - | |
| 3111 | + | |
| 3112 | + | |
| 3113 | + | |
| 3114 | + | |
| 3115 | + | |
3090 | 3116 |
| |
3091 | 3117 |
| |
3092 | 3118 |
| |
| |||
3105 | 3131 |
| |
3106 | 3132 |
| |
3107 | 3133 |
| |
3108 |
| - | |
3109 | 3134 |
| |
3110 | 3135 |
| |
3111 | 3136 |
| |
3112 |
| - | |
3113 |
| - | |
3114 |
| - | |
3115 |
| - | |
| 3137 | + | |
3116 | 3138 |
| |
3117 | 3139 |
| |
3118 | 3140 |
| |
|
Lines changed: 14 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2731 | 2731 |
| |
2732 | 2732 |
| |
2733 | 2733 |
| |
| 2734 | + | |
| 2735 | + | |
| 2736 | + | |
| 2737 | + | |
| 2738 | + | |
| 2739 | + | |
| 2740 | + | |
| 2741 | + | |
| 2742 | + | |
| 2743 | + | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
| 2747 | + | |
2734 | 2748 |
| |
2735 | 2749 |
| |
2736 | 2750 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
685 | 685 |
| |
686 | 686 |
| |
687 | 687 |
| |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
688 | 692 |
| |
689 | 693 |
| |
690 | 694 |
| |
|
0 commit comments
Comments
(0)