- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit246693e
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 parent7f11724 commit246693e
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 | |
---|---|---|---|
| |||
5789 | 5789 |
| |
5790 | 5790 |
| |
5791 | 5791 |
| |
5792 |
| - | |
5793 |
| - | |
5794 |
| - | |
| 5792 | + | |
| 5793 | + | |
| 5794 | + | |
| 5795 | + | |
| 5796 | + | |
| 5797 | + | |
| 5798 | + | |
| 5799 | + | |
| 5800 | + | |
5795 | 5801 |
| |
5796 | 5802 |
| |
5797 | 5803 |
| |
| |||
5806 | 5812 |
| |
5807 | 5813 |
| |
5808 | 5814 |
| |
5809 |
| - | |
| 5815 | + | |
5810 | 5816 |
| |
5811 | 5817 |
| |
5812 | 5818 |
| |
|
Lines changed: 27 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1333 | 1333 |
| |
1334 | 1334 |
| |
1335 | 1335 |
| |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
1336 | 1363 |
| |
1337 | 1364 |
| |
1338 | 1365 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
821 | 821 |
| |
822 | 822 |
| |
823 | 823 |
| |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
824 | 836 |
| |
825 | 837 |
| |
826 | 838 |
| |
|
0 commit comments
Comments
(0)