From 25b72e97d2b1768385ab82988bc8fe7ac3a53c81 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 1 Nov 2006 20:17:10 +0100 Subject: [PATCH 1/5] 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: Modifications to use this script in a RPM installation (bug#17194): - The tests are one level further down, "/usr/share/mysqltest" (vs. "/usr/bin"). - A "mysql-bench" might not exist. - "mysql-test" is owned by root and not world-writable, so "var" must be put somewhere else. - The server, "mysqld", is in a different location, "/usr/sbin". Note that the "--vardir" option must be used in a RPM installation, unless "mysql-test" is made writable for the user who runs the tests (not done automatically). mysql-test/mysql-test-run.sh: Necessary changes if this script is to be used with a RPM installation (bug#17194): - The tests are one level further down, "/usr/share/mysqltest" (vs. "/usr/bin"). - The server, "mysqld", is in a different location, "/usr/sbin". Note that these changes are not sufficient, as the user needs a writable "mysql-test/var" subdirectory. Either this is created manually, or the script can not be used. An alternative is the corresponding Perl script which supports a "--vardir" option. --- 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 7483373801312351c9b7f15a389e800d4c6abae9 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Nov 2006 02:35:09 +0100 Subject: [PATCH 2/5] sort.c: Create block around DBUG_ENTER late in function myisam/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 e3fd562c0a74124bba385e22fd577f69bb7417ec Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 2 Nov 2006 21:03:41 -0500 Subject: [PATCH 3/5] Fix compile failure. myisam/sort.c: Moved DBUG_PRINT statement to declaration section. --- 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 6f65b2c0cc264cbdc9c2749dad89d71a4b73c626 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 7 Nov 2006 16:01:54 +0100 Subject: [PATCH 4/5] Fix bug#24023: Let "ndb/src/common/portlib/gcc.cpp" export a dummy symbol. ndb/src/common/portlib/gcc.cpp: Fix bug#24023: Make sure this module always exports some symbol, whether used anywhere or not. --- 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 62e0e608ffd20db7471439b62f4b41ea9ab29dbc Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 9 Nov 2006 17:43:31 +0100 Subject: [PATCH 5/5] 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: 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