diff options
-rw-r--r-- | acinclude.m4 | 13 | ||||
-rw-r--r-- | sql/item_strfunc.cc | 4 |
2 files changed, 14 insertions, 3 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index abeb2024f4a..f7d89ecf35a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -126,12 +126,19 @@ AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [ save_LIBS="$LIBS" LIBS="-l$1 $LIBS" AC_CACHE_CHECK([if libz with compress], mysql_cv_compress, -[AC_TRY_LINK([#include <zlib.h> +[AC_TRY_RUN([#include <zlib.h> #ifdef __cplusplus extern "C" #endif -], -[ return compress(0, (unsigned long*) 0, "", 0); +int main(int argv, char **argc) +{ + return 0; +} + +int link_test() +{ + return compress(0, (unsigned long*) 0, "", 0); +} ], mysql_cv_compress=yes, mysql_cv_compress=no)]) if test "$mysql_cv_compress" = "yes" then diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 801b77ffcce..8cc3d24f7d9 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -1471,6 +1471,10 @@ String *Item_func_format::val_str(String *str) return 0; /* purecov: inspected */ dec= decimals ? decimals+1 : 0; str->set(nr,decimals); +#ifdef HAVE_ISNAN + if (isnan(nr)) + return str; +#endif str_length=str->length(); if (nr < 0) str_length--; // Don't count sign |