From 0d6295c088264959adc69da66de8aad0cc87c6ff Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 May 2007 13:20:18 +0200 Subject: [PATCH 1/4] bug#28358 libmysql.dll cannot be dynamically loaded on Windows libmysql/CMakeLists.txt: bug#28358 USE_TLS was not defined during build of libmysql.dll with target other than Debug. Defining it for RelWithDebInfo appears to fix the bug for win32 and win64 cmake builds. --- libmysql/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libmysql/CMakeLists.txt b/libmysql/CMakeLists.txt index 647f6bd5e33..3b18531f6c0 100755 --- a/libmysql/CMakeLists.txt +++ b/libmysql/CMakeLists.txt @@ -18,6 +18,10 @@ INCLUDE("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake") # storage does not work properly in DLLs. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") +SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") +SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") +SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") +SET(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DSAFEMALLOC -DSAFE_MUTEX -DUSE_TLS") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/zlib From db9908fcb97f0b2c09533e06c115f276e9df94de Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 14 May 2007 15:11:29 +0200 Subject: [PATCH 2/4] import of fix for bug#28240 --- configure.in | 18 +++++++++++++----- include/my_global.h | 11 +++++------ sql/item_func.cc | 4 ++-- strings/strtod.c | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/configure.in b/configure.in index 1026c855bf2..e788419eb4f 100644 --- a/configure.in +++ b/configure.in @@ -2006,12 +2006,20 @@ case "$target" in ;; esac -# isinf() could be a function or a macro (HPUX) -AC_MSG_CHECKING(for isinf with ) +# Check that isinf() is available in math.h and can be used in both C and C++ +# code +AC_MSG_CHECKING(for isinf in ) AC_TRY_LINK([#include ], [float f = 0.0; int r = isinf(f); return r], - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), - AC_MSG_RESULT(no)) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(whether isinf() can be used in C++ code) + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_LINK([#include ], [float f = 0.0; int r = isinf(f); return r], + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_ISINF, [1], [isinf() macro or function]), + AC_MSG_RESULT(no)) + AC_LANG_RESTORE, + AC_MSG_RESULT(no)) CFLAGS="$ORG_CFLAGS" diff --git a/include/my_global.h b/include/my_global.h index e9b371d8d30..f32a987ffb1 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -792,12 +792,11 @@ typedef SOCKET_SIZE_TYPE size_socket; #define isnan(x) ((x) != (x)) #endif -#if !defined(HAVE_ISINF) -/* The configure check for "isinf with math.h" has failed */ -#ifdef isinf -#undef isinf -#endif -#define isinf(X) (!finite(X) && !isnan(X)) +#ifdef HAVE_ISINF +/* isinf() can be used in both C and C++ code */ +#define my_isinf(X) isinf(X) +#else +#define my_isinf(X) (!finite(X) && !isnan(X)) #endif /* Define missing math constants. */ diff --git a/sql/item_func.cc b/sql/item_func.cc index c0a9647e382..cdd5bcb1677 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -2025,9 +2025,9 @@ double my_double_round(double value, longlong dec, bool dec_unsigned, tmp=(abs_dec < array_elements(log_10) ? log_10[abs_dec] : pow(10.0,(double) abs_dec)); - if (dec_negative && isinf(tmp)) + if (dec_negative && my_isinf(tmp)) tmp2= 0; - else if (!dec_negative && isinf(value * tmp)) + else if (!dec_negative && my_isinf(value * tmp)) tmp2= value; else if (truncate) { diff --git a/strings/strtod.c b/strings/strtod.c index 15707a9b944..7196cafb2c9 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -194,7 +194,7 @@ double my_strtod(const char *str, char **end_ptr, int *error) done: *end_ptr= (char*) str; /* end of number */ - if (overflow || isinf(result)) + if (overflow || my_isinf(result)) { result= DBL_MAX; *error= EOVERFLOW; From c7c3d16984b11e30b32a3806b6ca2e0c88a09b33 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 May 2007 17:06:47 +0200 Subject: [PATCH 3/4] scripts/make_binary_distribution.sh : Include all the additional test suites in the binary packages ("tar.gz"). This is the tar.gz part of the fixes for bug#26609; for RPMs it is already done. scripts/make_binary_distribution.sh: Include all the additional test suites (for now: "funcs_1", "funcs_2", "row_lock") in the binary packages ("tar.gz"). Take them "as is", without any file filtering (except for the BK subdirectories "SCCS"). This is the tar.gz part of the fixes for bug#26609; for RPMs it is already done. Use this opportunity to correct the language in some comments. --- scripts/make_binary_distribution.sh | 72 ++++++++++++++++------------- 1 file changed, 40 insertions(+), 32 deletions(-) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index e8bf39bd016..77f51c51c19 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -102,11 +102,41 @@ case $system in ;; esac +# This is needed to prefer GNU tar over platform tar because that can't +# always handle long filenames + +PATH_DIRS=`echo $PATH | \ + sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` + +which_1 () +{ + for cmd + do + for d in $PATH_DIRS + do + for file in $d/$cmd + do + if [ -x $file -a ! -d $file ] ; then + echo $file + exit 0 + fi + done + done + done + exit 1 +} + +tar=`which_1 gnutar gtar` +if [ "$?" = "1" -o x"$tar" = x"" ] ; then + tar=tar +fi + mkdir $BASE $BASE/bin $BASE/docs \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/scripts \ $BASE/mysql-test $BASE/mysql-test/t $BASE/mysql-test/r \ - $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib + $BASE/mysql-test/include $BASE/mysql-test/std_data $BASE/mysql-test/lib \ + $BASE/mysql-test/suite if [ $BASE_SYSTEM != "netware" ] ; then mkdir $BASE/share/mysql $BASE/tests $BASE/sql-bench $BASE/man \ @@ -117,8 +147,8 @@ fi # Copy files if they exists, warn for those that don't. # Note that when listing files to copy, we might list the file name -# twice, once in the directory location where it is build, and a -# second time in the ".libs" location. In the case the firs one +# twice, once in the directory location where it is built, and a +# second time in the ".libs" location. In the case the first one # is a wrapper script, the second one will overwrite it with the # binary file. copyfileto() @@ -274,6 +304,13 @@ $CP mysql-test/t/*.test mysql-test/t/*.imtest \ $CP mysql-test/r/*.result mysql-test/r/*.require \ $BASE/mysql-test/r +# Copy the additional suites "as is", they are in flux +$tar cf - mysql-test/suite | ( cd $BASE ; $tar xf - ) +# Clean up if we did this from a bk tree +if [ -d mysql-test/SCCS ] ; then + find $BASE/mysql-test -name SCCS -print | xargs rm -rf +fi + if [ $BASE_SYSTEM != "netware" ] ; then chmod a+x $BASE/bin/* copyfileto $BASE/bin scripts/* @@ -374,41 +411,12 @@ if [ x$DEBUG = x1 ] ; then exit fi -# This is needed to prefere gnu tar instead of tar because tar can't -# always handle long filenames - -PATH_DIRS=`echo $PATH | \ - sed -e 's/^:/. /' -e 's/:$/ ./' -e 's/::/ . /g' -e 's/:/ /g' ` - -which_1 () -{ - for cmd - do - for d in $PATH_DIRS - do - for file in $d/$cmd - do - if [ -x $file -a ! -d $file ] ; then - echo $file - exit 0 - fi - done - done - done - exit 1 -} - if [ $BASE_SYSTEM != "netware" ] ; then # # Create the result tar file # - tar=`which_1 gnutar gtar` - if [ "$?" = "1" -o x"$tar" = x"" ] ; then - tar=tar - fi - echo "Using $tar to create archive" OPT=cvf From 08639fb9e799999a3522019c81062914050af7cd Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 22 May 2007 17:21:22 +0200 Subject: [PATCH 4/4] Add the "row_lock" test suite to the (to be) release build test run. --- Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile.am b/Makefile.am index 992a6f6d755..6cb080aed5a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -157,6 +157,8 @@ test-bt: @PERL@ ./mysql-test-run.pl --force --comment=funcs1_ps --ps-protocol --suite=funcs_1 -cd mysql-test ; MTR_BUILD_THREAD=auto \ @PERL@ ./mysql-test-run.pl --force --comment=funcs2 --suite=funcs_2 + -cd mysql-test ; MTR_BUILD_THREAD=auto \ + @PERL@ ./mysql-test-run.pl --force --comment=rowlock --suite=row_lock test-bt-debug: -cd mysql-test ; MTR_BUILD_THREAD=auto \