aboutsummaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_inline.cpp
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2019-07-26 11:59:00 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2019-07-26 11:59:00 -0400
commitca918f99aaa5fe108248ea2380f637bab09a88c2 (patch)
treed293228a5072198ad03c0127f24cb76241714d4b /src/backend/jit/llvm/llvmjit_inline.cpp
parent77d5dea386f5747ca56bac1ae745e4604111adda (diff)
downloadpostgresql-ca918f99aaa5fe108248ea2380f637bab09a88c2.tar.gz
postgresql-ca918f99aaa5fe108248ea2380f637bab09a88c2.zip
Fix loss of fractional digits for large values in cash_numeric().
Money values exceeding about 18 digits (depending on lc_monetary) could be inaccurately converted to numeric, due to select_div_scale() deciding it didn't need to compute any fractional digits. Force its hand by setting the dscale of one division input to equal the number of fractional digits we need. In passing, rearrange the logic to not do useless work in locales where money values are considered integral. Per bug #15925 from Slawomir Chodnicki. Back-patch to all supported branches. Discussion: https://postgr.es/m/15925-da9953e2674bb5c8@postgresql.org
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_inline.cpp')
0 files changed, 0 insertions, 0 deletions