From 88315c9e0caf73d46770bcc82c6f5cb407be32b8 Mon Sep 17 00:00:00 2001 From: "tsmith/mysqldev@mysql.com/production.mysql.com" <> Date: Tue, 17 Oct 2006 19:12:34 +0200 Subject: [PATCH 01/17] mysql.cc, log.cc: WL #3516: MySQL Enterprise: implement Version Display Specification --- client/mysql.cc | 54 ++++++++++++++++++++++++++++++++++++++++--------- sql/log.cc | 11 ++++++---- 2 files changed, 51 insertions(+), 14 deletions(-) diff --git a/client/mysql.cc b/client/mysql.cc index 5e09c309917..2592b39fe5f 100644 --- a/client/mysql.cc +++ b/client/mysql.cc @@ -49,6 +49,9 @@ const char *VER= "14.12"; /* Don't try to make a nice table if the data is too big */ #define MAX_COLUMN_LENGTH 1024 +/* Buffer to hold 'version' and 'version_comment' */ +#define MAX_SERVER_VERSION_LENGTH 128 + gptr sql_alloc(unsigned size); // Don't use mysqld alloc for these void sql_element_free(void *ptr); #include "sql_string.h" @@ -208,6 +211,7 @@ static int com_nopager(String *str, char*), com_pager(String *str, char*), static int read_and_execute(bool interactive); static int sql_connect(char *host,char *database,char *user,char *password, uint silent); +static const char *server_version_string(MYSQL *mysql); static int put_info(const char *str,INFO_TYPE info,uint error=0, const char *sql_state=0); static int put_error(MYSQL *mysql); @@ -432,8 +436,8 @@ int main(int argc,char *argv[]) put_info("Welcome to the MySQL monitor. Commands end with ; or \\g.", INFO_INFO); sprintf((char*) glob_buffer.ptr(), - "Your MySQL connection id is %lu to server version: %s\n", - mysql_thread_id(&mysql),mysql_get_server_info(&mysql)); + "Your MySQL connection id is %lu\nServer version: %s\n", + mysql_thread_id(&mysql), server_version_string(&mysql)); put_info((char*) glob_buffer.ptr(),INFO_INFO); #ifdef HAVE_READLINE @@ -3335,16 +3339,13 @@ com_status(String *buffer __attribute__((unused)), tee_fprintf(stdout, "Using outfile:\t\t'%s'\n", opt_outfile ? outfile : ""); #endif tee_fprintf(stdout, "Using delimiter:\t%s\n", delimiter); - tee_fprintf(stdout, "Server version:\t\t%s\n", mysql_get_server_info(&mysql)); + tee_fprintf(stdout, "Server version:\t\t%s\n", server_version_string(&mysql)); tee_fprintf(stdout, "Protocol version:\t%d\n", mysql_get_proto_info(&mysql)); tee_fprintf(stdout, "Connection:\t\t%s\n", mysql_get_host_info(&mysql)); if ((id= mysql_insert_id(&mysql))) tee_fprintf(stdout, "Insert id:\t\t%s\n", llstr(id, buff)); - /* - Don't remove "limit 1", - it is protection againts SQL_SELECT_LIMIT=0 - */ + /* "limit 1" is protection against SQL_SELECT_LIMIT=0 */ if (!mysql_query(&mysql,"select @@character_set_client, @@character_set_connection, @@character_set_server, @@character_set_database limit 1") && (result=mysql_use_result(&mysql))) { @@ -3409,6 +3410,39 @@ select_limit, max_join_size); return 0; } +static const char * +server_version_string(MYSQL *mysql) +{ + static char buf[MAX_SERVER_VERSION_LENGTH] = ""; + + /* Only one thread calls this, so no synchronization is needed */ + if (buf[0] == '\0') + { + char *bufp = buf; + MYSQL_RES *result; + MYSQL_ROW cur; + + bufp = strnmov(buf, mysql_get_server_info(mysql), sizeof buf); + + /* "limit 1" is protection against SQL_SELECT_LIMIT=0 */ + if (!mysql_query(mysql, "select @@version_comment limit 1") && + (result = mysql_use_result(mysql))) + { + MYSQL_ROW cur = mysql_fetch_row(result); + if (cur && cur[0]) + { + bufp = strxnmov(bufp, sizeof buf - (bufp - buf), " ", cur[0], NullS); + } + mysql_free_result(result); + } + + /* str*nmov doesn't guarantee NUL-termination */ + if (bufp == buf + sizeof buf) + buf[sizeof buf - 1] = '\0'; + } + + return buf; +} static int put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) @@ -3536,14 +3570,14 @@ void tee_puts(const char *s, FILE *file) { NETWARE_YIELD; fputs(s, file); - fputs("\n", file); + fputc('\n', file); #ifdef OS2 - fflush( file); + fflush(file); #endif if (opt_outfile) { fputs(s, OUTFILE); - fputs("\n", OUTFILE); + fputc('\n', OUTFILE); } } diff --git a/sql/log.cc b/sql/log.cc index 98829220f3d..960fc4f60c2 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -566,15 +566,18 @@ bool MYSQL_LOG::open(const char *log_name, case LOG_NORMAL: { char *end; - int len=my_snprintf(buff, sizeof(buff), "%s, Version: %s. " + int len=my_snprintf(buff, sizeof(buff), "%s, Version: %s (%s). " #ifdef EMBEDDED_LIBRARY - "embedded library\n", my_progname, server_version + "embedded library\n", + my_progname, server_version, MYSQL_COMPILATION_COMMENT #elif __NT__ "started with:\nTCP Port: %d, Named Pipe: %s\n", - my_progname, server_version, mysqld_port, mysqld_unix_port + my_progname, server_version, MYSQL_COMPILATION_COMMENT, + mysqld_port, mysqld_unix_port #else "started with:\nTcp port: %d Unix socket: %s\n", - my_progname,server_version,mysqld_port,mysqld_unix_port + my_progname, server_version, MYSQL_COMPILATION_COMMENT, + mysqld_port, mysqld_unix_port #endif ); end=strnmov(buff+len,"Time Id Command Argument\n", From 67ec8be645495eadc9c67a1249b615f11c12c3d7 Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-544072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Fri, 20 Oct 2006 19:18:21 +0200 Subject: [PATCH 02/17] make_win_bin_dist: Create target "include" directory before copying files to it Copy udf examples and raid.h CMakeLists.txt: Only compile in bdb if configured --- CMakeLists.txt | 4 +++- scripts/make_win_bin_dist | 15 +++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd780ec6a13..f202c15c200 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -123,7 +123,9 @@ ADD_SUBDIRECTORY(heap) ADD_SUBDIRECTORY(myisam) ADD_SUBDIRECTORY(myisammrg) ADD_SUBDIRECTORY(client) -ADD_SUBDIRECTORY(bdb) +IF(WITH_BERKELEY_STORAGE_ENGINE) + ADD_SUBDIRECTORY(bdb) +ENDIF(WITH_BERKELEY_STORAGE_ENGINE) ADD_SUBDIRECTORY(innobase) ADD_SUBDIRECTORY(sql) ADD_SUBDIRECTORY(sql/examples) diff --git a/scripts/make_win_bin_dist b/scripts/make_win_bin_dist index cc75245e5d9..38e7ab88f22 100755 --- a/scripts/make_win_bin_dist +++ b/scripts/make_win_bin_dist @@ -144,8 +144,6 @@ fi # Copy data directory, readme files etc # ---------------------------------------------------------------------- -cp COPYING EXCEPTIONS-CLIENT $DESTDIR/ - # FIXME is there ever a data directory to copy? if [ -d win/data ] ; then cp -pR win/data $DESTDIR/data @@ -159,9 +157,13 @@ mkdir $DESTDIR/Docs cp Docs/INSTALL-BINARY $DESTDIR/Docs/ cp Docs/manual.chm $DESTDIR/Docs/ || /bin/true cp ChangeLog $DESTDIR/Docs/ || /bin/true -cp COPYING $DESTDIR/Docs/ cp support-files/my-*.ini $DESTDIR/ +if [ -f COPYING ] ; then + cp COPYING EXCEPTIONS-CLIENT $DESTDIR/ + cp COPYING $DESTDIR/Docs/ +fi + # ---------------------------------------------------------------------- # These will be filled in when we enable embedded. Note that if no # argument is given, it is copied if exists, else a check is done. @@ -170,7 +172,8 @@ cp support-files/my-*.ini $DESTDIR/ copy_embedded() { mkdir -p $DESTDIR/Embedded/DLL/release \ - $DESTDIR/Embedded/static/release + $DESTDIR/Embedded/static/release \ + $DESTDIR/include cp libmysqld/libmysqld.def $DESTDIR/include/ cp libmysqld/$TARGET/mysqlserver.lib $DESTDIR/Embedded/static/release/ cp libmysqld/$TARGET/libmysqld.dll $DESTDIR/Embedded/DLL/release/ @@ -211,6 +214,9 @@ fi mkdir -p $DESTDIR/examples/tests cp tests/*.res tests/*.tst tests/*.pl tests/*.c $DESTDIR/examples/tests/ +mkdir -p $DESTDIR/examples/udf_example +cp sql/udf_example.def sql/udf_example.vcproj sql/udf_example.c $DESTDIR/examples/udf_example/ + # ---------------------------------------------------------------------- # FIXME why not copy it all in "include"?! # ---------------------------------------------------------------------- @@ -228,6 +234,7 @@ cp include/conf*.h \ include/m_string.h \ include/m_ctype.h \ include/my_global.h \ + include/raid.h \ include/typelib.h $DESTDIR/include/ cp libmysql/libmysql.def $DESTDIR/include/ From d65efaa0510ea1cac75086ea5a0fe349f22f6a14 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 24 Oct 2006 12:01:52 +0200 Subject: [PATCH 03/17] Bump version from 5.0.27 to 28. --- configure.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 55da1dfb241..18c08722fff 100644 --- a/configure.in +++ b/configure.in @@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc) AC_CANONICAL_SYSTEM # The Docs Makefile.am parses this line! # remember to also change ndb version below and update version.c in ndb -AM_INIT_AUTOMAKE(mysql, 5.0.27) +AM_INIT_AUTOMAKE(mysql, 5.0.28) AM_CONFIG_HEADER(config.h) PROTOCOL_VERSION=10 @@ -19,7 +19,7 @@ SHARED_LIB_VERSION=$SHARED_LIB_MAJOR_VERSION:0:0 # ndb version NDB_VERSION_MAJOR=5 NDB_VERSION_MINOR=0 -NDB_VERSION_BUILD=27 +NDB_VERSION_BUILD=28 NDB_VERSION_STATUS="" # Set all version vars based on $VERSION. How do we do this more elegant ? From 3785698d9fb26b5f88dfd9138e1cd373ad5d90ef Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 24 Oct 2006 12:31:18 +0200 Subject: [PATCH 04/17] innobase/CMakeLists.txt : Change done by Ignacio Galarza (igalarza@mysql.com) Bug #19424 InnoDB: possibly a memory overrun of the buffer being freed (Windows 64) Fix is to reduce optimization if the compiler is "Visual Studio 8 2005 Win64". --- innobase/CMakeLists.txt | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/innobase/CMakeLists.txt b/innobase/CMakeLists.txt index f9661963d56..c244364a800 100755 --- a/innobase/CMakeLists.txt +++ b/innobase/CMakeLists.txt @@ -2,6 +2,43 @@ #SET(CMAKE_C_FLAGS_DEBUG "-DSAFEMALLOC -DSAFE_MUTEX") ADD_DEFINITIONS(-DMYSQL_SERVER -D_WIN32 -DWIN32 -D_LIB) +# Bug#19424 - InnoDB: Possibly a memory overrun of the buffer being freed (64-bit Visual C) +# Removing Win64 compiler optimizations for all innodb files. +IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") + SET_SOURCE_FILES_PROPERTIES(btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c + buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c + data/data0data.c data/data0type.c + dict/dict0boot.c dict/dict0crea.c dict/dict0dict.c dict/dict0load.c dict/dict0mem.c + dyn/dyn0dyn.c + eval/eval0eval.c eval/eval0proc.c + fil/fil0fil.c + fsp/fsp0fsp.c + fut/fut0fut.c fut/fut0lst.c + ha/ha0ha.c ha/hash0hash.c + ibuf/ibuf0ibuf.c + pars/lexyy.c pars/pars0grm.c pars/pars0opt.c pars/pars0pars.c pars/pars0sym.c + lock/lock0lock.c + log/log0log.c log/log0recv.c + mach/mach0data.c + mem/mem0mem.c mem/mem0pool.c + mtr/mtr0log.c mtr/mtr0mtr.c + os/os0file.c os/os0proc.c os/os0sync.c os/os0thread.c + page/page0cur.c page/page0page.c + que/que0que.c + read/read0read.c + rem/rem0cmp.c rem/rem0rec.c + row/row0ins.c row/row0mysql.c row/row0purge.c row/row0row.c row/row0sel.c row/row0uins.c + row/row0umod.c row/row0undo.c row/row0upd.c row/row0vers.c + srv/srv0que.c srv/srv0srv.c srv/srv0start.c + sync/sync0arr.c sync/sync0rw.c sync/sync0sync.c + thr/thr0loc.c + trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c + trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c + usr/usr0sess.c + ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c + PROPERTIES COMPILE_FLAGS -Od) +ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include include) ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c buf/buf0buf.c buf/buf0flu.c buf/buf0lru.c buf/buf0rea.c @@ -33,3 +70,8 @@ ADD_LIBRARY(innobase btr/btr0btr.c btr/btr0cur.c btr/btr0pcur.c btr/btr0sea.c trx/trx0purge.c trx/trx0rec.c trx/trx0roll.c trx/trx0rseg.c trx/trx0sys.c trx/trx0trx.c trx/trx0undo.c usr/usr0sess.c ut/ut0byte.c ut/ut0dbg.c ut/ut0mem.c ut/ut0rnd.c ut/ut0ut.c ) + +# (Bug#19424) Removing Win64 compiler optimizations innobase project. +IF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") + SET_TARGET_PROPERTIES(innobase PROPERTIES COMPILE_FLAGS "/Od") +ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 8 2005 Win64") From de9e75969920f07a2575aac45710e908c6de2dbf Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 1 Nov 2006 20:17:10 +0100 Subject: [PATCH 05/17] mysql-test/mysql-test-run.pl + mysql-test/mysql-test-run.sh Necessary changes if one of the test scripts is to be used with a RPM installation (bug#17194). This change handles finding the server and the other programs, but it does not solve the problem to get a writable "var" directory. If we want to avoid world-writable directories below "/usr/share/mysql-test" (and we do!), any automatic solution would require fixed decisions which may not match the local installation. For the Perl script, use "--vardir"; for the shell script, create "mysql-test/var" manually. --- mysql-test/mysql-test-run.pl | 23 ++++++++++++++++++++-- mysql-test/mysql-test-run.sh | 38 ++++++++++++++++++++++++++---------- 2 files changed, 49 insertions(+), 12 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d1e049ff883..0fcfc8b728b 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -431,7 +431,7 @@ sub initial_setup () { $glob_hostname= mtr_short_hostname(); - # 'basedir' is always parent of "mysql-test" directory + # 'basedir' is always above "mysql-test" directory ... $glob_mysql_test_dir= cwd(); if ( $glob_cygwin_perl ) { @@ -442,8 +442,19 @@ sub initial_setup () { chomp($glob_mysql_test_dir); chomp($glob_cygwin_shell); } + # ... direct parent for "tar.gz" installations, ... $glob_basedir= dirname($glob_mysql_test_dir); + # ... or one more level up, for RPM installations. + if ( ! -d "$glob_basedir/bin" ) + { + $glob_basedir= dirname($glob_basedir); + } + # "mysql-bench" might be installed, but need not be. $glob_mysql_bench_dir= "$glob_basedir/mysql-bench"; # FIXME make configurable + if ( ! -d "$glob_mysql_bench_dir" ) + { + $glob_mysql_bench_dir= undef; + } # needs to be same length to test logging (FIXME what???) $path_slave_load_tmpdir= "../../var/tmp"; @@ -646,6 +657,13 @@ sub command_line_setup () { $opt_vardir= "$glob_mysql_test_dir/$opt_vardir"; } + # Ensure a proper error message + mkpath("$opt_vardir"); + unless ( -d $opt_vardir and -w $opt_vardir ) + { + mtr_error("Writable 'var' directory is needed, use the '--vardir' option"); + } + # -------------------------------------------------------------------------- # If not set, set these to defaults # -------------------------------------------------------------------------- @@ -984,7 +1002,8 @@ sub executable_setup () { else { $exe_mysqld= mtr_exe_exists ("$glob_basedir/libexec/mysqld", - "$glob_basedir/bin/mysqld"); + "$glob_basedir/bin/mysqld", + "$glob_basedir/sbin/mysqld"); } if ( $glob_use_embedded_server ) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index 15c7470a74c..6f74cbe75b0 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -158,18 +158,29 @@ fi # Misc. Definitions #-- -if [ -d ../sql ] ; then +# BASEDIR is always above mysql-test directory ... +MYSQL_TEST_DIR=`pwd` +cd .. + +if [ -d ./sql ] ; then SOURCE_DIST=1 else BINARY_DIST=1 fi -#BASEDIR is always one above mysql-test directory -CWD=`pwd` -cd .. -BASEDIR=`pwd` -cd $CWD -MYSQL_TEST_DIR=$BASEDIR/mysql-test +# ... one level for tar.gz, two levels for a RPM installation +if [ -d ./bin ] ; then + # this is not perfect: we have + # /usr/share/mysql/ # mysql-test-run is here, so this is "$MYSQL_TEST_DIR" + # /usr/bin/ # with MySQL client programs + # so the existence of "/usr/share/bin/" would make this test fail. + BASEDIR=`pwd` +else + cd .. + BASEDIR=`pwd` +fi + +cd $MYSQL_TEST_DIR MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR MYSQLTEST_VARDIR=$MYSQL_TEST_DIR/var export MYSQL_TEST_DIR MYSQL_TEST_WINDIR MYSQLTEST_VARDIR @@ -648,8 +659,15 @@ else if test -x "$BASEDIR/libexec/mysqld" then MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld" - else + elif test -x "$BASEDIR/bin/mysqld" + then MYSQLD="$VALGRIND $BASEDIR/bin/mysqld" + elif test -x "$BASEDIR/sbin/mysqld" + then + MYSQLD="$VALGRIND $BASEDIR/sbin/mysqld" + else + $ECHO "Fatal error: Cannot find program mysqld in $BASEDIR/{libexec,bin,sbin}" 1>&2 + exit 1 fi CLIENT_BINDIR="$BASEDIR/bin" if test -d "$BASEDIR/tests" @@ -1261,7 +1279,7 @@ start_master() then $ECHO "set args $master_args" > $GDB_MASTER_INIT$1 $ECHO "To start gdb for the master , type in another window:" - $ECHO "cd $CWD ; gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD" + $ECHO "cd $MYSQL_TEST_DIR ; gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD" wait_for_master=1500 else ( $ECHO set args $master_args; @@ -1377,7 +1395,7 @@ start_slave() then $ECHO "set args $slave_args" > $GDB_SLAVE_INIT echo "To start gdb for the slave, type in another window:" - echo "cd $CWD ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD" + echo "cd $MYSQL_TEST_DIR ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD" wait_for_slave=1500 else ( $ECHO set args $slave_args; From 7c2ff3c307aed920fad9946a4cb7793d5071be6e Mon Sep 17 00:00:00 2001 From: "kent/mysqldev@suse9-x86.mysql.com" <> Date: Fri, 3 Nov 2006 02:35:09 +0100 Subject: [PATCH 06/17] sort.c: Create block around DBUG_ENTER late in function --- myisam/sort.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index 154d50d4d39..e888ce3b5df 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -322,8 +322,12 @@ pthread_handler_decl(thr_find_all_keys,arg) if (my_thread_init()) goto err; - DBUG_ENTER("thr_find_all_keys"); - DBUG_PRINT("enter", ("master: %d", sort_param->master)); + + { /* Expands to declaration, create new block */ + DBUG_ENTER("thr_find_all_keys"); /* FIXME why no matching DBUG_RETURN ? */ + DBUG_PRINT("enter", ("master: %d", sort_param->master)); + } + if (sort_param->sort_info->got_error) goto err; From 1d66d35fb3fac4412b173fd2d9a5495e248adcdf Mon Sep 17 00:00:00 2001 From: "iggy@rolltop.ignatz42.dyndns.org" <> Date: Thu, 2 Nov 2006 21:03:41 -0500 Subject: [PATCH 07/17] Fix compile failure. --- myisam/sort.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/myisam/sort.c b/myisam/sort.c index e888ce3b5df..67b93db5145 100644 --- a/myisam/sort.c +++ b/myisam/sort.c @@ -315,6 +315,7 @@ pthread_handler_decl(thr_find_all_keys,arg) uint memavl,old_memavl,keys,sort_length; uint idx, maxbuffer; uchar **sort_keys=0; + DBUG_ENTER("thr_find_all_keys"); /* FIXME why no matching DBUG_RETURN ? */ LINT_INIT(keys); @@ -323,10 +324,7 @@ pthread_handler_decl(thr_find_all_keys,arg) if (my_thread_init()) goto err; - { /* Expands to declaration, create new block */ - DBUG_ENTER("thr_find_all_keys"); /* FIXME why no matching DBUG_RETURN ? */ - DBUG_PRINT("enter", ("master: %d", sort_param->master)); - } + DBUG_PRINT("enter", ("master: %d", sort_param->master)); if (sort_param->sort_info->got_error) goto err; From f15d3d8a71836ee7baa622ee01e3e547db2b47e5 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Tue, 7 Nov 2006 16:01:54 +0100 Subject: [PATCH 08/17] Fix bug#24023: Let "ndb/src/common/portlib/gcc.cpp" export a dummy symbol. --- ndb/src/common/portlib/gcc.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ndb/src/common/portlib/gcc.cpp b/ndb/src/common/portlib/gcc.cpp index 66aa4812dc6..557c1ac3717 100644 --- a/ndb/src/common/portlib/gcc.cpp +++ b/ndb/src/common/portlib/gcc.cpp @@ -4,4 +4,7 @@ */ #ifdef DEFINE_CXA_PURE_VIRTUAL extern "C" { int __cxa_pure_virtual() { return 0;} } +#else +/* Some compiler/linker combinations fail on files without exported symbols. */ +extern "C" { int dummy_export_symbol() { return 0;} } #endif From dce6efd035d95cd057447a426f954394d8bdadca Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Thu, 9 Nov 2006 17:43:31 +0100 Subject: [PATCH 09/17] mysql-test/install_test_db.sh Adapt to the different path of the server program, if installation was by RPM. Missing in the first changeset for bug#17194. --- mysql-test/install_test_db.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index 4554b92857e..c30583503dc 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (C) 1997-2002 MySQL AB +# Copyright (C) 1997-2006 MySQL AB # For a more info consult the file COPYRIGHT distributed with this file # This scripts creates the privilege tables db, host, user, tables_priv, @@ -7,19 +7,26 @@ if [ x$1 = x"--bin" ]; then shift 1 + BINARY_DIST=1 + + bindir=../bin + scriptdir=../bin + libexecdir=../libexec # Check if it's a binary distribution or a 'make install' if test -x ../libexec/mysqld then execdir=../libexec + elif test -x ../../sbin/mysqld # RPM installation + then + execdir=../../sbin + bindir=../../bin + scriptdir=../../bin + libexecdir=../../libexec else execdir=../bin fi - bindir=../bin - BINARY_DIST=1 fix_bin=mysql-test - scriptdir=../bin - libexecdir=../libexec else execdir=../sql bindir=../client From cddbb0f8173800fd8431be4df178bc042702b9eb Mon Sep 17 00:00:00 2001 From: "kent@mysql.com/c-634072d5.010-2112-6f72651.cust.bredbandsbolaget.se" <> Date: Sat, 11 Nov 2006 14:12:30 +0100 Subject: [PATCH 10/17] mysql-test-run.pl: Test for base directory when a RPM install corrected --- mysql-test/mysql-test-run.pl | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 36006d1f156..ce9fd4344ea 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -467,7 +467,7 @@ sub initial_setup () { $glob_hostname= mtr_short_hostname(); - # 'basedir' is always above "mysql-test" directory ... + # Find the absolute path to the test directory $glob_mysql_test_dir= cwd(); if ( $glob_cygwin_perl ) { @@ -475,12 +475,20 @@ sub initial_setup () { $glob_mysql_test_dir= `cygpath -m "$glob_mysql_test_dir"`; chomp($glob_mysql_test_dir); } - # ... direct parent for "tar.gz" installations, ... - $glob_basedir= dirname($glob_mysql_test_dir); - # ... or one more level up, for RPM installations. - if ( ! -d "$glob_basedir/bin" ) + + # In most cases, the base directory we find everything relative to, + # is the parent directory of the "mysql-test" directory. For source + # distributions, TAR binary distributions and some other packages. + $glob_basedir= dirname($glob_mysql_test_dir); + + # In the RPM case, binaries and libraries are installed in the + # default system locations, instead of having our own private base + # directory. And we install "/usr/share/mysql-test". Moving up one + # more directory relative to "mysql-test" gives us a usable base + # directory for RPM installs. + if ( ! $opt_source_dist and ! -d "$glob_basedir/bin" ) { - $glob_basedir= dirname($glob_basedir); + $glob_basedir= dirname($glob_basedir); } # Expect mysql-bench to be located adjacent to the source tree, by default From a863fbbf4155be655eb9775447b5b18203f19355 Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Tue, 14 Nov 2006 14:29:05 +0100 Subject: [PATCH 11/17] make dist now copies .test files in mysql-test/include --- mysql-test/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index 1e6eb12f7b2..9fb66fecfa8 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -55,6 +55,7 @@ dist-hook: -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t $(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include + $(INSTALL_DATA) $(srcdir)/include/*.test $(distdir)/include $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data @@ -82,6 +83,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include + $(INSTALL_DATA) $(srcdir)/include/*.test $(DESTDIR)$(testdir)/include $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.*001 $(DESTDIR)$(testdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data From 5d8525c6f7c0a4ac6dc24e717c6ebb74c5d6f6ba Mon Sep 17 00:00:00 2001 From: "df@kahlann.erinye.com" <> Date: Tue, 14 Nov 2006 14:44:20 +0100 Subject: [PATCH 12/17] make_binary_distribution should of course also copy .test files from mysql-test/include --- scripts/make_binary_distribution.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/make_binary_distribution.sh b/scripts/make_binary_distribution.sh index f37e667dd86..6359eb009ce 100644 --- a/scripts/make_binary_distribution.sh +++ b/scripts/make_binary_distribution.sh @@ -224,6 +224,7 @@ $CP mysql-test/lib/*.pl $BASE/mysql-test/lib $CP mysql-test/lib/*.sql $BASE/mysql-test/lib $CP mysql-test/t/*.def $BASE/mysql-test/t $CP mysql-test/include/*.inc $BASE/mysql-test/include +$CP mysql-test/include/*.test $BASE/mysql-test/include $CP mysql-test/std_data/*.dat mysql-test/std_data/*.*001 \ mysql-test/std_data/*.cnf \ $BASE/mysql-test/std_data From 65d6b24ed9d2aec30ae6584357ca5f916197399e Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Wed, 15 Nov 2006 20:27:02 +0100 Subject: [PATCH 13/17] support-files/mysql.spec.sh : Use "report features" in the first test run. --- support-files/mysql.spec.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 1daac2d0e95..1547a5b578d 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -317,7 +317,10 @@ then cp -fp config.log "$MYSQL_MAXCONFLOG_DEST" fi -make -i test-force || true +( cd mysql-test + perl ./mysql-test-run.pl --force --report-features + perl ./mysql-test-run.pl --force --ps-protocol + true ) # Save mysqld-max ./libtool --mode=execute cp sql/mysqld sql/mysqld-max @@ -380,7 +383,10 @@ then cp -fp config.log "$MYSQL_CONFLOG_DEST" fi -make -i test-force || true +( cd mysql-test + perl ./mysql-test-run.pl --force --report-features + perl ./mysql-test-run.pl --force --ps-protocol + true ) %install RBR=$RPM_BUILD_ROOT @@ -716,6 +722,11 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Wed Nov 15 2006 Joerg Bruehe + +- Switch from "make test*" to explicit calls of the test suite, + so that "report features" can be used. + * Tue Jun 27 2006 Joerg Bruehe - move "mysqldumpslow" from the client RPM to the server RPM (bug#20216) From 29dd8d2e588937545013fe42f46394cb19b5d533 Mon Sep 17 00:00:00 2001 From: "joerg@trift2." <> Date: Thu, 16 Nov 2006 14:01:31 +0100 Subject: [PATCH 14/17] support-files/mysql.spec.sh : Add an "Obsoletes" note relative to SuSE RPMs (bug#22081). --- support-files/mysql.spec.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh index 1547a5b578d..b14ffd24894 100644 --- a/support-files/mysql.spec.sh +++ b/support-files/mysql.spec.sh @@ -170,6 +170,8 @@ necessary to develop MySQL client applications. %package shared Summary: MySQL - Shared libraries Group: Applications/Databases +Provides: mysql-shared +Obsoletes: mysql-shared %description shared This package contains the shared libraries (*.so*) which certain @@ -722,6 +724,12 @@ fi # itself - note that they must be ordered by date (important when # merging BK trees) %changelog +* Thu Nov 16 2006 Joerg Bruehe + +- Explicitly note that the "MySQL-shared" RPMs (as built by MySQL AB) + replace "mysql-shared" (as distributed by SuSE) to allow easy upgrading + (bug#22081). + * Wed Nov 15 2006 Joerg Bruehe - Switch from "make test*" to explicit calls of the test suite, From 8809a5e27e4e2fa2e0fa0bf3359e750fae4128de Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Mon, 20 Nov 2006 13:02:49 +0100 Subject: [PATCH 15/17] mysql_client_test not found when running from binary dist Look in bin for myql_client_test executable --- mysql-test/mysql-test-run.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 74ec2a02c12..a1dfed2c57c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1499,7 +1499,7 @@ sub executable_setup () { $exe_mysql_client_test= mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'), "$glob_basedir/tests/mysql_client_test", - "$glob_basedir/bin"); + "$glob_basedir/bin/mysql_client_test"); } } From 8e6cf24d3b766440fc506b12a7de63ff54441f70 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 09:56:50 +0100 Subject: [PATCH 16/17] Fix my_system_gmt_sec function declaration to be same as definition --- sql-common/my_time.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql-common/my_time.c b/sql-common/my_time.c index 2dd40c112de..003442e9330 100644 --- a/sql-common/my_time.c +++ b/sql-common/my_time.c @@ -780,7 +780,7 @@ long calc_daynr(uint year,uint month,uint day) */ my_time_t my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone, - bool *in_dst_time_gap) + my_bool *in_dst_time_gap) { uint loop; time_t tmp= 0; From 2aa0d085e35b0a2594d22c57b3402a3b686370c7 Mon Sep 17 00:00:00 2001 From: "msvensson@neptunus.(none)" <> Date: Thu, 23 Nov 2006 11:38:44 +0100 Subject: [PATCH 17/17] Build fixes for NetWare --- client/mysql_upgrade.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index e2b5931c2eb..520d87b5ed7 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -373,22 +373,24 @@ static int comp_names(struct fileinfo *a, struct fileinfo *b) } -static int -find_file(const char *name, const char *root, uint flags, char *result, size_t len, ...) +static int find_file(const char *name, const char *root, + uint flags, char *result, size_t len, ...) { - int ret; + int ret= 1; va_list va; - FILEINFO key= { (char*)name, NULL }; const char *subdir; char *cp; - + FILEINFO key; + + /* Init key with name of the file to look for */ + key.name= (char*)name; + DBUG_ASSERT(root != NULL); cp= strmake(result, root, len); if (cp[-1] != FN_LIBCHAR) *cp++= FN_LIBCHAR; - ret= 1; va_start(va, len); subdir= (!(flags & MY_SEARCH_SELF)) ? va_arg(va, char *) : ""; while (subdir)