forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit54a9406
committed
Do not return NULL for error cases in satisfies_hash_partition().
Since this function is used as a CHECK constraint condition,returning NULL is tantamount to returning TRUE, which would have theeffect of letting in a row that doesn't satisfy the hash condition.Admittedly, the cases for which this is done should be unreachablein practice, but that doesn't make it any less a bad idea. It alsoseems like a dartboard was used to decide which error cases shouldthrow errors as opposed to returning NULL.For the checks for NULL input values, I just switched it to returningfalse. There's some argument that an error would be better; but thecase really should be can't-happen in a generated hash constraint,so it's likely not worth more code for.For the parent-relation-open-failure case, it seems like we mightas well let relation_open throw an error, instead of having animpossible-to-diagnose constraint failure.Back-patch to v11 where this code came in.Discussion:https://postgr.es/m/24067.1605134819@sss.pgh.pa.us1 parent029fa66 commit54a9406
File tree
2 files changed
+10
-15
lines changed- src
- backend/partitioning
- test/regress/expected
2 files changed
+10
-15
lines changedLines changed: 7 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2778 | 2778 |
| |
2779 | 2779 |
| |
2780 | 2780 |
| |
| 2781 | + | |
| 2782 | + | |
2781 | 2783 |
| |
2782 | 2784 |
| |
2783 | 2785 |
| |
| |||
2802 | 2804 |
| |
2803 | 2805 |
| |
2804 | 2806 |
| |
2805 |
| - | |
| 2807 | + | |
2806 | 2808 |
| |
2807 |
| - | |
| 2809 | + | |
2808 | 2810 |
| |
2809 | 2811 |
| |
2810 | 2812 |
| |
| |||
2833 | 2835 |
| |
2834 | 2836 |
| |
2835 | 2837 |
| |
2836 |
| - | |
2837 |
| - | |
2838 |
| - | |
2839 |
| - | |
| 2838 | + | |
| 2839 | + | |
2840 | 2840 |
| |
2841 | 2841 |
| |
2842 | 2842 |
| |
2843 |
| - | |
2844 |
| - | |
| 2843 | + | |
2845 | 2844 |
| |
2846 | 2845 |
| |
2847 | 2846 |
| |
|
Lines changed: 3 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
14 |
| - | |
15 |
| - | |
16 |
| - | |
17 |
| - | |
| 13 | + | |
18 | 14 |
| |
19 | 15 |
| |
20 | 16 |
| |
| |||
34 | 30 |
| |
35 | 31 |
| |
36 | 32 |
| |
37 |
| - | |
| 33 | + | |
38 | 34 |
| |
39 | 35 |
| |
40 | 36 |
| |
41 | 37 |
| |
42 | 38 |
| |
43 | 39 |
| |
44 |
| - | |
| 40 | + | |
45 | 41 |
| |
46 | 42 |
| |
47 | 43 |
| |
|
0 commit comments
Comments
(0)