]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix possible internal overflow in numeric division.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Nov 2015 20:46:47 +0000 (15:46 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Nov 2015 20:47:03 +0000 (15:47 -0500)
commit7df6dc4056acc477d792bf3bb1a58eb3c1047269
treefb366ef632f02d86dd8a31df916e25020bbece53
parentfaf18a90506ecf0a4ab1349acfcb899167385649
Fix possible internal overflow in numeric division.

div_var_fast() postpones propagating carries in the same way as mul_var(),
so it has the same corner-case overflow risk we fixed in 246693e5ae8a36f0,
namely that the size of the carries has to be accounted for when setting
the threshold for executing a carry propagation step.  We've not devised
a test case illustrating the brokenness, but the required fix seems clear
enough.  Like the previous fix, back-patch to all active branches.

Dean Rasheed
src/backend/utils/adt/numeric.c