From 3e148b05a9025be48f4bfed3a561ebc0bf359fd2 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Sat, 13 Mar 2010 22:17:47 +0100 Subject: [PATCH 01/11] Fix C++ style comments, they cause syntax errors in C file. --- mysys/typelib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysys/typelib.c b/mysys/typelib.c index c332c82d17a..7681ff581ac 100644 --- a/mysys/typelib.c +++ b/mysys/typelib.c @@ -354,11 +354,11 @@ my_ulonglong find_set_from_flags(const TYPELIB *lib, uint default_name, !(value= parse_name(&on_off_default_typelib, &pos, end))) goto err; - if (value == 1) // this is '=off' + if (value == 1) /* this is '=off' */ flags_to_clear|= bit; - else if (value == 2) // this is '=on' + else if (value == 2) /* this is '=on' */ flags_to_set|= bit; - else // this is '=default' + else /* this is '=default' */ { if (default_set & bit) flags_to_set|= bit; From c71bd7e1d09607f289a9abe21b9ad7a5cc0fa570 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 15 Mar 2010 18:15:10 +0100 Subject: [PATCH 02/11] This is a temporary hack to build 5.5.3-m3: The "cmake" way still shows issues in our release build environment. Block it temporarily, but in a way that can easily be undone. This change is to be reverted once the problems are solved. BUILD/choose_configure.sh: Easiest way: Preset "HAVE_CMAKE=no" --- BUILD/choose_configure.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILD/choose_configure.sh b/BUILD/choose_configure.sh index 476b8b51657..df1fdf0a55b 100644 --- a/BUILD/choose_configure.sh +++ b/BUILD/choose_configure.sh @@ -2,6 +2,11 @@ # Choose whether to use autoconf created configure # of perl script that calls cmake. +# This is a temporary hack to build 5.5.3-m3: +# The "cmake" way still shows issues in our release build environment. +# Block it temporarily, but in a way that can easily be undone. +HAVE_CMAKE=no + # Ensure cmake and perl are there cmake -P cmake/check_minimal_version.cmake >/dev/null 2>&1 || HAVE_CMAKE=no perl --version >/dev/null 2>&1 || HAVE_CMAKE=no From 48734d046187b2f374b9796f25b7e3ad996792f0 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 15 Mar 2010 19:01:22 +0100 Subject: [PATCH 03/11] Another case of C++ syntax used for a comment in C. --- dbug/dbug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbug/dbug.c b/dbug/dbug.c index 9bcea988b33..01ce6f80768 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -1365,7 +1365,7 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args) { char cvtbuf[1024]; size_t len; - // Do not use my_vsnprintf, it does not support "%g". + /* Do not use my_vsnprintf, it does not support "%g". */ len = vsnprintf(cvtbuf, sizeof(cvtbuf), format, args); (void) fprintf(stream, "%s\n", cvtbuf); } From 4aa12dd34c53d84dc3d619fa5ced7c0b7a56ae5b Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 15 Mar 2010 19:13:37 +0100 Subject: [PATCH 04/11] Fix for bug#51938, extracted from a work-in-progress development branch just for the build of 5.5.3-m3. --- scripts/mysqld_safe.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/mysqld_safe.sh b/scripts/mysqld_safe.sh index a4ce5f9575b..5420ebd908e 100644 --- a/scripts/mysqld_safe.sh +++ b/scripts/mysqld_safe.sh @@ -699,7 +699,7 @@ fi cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS" -plugin_dir="${PLUGIN_DIR:-@PLUGINDIR@}${PLUGIN_VARIANT}" +plugin_dir="${PLUGIN_DIR:-@pkgplugindir@}${PLUGIN_VARIANT}" for i in "$ledir/$MYSQLD" "$defaults" "--basedir=$MY_BASEDIR_VERSION" \ "--datadir=$DATADIR" "--plugin-dir=$plugin_dir" "$USER_OPTION" From f4013d1302d63909a362807eb2e4756cfff204b7 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Tue, 16 Mar 2010 20:10:45 +0100 Subject: [PATCH 05/11] Fix a syntax error: A variable declaration was preceded by "DBUG_PRINT()". sql-common/client.c: Thou shalt not declare a variable after an executable statement (and "DBUG_PRINT()" is executable). --- sql-common/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-common/client.c b/sql-common/client.c index 88da0242f5b..676ec82d8de 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -2350,8 +2350,8 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user, (unix_socket || mysql_unix_port) && (!host || !strcmp(host,LOCAL_HOST))) { - DBUG_PRINT("info", ("Using socket")); my_socket sock= socket(AF_UNIX, SOCK_STREAM, 0); + DBUG_PRINT("info", ("Using socket")); if (sock == SOCKET_ERROR) { set_mysql_extended_error(mysql, CR_SOCKET_CREATE_ERROR, From d883671193464a7507c42647f16ac74fd7706af6 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 22 Mar 2010 16:02:31 +0100 Subject: [PATCH 06/11] Some fixes for the build on Windows as found necessary during the release build of 5.5.3-m3. scripts/CMakeLists.txt: The scripts "mysqldumpslow" and "mysqlhotcopy" need to be handled. scripts/make_win_bin_dist: 1) We do not create ".map" files any more. 2) Typing error fixed, it isn't "$DISTDIR" but "$DESTDIR". 3) Security fix: If the argument isn't of the form "dst=src", then we want the variables to be empty. The original code would have used an argument "foo" to set both "$src" and "$dst" to this string, which doesn't make much sense. --- scripts/CMakeLists.txt | 3 ++- scripts/make_win_bin_dist | 8 +++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt index 26dfb243897..e6ce5717d95 100755 --- a/scripts/CMakeLists.txt +++ b/scripts/CMakeLists.txt @@ -261,7 +261,8 @@ IF(WIN32) SET(PLIN_FILES mysql_config mysql_secure_installation) # Input files with .sh extension - SET(SH_FILES mysql_convert_table_format mysqld_multi) + SET(SH_FILES mysql_convert_table_format mysqld_multi mysqldumpslow + mysqlhotcopy) FOREACH(file ${PLIN_FILES}) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${file}.pl.in diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 51271a3dad0..7e8428bfe5c 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -158,7 +158,6 @@ cp tests/$TARGET/*.exe $DESTDIR/bin/ cp libmysql/$TARGET/libmysql.dll $DESTDIR/bin/ cp sql/$TARGET/mysqld.exe $DESTDIR/bin/mysqld$EXE_SUFFIX.exe -cp sql/$TARGET/mysqld.map $DESTDIR/bin/mysqld$EXE_SUFFIX.map if [ x"$TARGET" != x"release" ] ; then cp sql/$TARGET/mysqld.pdb $DESTDIR/bin/mysqld$EXE_SUFFIX.pdb fi @@ -167,7 +166,6 @@ if [ x"$PACK_DEBUG" = x"" -a -f "sql/debug/mysqld.exe" -o \ x"$PACK_DEBUG" = x"yes" ] ; then cp sql/debug/mysqld.exe $DESTDIR/bin/mysqld-debug.exe cp sql/debug/mysqld.pdb $DESTDIR/bin/mysqld-debug.pdb - cp sql/debug/mysqld.map $DESTDIR/bin/mysqld-debug.map fi # ---------------------------------------------------------------------- @@ -397,15 +395,15 @@ cp scripts/*.sql $DESTDIR/share/ # Clean up from possibly copied SCCS directories # ---------------------------------------------------------------------- -rm -rf `find $DISTDIR -type d -name SCCS -print` +rm -rf `find $DESTDIR -type d -name SCCS -print` # ---------------------------------------------------------------------- # Copy other files specified on command line DEST=SOURCE # ---------------------------------------------------------------------- for arg do - dst=`echo $arg | sed 's/=.*$//'` - src=`echo $arg | sed 's/^.*=//'` + dst=`echo $arg | sed -n 's/=.*$//p'` + src=`echo $arg | sed -n 's/^.*=//p'` if [ x"$dst" = x"" -o x"$src" = x"" ] ; then echo "Invalid specification of what to copy" From b61fe56bd7766a03d43fc3e4ec1918f110fb9ed8 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Mon, 22 Mar 2010 16:19:39 +0100 Subject: [PATCH 07/11] Fixes related to bug#46587: archive storage engine headers don't include my_global.h first During the build of 5.5.3-m3 on older Linux platforms (kernels 2.4 or early 2.6), the symptom described in the bug report occurred both in the "archive" and in the "innobase" storage engine. This change is the patch proposed in that bug report, and a similar one in innobase, that latter is aligned with Vasil Dimov of Innobase, the original author. --- storage/archive/azlib.h | 8 ++++++-- storage/innobase/trx/trx0i_s.c | 9 ++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/storage/archive/azlib.h b/storage/archive/azlib.h index d7abb40b2ae..2bfc22c6b2b 100644 --- a/storage/archive/azlib.h +++ b/storage/archive/azlib.h @@ -33,11 +33,15 @@ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ -#include - #include "../../mysys/mysys_priv.h" #include +/* See bug#46587: + As described in the bug report, this placement is a fix. + It is needed to build 5.5.3-m3 on Linux 2.4 and early 2.6 kernels. +*/ +#include + #ifdef __cplusplus extern "C" { #endif diff --git a/storage/innobase/trx/trx0i_s.c b/storage/innobase/trx/trx0i_s.c index 1b20eaabf42..a3f73e0c9e8 100644 --- a/storage/innobase/trx/trx0i_s.c +++ b/storage/innobase/trx/trx0i_s.c @@ -28,11 +28,18 @@ table cache" for later retrieval. Created July 17, 2007 Vasil Dimov *******************************************************/ +/* Found during the build of 5.5.3 on Linux 2.4 and early 2.6 kernels: + The includes "univ.i" -> "my_global.h" cause a different path + to be taken further down with pthread functions and types, + so they must come first. + From the symptoms, this is related to bug#46587 in the MySQL bug DB. +*/ +#include "univ.i" + #include #include "mysql_addons.h" -#include "univ.i" #include "buf0buf.h" #include "dict0dict.h" #include "ha0storage.h" From 81cbce56bb1c0bb28e554ab5c9e3ab4fb65abe6b Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Wed, 24 Mar 2010 20:01:01 +0100 Subject: [PATCH 08/11] Some fixes developed during the build of 5.5.3-m3 about handling the debug plugin files, also "ha_example.*" are dropped. --- support-files/mysql.spec.sh | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index f02773e73b9..734136939fb 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -565,10 +565,10 @@ install -d $RBR%{_sbindir} mkdir $RBR/tmp-debug-plugin $MBD/plugin/debug ( cd $RPM_BUILD_DIR/mysql-%{mysql_version}/mysql-debug-%{mysql_version}/plugin make install DESTDIR=$RBR/tmp-debug-plugin - mv $RBR/tmp-debug-plugin/usr/local/mysql/lib/mysql/plugin/* $MBD/plugin/debug/ + mv $RBR/tmp-debug-plugin/usr/lib*/mysql/plugin/* $MBD/plugin/debug/ # From here, the install hook in "plugin/Makefile.am" will do the rest. ) -rmdir -p $RBR/tmp-debug-plugin/usr/local/mysql/lib/mysql/plugin +rmdir -p $RBR/tmp-debug-plugin/usr/lib*/mysql/plugin || true # Install all binaries (cd $MBD && make install DESTDIR=$RBR testroot=%{_datadir}) @@ -605,8 +605,8 @@ ln -s %{_sysconfdir}/init.d/mysql $RBR%{_sbindir}/rcmysql touch $RBR%{_sysconfdir}/my.cnf %if %{WITH_TCMALLOC} -# Even though this is a shared library, put it under /usr/lib/mysql, so it -# doesn't conflict with possible shared lib by the same name in /usr/lib. See +# Even though this is a shared library, put it under /usr/lib*/mysql, so it +# doesn't conflict with possible shared lib by the same name in /usr/lib*. See # `mysql_config --variable=pkglibdir` and mysqld_safe for how this is used. install -m 644 "%{malloc_lib_source}" "$RBR%{_libdir}/mysql/%{malloc_lib_target}" %endif @@ -874,10 +874,8 @@ fi %attr(755, root, root) %{_sbindir}/mysqld %attr(755, root, root) %{_sbindir}/mysqld-debug %attr(755, root, root) %{_sbindir}/rcmysql -%attr(755, root, root) %{_libdir}/mysql/plugin/ha_example.so* %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_master.so* %attr(755, root, root) %{_libdir}/mysql/plugin/semisync_slave.so* -%attr(755, root, root) %{_libdir}/mysql/plugin/debug/ha_example.so* %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_master.so* %attr(755, root, root) %{_libdir}/mysql/plugin/debug/semisync_slave.so* @@ -1008,14 +1006,10 @@ fi %{_libdir}/mysql/libvio.a %{_libdir}/mysql/libz.a %{_libdir}/mysql/libz.la -%{_libdir}/mysql/plugin/ha_example.a -%{_libdir}/mysql/plugin/ha_example.la %{_libdir}/mysql/plugin/semisync_master.a %{_libdir}/mysql/plugin/semisync_master.la %{_libdir}/mysql/plugin/semisync_slave.a %{_libdir}/mysql/plugin/semisync_slave.la -%{_libdir}/mysql/plugin/debug/ha_example.a -%{_libdir}/mysql/plugin/debug/ha_example.la %{_libdir}/mysql/plugin/debug/semisync_master.a %{_libdir}/mysql/plugin/debug/semisync_master.la %{_libdir}/mysql/plugin/debug/semisync_slave.a @@ -1055,6 +1049,16 @@ fi # merging BK trees) ############################################################################## %changelog +* Mon Mar 22 2010 Joerg Bruehe + +- User "usr/lib*" to allow for both "usr/lib" and "usr/lib64", + mask "rmdir" return code 1. +- Remove "ha_example.*" files from the list, they aren't built. + +* Wed Mar 17 2010 Joerg Bruehe + +- Fix a wrong path name in handling the debug plugins. + * Wed Mar 10 2010 Joerg Bruehe - Take the result of the debug plugin build and put it into the optimized tree, From 056e67054272571adeceb39d8d69b5f7950e517f Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Wed, 24 Mar 2010 20:15:06 +0100 Subject: [PATCH 09/11] Fix an issue with the IBM C++ compiler which was detected during the build of 5.5.3-m3. This requires version 9 of IBM C++ to help. More fixes will still be needed, it is very strict (or rather: a bit picky?) about templates. --- sql/mdl.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sql/mdl.h b/sql/mdl.h index 124151798ae..2fb21a5aa18 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -15,6 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#if defined(__IBMC__) || defined(__IBMCPP__) +/* Further down, "next_in_lock" and "next_in_context" have the same type, + and in "sql_plist.h" this leads to an identical signature, which causes + problems in function overloading. +*/ +#pragma namemangling(v5) +#endif + #include "sql_plist.h" #include From 8b79e6209cd8222855e8a7e4a52b0d4ec0263634 Mon Sep 17 00:00:00 2001 From: Joerg Bruehe Date: Wed, 24 Mar 2010 20:30:33 +0100 Subject: [PATCH 10/11] Add "--with-perfschema" to the configure options for RPMs. --- support-files/mysql.spec.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 734136939fb..7d74d90559c 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -430,6 +430,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-$PATH}\" \ --with-plugin-archive \ --with-plugin-blackhole \ --with-plugin-federated \ + --with-perfschema \ --without-plugin-daemon_example \ --without-plugin-ftexample \ %if %{EMBEDDED_BUILD} @@ -1049,6 +1050,10 @@ fi # merging BK trees) ############################################################################## %changelog +* Wed Mar 24 2010 Joerg Bruehe + +- Add "--with-perfschema" to the configure options. + * Mon Mar 22 2010 Joerg Bruehe - User "usr/lib*" to allow for both "usr/lib" and "usr/lib64", From c62d8e5cb5ae57cedd08f761e99cab0e98f8496a Mon Sep 17 00:00:00 2001 From: Daniel Fischer Date: Fri, 16 Apr 2010 10:27:18 +0200 Subject: [PATCH 11/11] Make the libraries we produce on Windows actually usable --- include/my_global.h | 17 +++++++++++++---- scripts/make_win_bin_dist | 1 + 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/my_global.h b/include/my_global.h index b4bc61e0a48..c0a55e0f4e4 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -18,6 +18,11 @@ #ifndef _global_h #define _global_h +/* Client library users on Windows need this macro defined here. */ +#if !defined(__WIN__) && defined(_WIN32) +#define __WIN__ +#endif + /* InnoDB depends on some MySQL internals which other plugins should not need. This is because of InnoDB's foreign key support, "safe" binlog @@ -1089,10 +1094,14 @@ typedef long long my_ptrdiff_t; #define HUGE_PTR #endif #endif -#if defined(__IBMC__) || defined(__IBMCPP__) -/* This was _System _Export but caused a lot of warnings on _AIX43 */ -#define STDCALL -#elif !defined( STDCALL) + +#ifdef STDCALL +#undef STDCALL +#endif + +#ifdef _WIN32 +#define STDCALL __stdcall +#else #define STDCALL #endif diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index 7e8428bfe5c..9af722f7afc 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -249,6 +249,7 @@ cp include/mysql.h \ include/decimal.h \ include/errmsg.h \ include/my_global.h \ + include/my_config.h \ include/my_net.h \ include/my_getopt.h \ include/sslopt-longopts.h \