Commit 6159cd27 authored by unknown's avatar unknown

Portability fixes


acinclude.m4:
  Made test for compress more reliable (for Solaris)
sql/item_strfunc.cc:
  Portability fix (for Linux Alpha)
parent c36c37c3
...@@ -126,12 +126,19 @@ AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [ ...@@ -126,12 +126,19 @@ AC_DEFUN(MYSQL_CHECK_ZLIB_WITH_COMPRESS, [
save_LIBS="$LIBS" save_LIBS="$LIBS"
LIBS="-l$1 $LIBS" LIBS="-l$1 $LIBS"
AC_CACHE_CHECK([if libz with compress], mysql_cv_compress, AC_CACHE_CHECK([if libz with compress], mysql_cv_compress,
[AC_TRY_LINK([#include <zlib.h> [AC_TRY_RUN([#include <zlib.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
], int main(int argv, char **argc)
[ return compress(0, (unsigned long*) 0, "", 0); {
return 0;
}
int link_test()
{
return compress(0, (unsigned long*) 0, "", 0);
}
], mysql_cv_compress=yes, mysql_cv_compress=no)]) ], mysql_cv_compress=yes, mysql_cv_compress=no)])
if test "$mysql_cv_compress" = "yes" if test "$mysql_cv_compress" = "yes"
then then
......
...@@ -1471,6 +1471,10 @@ String *Item_func_format::val_str(String *str) ...@@ -1471,6 +1471,10 @@ String *Item_func_format::val_str(String *str)
return 0; /* purecov: inspected */ return 0; /* purecov: inspected */
dec= decimals ? decimals+1 : 0; dec= decimals ? decimals+1 : 0;
str->set(nr,decimals); str->set(nr,decimals);
#ifdef HAVE_ISNAN
if (isnan(nr))
return str;
#endif
str_length=str->length(); str_length=str->length();
if (nr < 0) if (nr < 0)
str_length--; // Don't count sign str_length--; // Don't count sign
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment