- Notifications
You must be signed in to change notification settings - Fork4.9k
Commita89781e
committed
Fix possible internal overflow in numeric multiplication.
mul_var() postpones propagating carries until it risks overflow in itsinternal digit array. However, the logic failed to account for thepossibility of overflow in the carry propagation step, allowing wrongresults to be generated in corner cases. We must slightly reduce thewhen-to-propagate-carries threshold to avoid that.Discovered and fixed by Dean Rasheed, with small adjustments by me.This has been wrong since commitd72f6c7,so back-patch to all supported branches.1 parent24aed21 commita89781e
File tree
3 files changed
+49
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+49
-4
lines changedLines changed: 10 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4191 | 4191 |
| |
4192 | 4192 |
| |
4193 | 4193 |
| |
4194 |
| - | |
4195 |
| - | |
4196 |
| - | |
| 4194 | + | |
| 4195 | + | |
| 4196 | + | |
| 4197 | + | |
| 4198 | + | |
| 4199 | + | |
| 4200 | + | |
| 4201 | + | |
| 4202 | + | |
4197 | 4203 |
| |
4198 | 4204 |
| |
4199 | 4205 |
| |
| |||
4208 | 4214 |
| |
4209 | 4215 |
| |
4210 | 4216 |
| |
4211 |
| - | |
| 4217 | + | |
4212 | 4218 |
| |
4213 | 4219 |
| |
4214 | 4220 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1309 | 1309 |
| |
1310 | 1310 |
| |
1311 | 1311 |
| |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
1312 | 1339 |
| |
1313 | 1340 |
| |
1314 | 1341 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
811 | 811 |
| |
812 | 812 |
| |
813 | 813 |
| |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
814 | 826 |
| |
815 | 827 |
| |
816 | 828 |
| |
|
0 commit comments
Comments
(0)