diff options
author | Vlad Lesin <vlad_lesin@mail.ru> | 2018-05-25 22:16:04 +0400 |
---|---|---|
committer | Vlad Lesin <vlad_lesin@mail.ru> | 2019-11-19 16:28:15 +0300 |
commit | 6718d3bc3241f72e07504133371cf3813d2e6fe9 (patch) | |
tree | d93a3b16f5559c8bde8649e6348fcc54f606101c /sql/field.cc | |
parent | b80df9eba23b4eb9694e770a41135127c6dbc5df (diff) | |
download | mariadb-git-6718d3bc3241f72e07504133371cf3813d2e6fe9.tar.gz |
MDEV-21082: isnan/isinf compilation errors, isfinite warnings on MacOS
The fix consists of three commits backported from 10.3:
1) Cleanup isnan() portability checks
(cherry picked from commit 7ffd7fe9627d1f750a3712aebb4503e5ae8aea8e)
2) Cleanup isinf() portability checks
Original problem reported by Wlad: re-compilation of 10.3 on top of 10.2
build would cache undefined HAVE_ISINF from 10.2, whereas it is expected
to be 1 in 10.3.
std::isinf() seem to be available on all supported platforms.
(cherry picked from commit bc469a0bdf85400f7a63834f5b7af1a513dcdec9)
3) Use std::isfinite in C++ code
This is addition to parent revision fixing build failures.
(cherry picked from commit 54999f4e75f42baca484ae436b382ca8817df1dd)
Diffstat (limited to 'sql/field.cc')
-rw-r--r-- | sql/field.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/field.cc b/sql/field.cc index a23004ebd96..09e82acb009 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2904,7 +2904,7 @@ int Field_decimal::store(double nr) return 1; } - if (!isfinite(nr)) // Handle infinity as special case + if (!std::isfinite(nr)) // Handle infinity as special case { overflow(nr < 0.0); return 1; @@ -4821,7 +4821,7 @@ int truncate_double(double *nr, uint field_length, uint dec, int error= 0; double res= *nr; - if (isnan(res)) + if (std::isnan(res)) { *nr= 0; return -1; @@ -4843,7 +4843,7 @@ int truncate_double(double *nr, uint field_length, uint dec, max_value-= 1.0 / log_10[dec]; /* Check for infinity so we don't get NaN in calculations */ - if (!my_isinf(res)) + if (!std::isinf(res)) { double tmp= rint((res - floor(res)) * log_10[dec]) / log_10[dec]; res= floor(res) + tmp; |