git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 7f11724) | patch
Fix possible internal overflow in numeric multiplication.
2015年9月21日 16:11:32 +0000 (12:11 -0400)
2015年9月21日 16:11:32 +0000 (12:11 -0400)
commit 246693e5ae8a36f015294aa8c73dbbf0d4e542a8
Fix possible internal overflow in numeric multiplication.

mul_var() postpones propagating carries until it risks overflow in its
internal digit array. However, the logic failed to account for the
possibility of overflow in the carry propagation step, allowing wrong
results to be generated in corner cases. We must slightly reduce the
when-to-propagate-carries threshold to avoid that.

Discovered and fixed by Dean Rasheed, with small adjustments by me.

This has been wrong since commit d72f6c75038d8d37e64a29a04b911f728044d83b,
so back-patch to all supported branches.
src/backend/utils/adt/numeric.c diff | blob | blame | history
src/test/regress/expected/numeric.out diff | blob | blame | history
src/test/regress/sql/numeric.sql diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /