forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita2a0c7c
committed
Further tweaking of width_bucket() edge cases.
I realized that the third overflow case I posited in commitb0e9e4dactually should be handled in a different way: rather than toleratingthe idea that the quotient could round to 1, we should clamp so thatthe output cannot be more than "count" when we know that the operand isless than bound2. That being the case, we don't need an overflow-awareincrement in that code path, which leads me to revert the movement ofthe pg_add_s32_overflow() call. (The diff in width_bucket_float8might be easier to read by comparing againstb0e9e4d^.)What's more, width_bucket_numeric also has this problem of the quotientpotentially rounding to 1, so add a clamp there too.As before, I'm not quite convinced that a back-patch is warranted.Discussion:https://postgr.es/m/391415.1680268470@sss.pgh.pa.us1 parentf0d65c0 commita2a0c7c
File tree
4 files changed
+88
-28
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
4 files changed
+88
-28
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4108 | 4108 |
| |
4109 | 4109 |
| |
4110 | 4110 |
| |
4111 |
| - | |
4112 | 4111 |
| |
4113 |
| - | |
| 4112 | + | |
4114 | 4113 |
| |
4115 |
| - | |
4116 |
| - | |
4117 | 4114 |
| |
4118 |
| - | |
4119 |
| - | |
| 4115 | + | |
| 4116 | + | |
| 4117 | + | |
| 4118 | + | |
4120 | 4119 |
| |
4121 | 4120 |
| |
4122 | 4121 |
| |
4123 |
| - | |
4124 |
| - | |
4125 |
| - | |
4126 |
| - | |
4127 |
| - | |
4128 |
| - | |
4129 |
| - | |
4130 |
| - | |
4131 |
| - | |
| 4122 | + | |
| 4123 | + | |
| 4124 | + | |
| 4125 | + | |
| 4126 | + | |
| 4127 | + | |
| 4128 | + | |
| 4129 | + | |
| 4130 | + | |
| 4131 | + | |
| 4132 | + | |
| 4133 | + | |
| 4134 | + | |
| 4135 | + | |
| 4136 | + | |
| 4137 | + | |
| 4138 | + | |
| 4139 | + | |
| 4140 | + | |
| 4141 | + | |
| 4142 | + | |
| 4143 | + | |
| 4144 | + | |
4132 | 4145 |
| |
4133 | 4146 |
| |
4134 | 4147 |
| |
4135 | 4148 |
| |
4136 | 4149 |
| |
4137 |
| - | |
| 4150 | + | |
4138 | 4151 |
| |
4139 |
| - | |
4140 |
| - | |
4141 |
| - | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
4142 | 4158 |
| |
4143 |
| - | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
| 4167 | + | |
4144 | 4168 |
| |
4145 | 4169 |
| |
4146 | 4170 |
| |
| |||
4150 | 4174 |
| |
4151 | 4175 |
| |
4152 | 4176 |
| |
4153 |
| - | |
4154 |
| - | |
4155 |
| - | |
4156 |
| - | |
4157 |
| - | |
4158 | 4177 |
| |
4159 | 4178 |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1907 | 1907 |
| |
1908 | 1908 |
| |
1909 | 1909 |
| |
1910 |
| - | |
| 1910 | + | |
1911 | 1911 |
| |
1912 | 1912 |
| |
1913 | 1913 |
| |
| |||
1940 | 1940 |
| |
1941 | 1941 |
| |
1942 | 1942 |
| |
1943 |
| - | |
1944 |
| - | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
1945 | 1956 |
| |
1946 | 1957 |
| |
1947 | 1958 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1473 | 1473 |
| |
1474 | 1474 |
| |
1475 | 1475 |
| |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
1476 | 1501 |
| |
1477 | 1502 |
| |
1478 | 1503 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
909 | 909 |
| |
910 | 910 |
| |
911 | 911 |
| |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
912 | 917 |
| |
913 | 918 |
| |
914 | 919 |
| |
|
0 commit comments
Comments
(0)