summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorVlad Lesin <vlad_lesin@mail.ru>2018-05-25 22:16:04 +0400
committerVlad Lesin <vlad_lesin@mail.ru>2019-11-19 16:28:15 +0300
commit6718d3bc3241f72e07504133371cf3813d2e6fe9 (patch)
treed93a3b16f5559c8bde8649e6348fcc54f606101c /sql/item_func.cc
parentb80df9eba23b4eb9694e770a41135127c6dbc5df (diff)
downloadmariadb-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/item_func.cc')
-rw-r--r--sql/item_func.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 7719e0faa87..6ca74a79b9c 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2553,12 +2553,12 @@ double my_double_round(double value, longlong dec, bool dec_unsigned,
volatile double value_div_tmp= value / tmp;
volatile double value_mul_tmp= value * tmp;
- if (!dec_negative && my_isinf(tmp)) // "dec" is too large positive number
+ if (!dec_negative && std::isinf(tmp)) // "dec" is too large positive number
return value;
- if (dec_negative && my_isinf(tmp))
+ if (dec_negative && std::isinf(tmp))
tmp2= 0.0;
- else if (!dec_negative && my_isinf(value_mul_tmp))
+ else if (!dec_negative && std::isinf(value_mul_tmp))
tmp2= value;
else if (truncate)
{