List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:November 10 2006 7:02pm
Subject:bk commit into 5.1 tree (joerg:1.2353)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of joerg. When joerg does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-11-10 20:02:33+01:00, joerg@trift2. +15 -0
  Merge trift2.:/MySQL/M50/push-5.0
  into  trift2.:/MySQL/M51/push-5.1
  MERGE: 1.1810.1698.175

  BitKeeper/deleted/.del-gcc.cpp~3d2e013cfac48838@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.2.2.3

  configure.in@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.245.1.163

  include/my_time.h@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.11.1.3

  mysql-test/install_test_db.sh@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.35.1.1

  mysql-test/mysql-test-run-shell.sh@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.262.15.2

  mysql-test/mysql-test-run-shell.sh@stripped, 2006-11-10 20:02:24+01:00, joerg@trift2. +0 -0
    Merge rename: mysql-test/mysql-test-run.sh -> mysql-test/mysql-test-run-shell.sh

  mysql-test/mysql-test-run.pl@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.30.49.7

  mysql-test/r/func_time.result@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.47.1.28

  mysql-test/r/rename.result@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.13.1.3

  mysql-test/t/func_time.test@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.41.1.21

  mysql-test/t/rename.test@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.15.1.1

  sql-common/my_time.c@stripped, 2006-11-10 20:02:26+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.19.1.4

  sql/item_timefunc.cc@stripped, 2006-11-10 20:02:25+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.100.1.31

  sql/mysql_priv.h@stripped, 2006-11-10 20:02:26+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.290.1.131

  sql/time.cc@stripped, 2006-11-10 20:02:26+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.57.1.6

  storage/myisam/sort.c@stripped, 2006-11-10 20:02:26+01:00, joerg@trift2. +0 -0
    Auto merged
    MERGE: 1.45.13.2

  storage/myisam/sort.c@stripped, 2006-11-10 20:02:24+01:00, joerg@trift2. +0 -0
    Merge rename: myisam/sort.c -> storage/myisam/sort.c

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	joerg
# Host:	trift2.
# Root:	/MySQL/M51/push-5.1/RESYNC

--- 1.45.13.1/myisam/sort.c	2006-11-10 20:02:44 +01:00
+++ 1.61/storage/myisam/sort.c	2006-11-10 20:02:44 +01:00
@@ -461,6 +461,7 @@
     close_cached_file(&sort_param->tempfile_for_exceptions);
 
 ok:
+    free_root(&sort_param->wordroot, MYF(0));
     /*
       Detach from the share if the writer is involved. Avoid others to
       be blocked. This includes a flush of the write buffer. This will
@@ -477,7 +478,6 @@
     if (!--sort_param->sort_info->threads_running)
       pthread_cond_signal(&sort_param->sort_info->cond);
     pthread_mutex_unlock(&sort_param->sort_info->mutex);
-
     DBUG_PRINT("exit", ("======== ending thread ========"));
   }
   my_thread_end();

--- 1.37/mysql-test/install_test_db.sh	2006-11-10 20:02:44 +01:00
+++ 1.38/mysql-test/install_test_db.sh	2006-11-10 20:02:44 +01:00
@@ -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

--- 1.262.15.1/mysql-test/mysql-test-run.sh	2006-11-10 20:02:44 +01:00
+++ 1.334/mysql-test/mysql-test-run-shell.sh	2006-11-10 20:02:44 +01:00
@@ -7,6 +7,12 @@
 # List of failed cases (--force) backported from 4.1 by Joerg
 # :-)
 
+#echo "##################################################";
+#echo "This script is deprecated and will soon be removed";
+#echo "Use mysql-test-run.pl instead";
+#echo "##################################################";
+#echo
+
 #++
 # Access Definitions
 #--
@@ -232,8 +238,8 @@
 #
 # Set LD_LIBRARY_PATH if we are using shared libraries
 #
-LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/zlib/.libs:$LD_LIBRARY_PATH"
-DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/zlib/.libs:$DYLD_LIBRARY_PATH"
+LD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/libmysql_r/.libs:$BASEDIR/zlib/.libs:$LD_LIBRARY_PATH"
+DYLD_LIBRARY_PATH="$BASEDIR/lib:$BASEDIR/libmysql/.libs:$BASEDIR/libmysql_r/.libs:$BASEDIR/zlib/.libs:$DYLD_LIBRARY_PATH"
 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH
 
 #
@@ -245,14 +251,14 @@
 
 MASTER_RUNNING=0
 MASTER1_RUNNING=0
+MASTER_MYHOST=127.0.0.1
 MASTER_MYPORT=9306
 SLAVE_RUNNING=0
+SLAVE_MYHOST=127.0.0.1
 SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests
-MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves
-NDBCLUSTER_PORT=9350
-MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
 MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
-MYSQL_MANAGER_USER=root
+NDBCLUSTER_PORT=9350
+NDBCLUSTER_PORT_SLAVE=9358
 
 #
 # To make it easier for different devs to work on the same host,
@@ -266,15 +272,15 @@
 #
 if [ -n "$MTR_BUILD_THREAD" ] ; then
   MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 10 + 10000`
-  MYSQL_MANAGER_PORT=`expr $MASTER_MYPORT + 2`
   SLAVE_MYPORT=`expr $MASTER_MYPORT + 3`
   NDBCLUSTER_PORT=`expr $MASTER_MYPORT + 6`
+  NDBCLUSTER_PORT_SLAVE=`expr $MASTER_MYPORT + 7`
 
-  echo "Using MTR_BUILD_THREAD   = $MTR_BUILD_THREAD"
-  echo "Using MASTER_MYPORT      = $MASTER_MYPORT"
-  echo "Using MYSQL_MANAGER_PORT = $MYSQL_MANAGER_PORT"
-  echo "Using SLAVE_MYPORT       = $SLAVE_MYPORT"
-  echo "Using NDBCLUSTER_PORT    = $NDBCLUSTER_PORT"
+  echo "Using MTR_BUILD_THREAD      = $MTR_BUILD_THREAD"
+  echo "Using MASTER_MYPORT         = $MASTER_MYPORT"
+  echo "Using SLAVE_MYPORT          = $SLAVE_MYPORT"
+  echo "Using NDBCLUSTER_PORT       = $NDBCLUSTER_PORT"
+  echo "Using NDBCLUSTER_PORT_SLAVE = $NDBCLUSTER_PORT_SLAVE"
 fi
 
 NO_SLAVE=0
@@ -285,12 +291,19 @@
 EXTRA_MYSQL_TEST_OPT=""
 EXTRA_MYSQLCHECK_OPT=""
 EXTRA_MYSQLDUMP_OPT=""
+EXTRA_MYSQLSLAP_OPT=""
 EXTRA_MYSQLSHOW_OPT=""
 EXTRA_MYSQLBINLOG_OPT=""
 USE_RUNNING_SERVER=0
 USE_NDBCLUSTER=@USE_NDBCLUSTER@
+USE_NDBCLUSTER_SLAVE=@USE_NDBCLUSTER@
+USE_NDBCLUSTER_ALL=0
 USE_NDBCLUSTER_ONLY=0
 USE_RUNNING_NDBCLUSTER=""
+USE_RUNNING_NDBCLUSTER_SLAVE=""
+NDB_EXTRA_TEST=0
+NDB_VERBOSE=0
+NDBCLUSTER_EXTRA_OPTS=""
 USE_PURIFY=""
 PURIFY_LOGS=""
 DO_GCOV=""
@@ -316,6 +329,8 @@
 NDB_MGM_EXTRA_OPTS=
 NDB_MGMD_EXTRA_OPTS=
 NDBD_EXTRA_OPTS=
+MASTER_MYSQLDBINLOG=1
+SLAVE_MYSQLDBINLOG=1
 
 DO_STRESS=""
 STRESS_SUITE="main"
@@ -337,6 +352,7 @@
       USE_MANAGER=0 NO_SLAVE=1
       USE_RUNNING_SERVER=0
       USE_NDBCLUSTER=""
+      USE_NDBCLUSTER_SLAVE=""
       TEST_MODE="$TEST_MODE embedded" ;;
     --purify)
       USE_PURIFY=1
@@ -346,7 +362,6 @@
     --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
     --force)  FORCE=1 ;;
     --timer)  USE_TIMER=1 ;;
-    --verbose-manager)  MANAGER_QUIET_OPT="" ;;
     --old-master) MASTER_40_ARGS="";;
     --master-binary=*)
       MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
@@ -356,6 +371,12 @@
     --extern)  USE_RUNNING_SERVER=1 ;;
     --with-ndbcluster)
       USE_NDBCLUSTER="--ndbcluster" ;;
+    --with-ndbcluster-slave)
+      USE_NDBCLUSTER_SLAVE="--ndbcluster" ;;
+    --with-ndbcluster-all)
+      USE_NDBCLUSTER="--ndbcluster"
+      USE_NDBCLUSTER_SLAVE="--ndbcluster"
+      USE_NDBCLUSTER_ALL=1 ;;
     --with-ndbcluster-only)
       USE_NDBCLUSTER="--ndbcluster"
       USE_NDBCLUSTER_SLAVE="--ndbcluster"
@@ -363,6 +384,15 @@
     --ndb-connectstring=*)
       USE_NDBCLUSTER="--ndbcluster" ;
       USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;;
+    --ndb-connectstring-slave=*)
+      USE_NDBCLUSTER_SLAVE="--ndbcluster" ;
+      USE_RUNNING_NDBCLUSTER_SLAVE=`$ECHO "$1" | $SED -e "s;--ndb-connectstring-slave=;;"` ;;
+    --ndb-extra-test)
+      NDBCLUSTER_EXTRA_OPTS=" "
+      NDB_EXTRA_TEST=1 ;
+      ;;
+    --ndb-verbose)
+      NDB_VERBOSE=2 ;;
     --ndb_mgm-extra-opts=*)
       NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;;
     --ndb_mgmd-extra-opts=*)
@@ -377,8 +407,9 @@
       LOCAL_MASTER=1 ;;
     --master_port=*) MASTER_MYPORT=`$ECHO "$1" | $SED -e "s;--master_port=;;"` ;;
     --slave_port=*) SLAVE_MYPORT=`$ECHO "$1" | $SED -e "s;--slave_port=;;"` ;;
-    --manager-port=*) MYSQL_MANAGER_PORT=`$ECHO "$1" | $SED -e "s;--manager_port=;;"` ;;
     --ndbcluster_port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster_port=;;"` ;;
+    --ndbcluster-port=*) NDBCLUSTER_PORT=`$ECHO "$1" | $SED -e "s;--ndbcluster-port=;;"` ;;
+    --ndbcluster-port-slave=*) NDBCLUSTER_PORT_SLAVE=`$ECHO "$1" | $SED -e "s;--ndbcluster-port-slave=;;"` ;;
     --with-openssl)
      EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \
      --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
@@ -391,11 +422,6 @@
      MYSQL_TEST_SSL_OPTS="--ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
      --ssl-cert=$MYSQL_TEST_DIR/std_data/client-cert.pem \
      --ssl-key=$MYSQL_TEST_DIR/std_data/client-key.pem" ;;
-    --no-manager | --skip-manager) USE_MANAGER=0 ;;
-    --manager)
-     USE_MANAGER=1
-     USE_RUNNING_SERVER=0
-     ;;
     --start-and-exit)
      START_AND_EXIT=1
      ;;
@@ -521,8 +547,8 @@
     --valgrind | --valgrind-all)
       find_valgrind;
       VALGRIND=$FIND_VALGRIND
-      EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc --skip-bdb"
-      EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc --skip-bdb"
+      EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-safemalloc"
+      EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-safemalloc"
       SLEEP_TIME_AFTER_RESTART=10
       SLEEP_TIME_FOR_DELETE=60
       USE_RUNNING_SERVER=0
@@ -535,6 +561,10 @@
       TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"`
       VALGRIND="$VALGRIND $TMP"
       ;;
+    --skip-ndbcluster-slave | --skip-ndb-slave)
+      USE_NDBCLUSTER_SLAVE=""
+      EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-ndbcluster"
+      ;;
     --valgrind-mysqltest | --valgrind-mysqltest-all)
       find_valgrind;
       VALGRIND_MYSQLTEST=$FIND_VALGRIND
@@ -545,9 +575,12 @@
       ;;
     --skip-ndbcluster | --skip-ndb)
       USE_NDBCLUSTER=""
+      USE_NDBCLUSTER_SLAVE=""
       EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-ndbcluster"
       EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-ndbcluster"
       ;;
+    --skip-master-binlog) MASTER_MYSQLDBINLOG=0 ;;
+    --skip-slave-binlog) SLAVE_MYSQLDBINLOG=0 ;;
     --skip-*)
       EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $1"
       EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $1"
@@ -566,6 +599,8 @@
        --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlcheck.trace"
       EXTRA_MYSQLDUMP_OPT="$EXTRA_MYSQLDUMP_OPT \
        --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqldump.trace"
+      EXTRA_MYSQLSLAP_OPT="$EXTRA_MYSQLSLAP_OPT \
+       --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlslap.trace"
       EXTRA_MYSQLSHOW_OPT="$EXTRA_MYSQLSHOW_OPT \
        --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlshow.trace"
       EXTRA_MYSQLBINLOG_OPT="$EXTRA_MYSQLBINLOG_OPT \
@@ -604,7 +639,6 @@
 #--
 
 MYRUN_DIR=$MYSQL_TEST_DIR/var/run
-MANAGER_PID_FILE="$MYRUN_DIR/manager.pid"
 
 MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data"
 MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock"
@@ -622,9 +656,13 @@
 CURRENT_TEST="$MYSQL_TEST_DIR/var/log/current_test"
 SMALL_SERVER="--key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M"
 
-export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
+export MASTER_MYHOST MASTER_MYPORT SLAVE_MYHOST SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
 
 NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --data-dir=$MYSQL_TEST_DIR/var --ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS --ndbd-extra-opts=$NDBD_EXTRA_OPTS"
+NDBCLUSTER_OPTS_SLAVE="--port=$NDBCLUSTER_PORT_SLAVE --data-dir=$MYSQL_TEST_DIR/var"
+if [ -n "$USE_NDBCLUSTER_SLAVE" ] ; then
+  USE_NDBCLUSTER_SLAVE="$USE_NDBCLUSTER_SLAVE --ndb-connectstring=localhost:$NDBCLUSTER_PORT_SLAVE --ndb-extra-logging"
+fi
 NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT
 NDB_TOOLS_OUTPUT=$MYSQL_TEST_DIR/var/log/ndb_tools.log
 
@@ -688,6 +726,11 @@
  else
    MYSQL_DUMP="$BASEDIR/client/mysqldump"
  fi
+ if [ -f "$BASEDIR/client/.libs/mysqlslap" ] ; then
+   MYSQL_SLAP="$BASEDIR/client/.libs/mysqlslap"
+ else
+   MYSQL_SLAP="$BASEDIR/client/mysqlslap"
+ fi
  if [ -f "$BASEDIR/client/.libs/mysqlimport" ] ; then
    MYSQL_IMPORT="$BASEDIR/client/.libs/mysqlimport"
  else
@@ -711,16 +754,13 @@
  MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
  WAIT_PID="$BASEDIR/extra/mysql_waitpid"
  MYSQL_MY_PRINT_DEFAULTS="$BASEDIR/extra/my_print_defaults"
- MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
- MYSQL_MANAGER="$BASEDIR/tools/mysqltestmanager"
- MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
  MYSQL="$CLIENT_BINDIR/mysql"
  LANGUAGE="$BASEDIR/sql/share/english/"
  CHARSETSDIR="$BASEDIR/sql/share/charsets"
  INSTALL_DB="./install_test_db"
  MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/scripts/mysql_fix_privilege_tables"
- NDB_TOOLS_DIR="$BASEDIR/ndb/tools"
- NDB_MGM="$BASEDIR/ndb/src/mgmclient/ndb_mgm"
+ NDB_TOOLS_DIR="$BASEDIR/storage/ndb/tools"
+ NDB_MGM="$BASEDIR/storage/ndb/src/mgmclient/ndb_mgm"
 
  if [ -n "$USE_PURIFY" ] ; then
    PSUP="$MYSQL_TEST_DIR/suppress.purify"
@@ -774,16 +814,13 @@
  fi
  MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
  MYSQL_CHECK="$CLIENT_BINDIR/mysqlcheck"
- MYSQL_DUMP="$CLIENT_BINDIR/mysqldump"
+ MYSQL_SLAP="$CLIENT_BINDIR/mysqlslap"
  MYSQL_SHOW="$CLIENT_BINDIR/mysqlshow"
  MYSQL_IMPORT="$CLIENT_BINDIR/mysqlimport"
  MYSQL_BINLOG="$CLIENT_BINDIR/mysqlbinlog"
  MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
  WAIT_PID="$CLIENT_BINDIR/mysql_waitpid"
  MYSQL_MY_PRINT_DEFAULTS="$CLIENT_BINDIR/my_print_defaults"
- MYSQL_MANAGER="$CLIENT_BINDIR/mysqltestmanager"
- MYSQL_MANAGER_CLIENT="$CLIENT_BINDIR/mysqltestmanagerc"
- MYSQL_MANAGER_PWGEN="$CLIENT_BINDIR/mysqltestmanager-pwgen"
  MYSQL="$CLIENT_BINDIR/mysql"
  INSTALL_DB="./install_test_db --bin"
  MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
@@ -813,6 +850,13 @@
    MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
    MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test"
  fi
+ if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
+   MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
+ elif  [ -f "$BASEDIR/client/mysqldump" ] ; then
+   MYSQL_DUMP="$BASEDIR/client/mysqldump"
+ else
+   MYSQL_DUMP="$BASEDIR/bin/mysqldump"
+ fi
 fi
 
 if [ -z "$MASTER_MYSQLD" ]
@@ -858,13 +902,16 @@
 export MYSQL_DUMP_DIR
 MYSQL_CHECK="$MYSQL_CHECK --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT"
 MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
+MYSQL_SLAP="$MYSQL_SLAP -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSLAP_OPT"
+MYSQL_DUMP_SLAVE="$MYSQL_DUMP_DIR --no-defaults -uroot --socket=$SLAVE_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
 MYSQL_SHOW="$MYSQL_SHOW -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
 MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR  --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
 MYSQL_IMPORT="$MYSQL_IMPORT -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT"
 MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose"
 MYSQL="$MYSQL --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
-export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
+export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_DUMP_SLAVE MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES MYSQL_IMPORT
 export CLIENT_BINDIR MYSQL_CLIENT_TEST CHARSETSDIR MYSQL_MY_PRINT_DEFAULTS
+export MYSQL_SLAP
 export NDB_TOOLS_DIR
 export NDB_MGM
 export NDB_BACKUP_DIR
@@ -872,6 +919,9 @@
 export PURIFYOPTIONS
 NDB_STATUS_OK=1
 export NDB_STATUS_OK
+NDB_SLAVE_STATUS_OK=1
+export NDB_SLAVE_STATUS_OK
+export NDB_EXTRA_TEST NDBCLUSTER_PORT NDBCLUSTER_PORT_SLAVE
 
 MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
  --user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
@@ -1003,6 +1053,10 @@
 report_current_test () {
    tname=$1
    echo "CURRENT_TEST: $tname" >> $MASTER_MYERR
+   eval "master1_running=\$MASTER1_RUNNING"
+   if [ x$master1_running = x1 ] ; then
+     echo "CURRENT_TEST: $tname" >> $MASTER_MYERR"1"
+   fi
    if [ -n "$PURIFY_LOGS" ] ; then
      for log in $PURIFY_LOGS
      do
@@ -1037,13 +1091,13 @@
     #
     $RM -f $MY_LOG_DIR/warnings $MY_LOG_DIR/warnings.tmp
     # Remove some non fatal warnings from the log files
-    $SED -e 's!Warning:  Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \
+    $SED -e 's!Warning:  Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' -e 's|InnoDB: Warning: we did not need to do crash recovery||g' \
         $MY_LOG_DIR/*.err \
         | $SED -e 's!Warning:  Table:.* on rename!!g' \
         > $MY_LOG_DIR/warnings.tmp
 
     # Find errors
-    for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning"
+    for i in "^Warning:" "^Error:" "^==.* at 0x" "InnoDB: Warning" "missing DBUG_RETURN" "mysqld: Warning" "Attempting backtrace" "Assertion .* failed"
     do
       if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
       then
@@ -1085,7 +1139,10 @@
     if [ ! -z "$USE_NDBCLUSTER" ]
     then
       $ECHO "Installing Master Databases 1"
-      $INSTALL_DB -1
+#     $INSTALL_DB -1
+      $RM -rf var/master-data1
+      mkdir var/master-data1
+      cp -r var/master-data/* var/master-data1
       if [ $? != 0 ]; then
 	error "Could not install master test DBs 1"
 	exit 1
@@ -1093,7 +1150,9 @@
     fi
     $ECHO "Installing Slave Databases"
     $RM -rf $SLAVE_MYDDIR $MY_LOG_DIR/* 
-    $INSTALL_DB -slave
+#    $INSTALL_DB -slave
+    mkdir var/slave-data
+    cp -r var/master-data/* var/slave-data
     if [ $? != 0 ]; then
 	error "Could not install slave test DBs"
 	exit 1
@@ -1155,118 +1214,58 @@
  fi
 }
 
-start_manager()
-{
- if [ $USE_MANAGER = 0 ] ; then
-   echo "Manager disabled, skipping manager start."
-   $RM -f $MYSQL_MANAGER_LOG
-  return
- fi
- $ECHO "Starting MySQL Manager"
- if [ -f "$MANAGER_PID_FILE" ] ; then
-    kill `cat $MANAGER_PID_FILE`
-    sleep 1
-    if [ -f "$MANAGER_PID_FILE" ] ; then
-     kill -9 `cat $MANAGER_PID_FILE`
-     sleep 1
-    fi
- fi
-
- $RM -f $MANAGER_PID_FILE
- MYSQL_MANAGER_PW=`$MYSQL_MANAGER_PWGEN -u $MYSQL_MANAGER_USER \
- -o $MYSQL_MANAGER_PW_FILE`
- $MYSQL_MANAGER --log=$MYSQL_MANAGER_LOG --port=$MYSQL_MANAGER_PORT \
-  --password-file=$MYSQL_MANAGER_PW_FILE --pid-file=$MANAGER_PID_FILE
-  abort_if_failed "Could not start MySQL manager"
-  mysqltest_manager_args="--manager-host=localhost \
-  --manager-user=$MYSQL_MANAGER_USER \
-  --manager-password=$MYSQL_MANAGER_PW \
-  --manager-port=$MYSQL_MANAGER_PORT \
-  --manager-wait-timeout=$START_WAIT_TIMEOUT"
-  MYSQL_TEST="$MYSQL_TEST $mysqltest_manager_args"
-  MYSQL_TEST_ARGS="$MYSQL_TEST_ARGS $mysqltest_manager_args"
-  while [ ! -f $MANAGER_PID_FILE ] ; do
-   sleep 1
-  done
-  echo "Manager started"
-}
-
-stop_manager()
-{
- if [ $USE_MANAGER = 0 ] ; then
-  return
- fi
- $MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT -u$MYSQL_MANAGER_USER \
-  -p$MYSQL_MANAGER_PW -P $MYSQL_MANAGER_PORT <<EOF
-shutdown
-EOF
- echo "Manager terminated"
-
-}
-
-manager_launch()
+launch_in_background()
 {
-  ident=$1
   shift
-  if [ $USE_MANAGER = 0 ] ; then
-    echo $@ | /bin/sh  >> $CUR_MYERR 2>&1  &
-    sleep 2 #hack
-    return
-  fi
-  $MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
-   --password=$MYSQL_MANAGER_PW  --port=$MYSQL_MANAGER_PORT <<EOF
-def_exec $ident "$@"
-set_exec_stdout $ident $CUR_MYERR
-set_exec_stderr $ident $CUR_MYERR
-set_exec_con $ident root localhost $CUR_MYSOCK
-start_exec $ident $START_WAIT_TIMEOUT
-EOF
-  abort_if_failed "Could not execute manager command"
+  echo $@ | /bin/sh  >> $CUR_MYERR 2>&1  &
+  sleep 2 #hack
+  return
 }
 
-manager_term()
+shutdown_mysqld()
 {
   pid=$1
   ident=$2
-  if [ $USE_MANAGER = 0 ] ; then
-    # Shutdown time must be high as slave may be in reconnect
-    $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
-    res=$?
-    # Some systems require an extra connect
-    $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
-    if test $res = 0
-    then
-      wait_for_pid $pid
-    fi
-    return $res
+  # Shutdown time must be high as slave may be in reconnect
+  $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=5 --shutdown_timeout=70 shutdown >> $MYSQL_MANAGER_LOG 2>&1
+  res=$?
+  # Some systems require an extra connect
+  $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$ident.sock$3 --connect_timeout=1 ping >> $MYSQL_MANAGER_LOG 2>&1
+  if test $res = 0
+  then
+    wait_for_pid $pid
   fi
-  $MYSQL_MANAGER_CLIENT $MANAGER_QUIET_OPT --user=$MYSQL_MANAGER_USER \
-   --password=$MYSQL_MANAGER_PW  --port=$MYSQL_MANAGER_PORT <<EOF
-stop_exec $ident $STOP_WAIT_TIMEOUT
-EOF
- abort_if_failed "Could not execute manager command"
+  return $res
 }
 
 start_ndbcluster()
 {
-  if [ ! -z "$USE_NDBCLUSTER" ]
+  if [ ! -n "$USE_NDBCLUSTER" ] ;
+  then
+    USING_NDBCLUSTER=0
+    USE_NDBCLUSTER_OPT=
+  fi
+  
+  if [ x$USING_NDBCLUSTER = x1 -a -z "$USE_NDBCLUSTER_OPT" ]
   then
   rm -f $NDB_TOOLS_OUTPUT
   if [ -z "$USE_RUNNING_NDBCLUSTER" ]
   then
-    echo "Starting ndbcluster"
-    if [ "$DO_BENCH" = 1 ]
+    if [ "$DO_BENCH" != 1 -a -z "$NDBCLUSTER_EXTRA_OPTS" ]
     then
-      NDBCLUSTER_EXTRA_OPTS=""
-    else
       NDBCLUSTER_EXTRA_OPTS="--small"
     fi
-    ./ndb/ndbcluster $NDBCLUSTER_OPTS --character-sets-dir=$CHARSETSDIR $NDBCLUSTER_EXTRA_OPTS --initial || NDB_STATUS_OK=0
+    OPTS="$NDBCLUSTER_OPTS $NDBCLUSTER_EXTRA_OPTS --character-sets-dir=$CHARSETSDIR --verbose=$NDB_VERBOSE --initial --relative-config-data-dir --core"
+    if [ "x$NDB_VERBOSE" != "x0" ] ; then
+      echo "Starting master ndbcluster " $OPTS
+    fi
+    ./ndb/ndbcluster $OPTS || NDB_STATUS_OK=0
     if [ x$NDB_STATUS_OK != x1 ] ; then
       if [ x$FORCE != x1 ] ; then
         exit 1
       fi
-      USE_NDBCLUSTER=
+      USING_NDBCLUSTER=0
+      USE_NDBCLUSTER_OPT=
       return
     fi
 
@@ -1275,19 +1274,30 @@
     NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
     echo "Using ndbcluster at $NDB_CONNECTSTRING"
   fi
-  USE_NDBCLUSTER="$USE_NDBCLUSTER --ndb-connectstring=\"$NDB_CONNECTSTRING\""
+  USE_NDBCLUSTER_OPT="$USE_NDBCLUSTER --ndb-connectstring=\"$NDB_CONNECTSTRING\" --ndb-extra-logging"
   export NDB_CONNECTSTRING
   fi
 }
 
+rm_ndbcluster_tables()
+{
+  $RM -f $1/cluster/apply_status*
+  $RM -f $1/cluster/schema*
+}
+
 stop_ndbcluster()
 {
- if [ ! -z "$USE_NDBCLUSTER" ]
+ if [ -n "$USE_NDBCLUSTER_OPT" ]
  then
+ USE_NDBCLUSTER_OPT=
  if [ -z "$USE_RUNNING_NDBCLUSTER" ]
  then
    # Kill any running ndbcluster stuff
+   $ECHO "Stopping master cluster"
    ./ndb/ndbcluster $NDBCLUSTER_OPTS --stop
+   # remove ndb table the hard way as not to upset later tests
+   rm_ndbcluster_tables $MASTER_MYDDIR
+   rm_ndbcluster_tables $MASTER_MYDDIR"1"
  fi
  fi
 }
@@ -1332,9 +1342,13 @@
   then
       CURR_MASTER_MYSQLD_TRACE="$EXTRA_MASTER_MYSQLD_TRACE$1"
   fi
+  if [ x$MASTER_MYSQLDBINLOG = x1 ]
+  then
+    MASTER_MYSQLD_BINLOG_OPT="--log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1"
+  fi
   if [ -z "$DO_BENCH" -a -z "$DO_STRESS"  ]
   then
-    master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
+    master_args="--no-defaults \
   	    --server-id=$id  \
           --basedir=$MY_BASEDIR \
           --port=$this_master_myport \
@@ -1342,7 +1356,7 @@
           --local-infile \
           --exit-info=256 \
           --core \
-          $USE_NDBCLUSTER \
+          $USE_NDBCLUSTER_OPT \
           --datadir=$MASTER_MYDDIR$1 \
           --pid-file=$MASTER_MYPID$1 \
           --socket=$MASTER_MYSOCK$1 \
@@ -1356,10 +1370,11 @@
           --log-bin-trust-function-creators \
 	   $MASTER_40_ARGS \
            $SMALL_SERVER \
-           $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
+           $MASTER_MYSQLD_BINLOG_OPT \
+           $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
            $NOT_FIRST_MASTER_EXTRA_OPTS $CURR_MASTER_MYSQLD_TRACE"
   else
-    master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \
+    master_args="--no-defaults \
           --server-id=$id --rpl-recovery-rank=1 \
           --basedir=$MY_BASEDIR --init-rpl-role=master \
           --port=$this_master_myport \
@@ -1371,14 +1386,15 @@
           --character-sets-dir=$CHARSETSDIR \
           --default-character-set=$CHARACTER_SET \
           --core \
-          $USE_NDBCLUSTER \
+          $USE_NDBCLUSTER_OPT \
           --tmpdir=$MYSQL_TMP_DIR \
           --language=$LANGUAGE \
           --innodb_data_file_path=ibdata1:128M:autoextend \
           --log-bin-trust-function-creators \
 	   $MASTER_40_ARGS \
            $SMALL_SERVER \
-           $EXTRA_MASTER_OPT $EXTRA_MASTER_MYSQLD_OPT \
+           $MASTER_MYSQLD_BINLOG_OPT \
+           $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
            $NOT_FIRST_MASTER_EXTRA_OPTS"
   fi
 
@@ -1400,7 +1416,7 @@
   if [ x$DO_DDD = x1 ]
   then
     $ECHO "set args $master_args" > $GDB_MASTER_INIT$1
-    manager_launch master ddd -display $DISPLAY --debugger \
+    launch_in_background master ddd -display $DISPLAY --debugger \
     "gdb -x $GDB_MASTER_INIT$1" $MASTER_MYSQLD
   elif [ x$DO_GDB = x1 ]
   then
@@ -1421,11 +1437,11 @@
 r
 EOF
       fi )  > $GDB_MASTER_INIT$1
-      manager_launch master $XTERM -display $DISPLAY \
+      launch_in_background master $XTERM -display $DISPLAY \
       -title "Master" -e gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD
     fi
   else
-    manager_launch master $MASTER_MYSQLD $master_args
+    launch_in_background master $MASTER_MYSQLD $master_args
   fi
   sleep_until_file_created $MASTER_MYPID$1 $wait_for_master
   wait_for_master=$SLEEP_TIME_FOR_SECOND_MASTER
@@ -1437,6 +1453,7 @@
   [ x$SKIP_SLAVE = x1 ] && return
   eval "this_slave_running=\$SLAVE$1_RUNNING"
   [ x$this_slave_running = 1 ] && return
+
   # When testing fail-safe replication, we will have more than one slave
   # in this case, we start secondary slaves with an argument
   slave_ident="slave$1"
@@ -1460,6 +1477,38 @@
    slave_pid=$SLAVE_MYPID
    slave_sock="$SLAVE_MYSOCK"
  fi
+
+  #
+  if [ x$USING_NDBCLUSTER = x1 -a -n "$USE_NDBCLUSTER_SLAVE" ] ; then
+    if [ $slave_server_id -eq 2 ] ; then
+      savedir=`pwd`
+      cd $MYSQL_TEST_DIR
+      if [ "$DO_BENCH" != 1 -a -z "$NDBCLUSTER_EXTRA_OPTS" ]
+       then
+         NDBCLUSTER_EXTRA_OPTS="--small"
+      fi
+
+      OPTS="$NDBCLUSTER_OPTS_SLAVE --initial $NDBCLUSTER_EXTRA_OPTS --ndbd-nodes=1 --verbose=$NDB_VERBOSE --relative-config-data-dir --core"
+      if [ "x$NDB_VERBOSE" != "x0" ] ; then
+        echo "Starting slave ndbcluster " $OPTS
+      fi
+      ./ndb/ndbcluster $OPTS \
+                      || NDB_SLAVE_STATUS_OK=0
+      #                > /dev/null 2>&1 || NDB_SLAVE_STATUS_OK=0
+      cd $savedir
+      if [ x$NDB_SLAVE_STATUS_OK != x1 ] ; then
+        if [ x$FORCE != x1 ] ; then
+          exit 1
+        fi
+        USE_NDBCLUSTER_SLAVE_OPT=
+        USE_NDBCLUSTER_SLAVE=
+      fi
+      USE_NDBCLUSTER_SLAVE_OPT=$USE_NDBCLUSTER_SLAVE
+    fi
+  else
+    USE_NDBCLUSTER_SLAVE_OPT=
+  fi
+
   # Remove stale binary logs and old master.info files
   # except for too tests which need them
   if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ]
@@ -1485,12 +1534,16 @@
    master_info=$SLAVE_MASTER_INFO
  fi
 
+  if [ x$SLAVE_MYSQLDBINLOG = x1 ]
+  then
+    SLAVE_MYSQLD_BINLOG_OPT="--log-bin=$MYSQL_TEST_DIR/var/log/$slave_ident-bin --log-slave-updates"
+  fi
+
   $RM -f $slave_datadir/log.*
   slave_args="--no-defaults $master_info \
   	    --exit-info=256 \
-          --log-bin=$MYSQL_TEST_DIR/var/log/$slave_ident-bin \
+          $SLAVE_MYSQLDBINLOG_OPT \
           --relay-log=$MYSQL_TEST_DIR/var/log/$slave_ident-relay-bin \
-          --log-slave-updates \
           --log=$slave_log \
           --basedir=$MY_BASEDIR \
           --datadir=$slave_datadir \
@@ -1511,14 +1564,16 @@
           -O slave_net_timeout=10 \
           --log-bin-trust-function-creators \
            $SMALL_SERVER \
-           $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
+           $SLAVE_MYSQLD_BINLOG_OPT \
+           $EXTRA_SLAVE_MYSQLD_OPT $EXTRA_SLAVE_OPT \
+           $USE_NDBCLUSTER_SLAVE_OPT"
   CUR_MYERR=$slave_err
   CUR_MYSOCK=$slave_sock
 
   if [ x$DO_DDD = x1 ]
   then
     $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
-    manager_launch $slave_ident ddd -display $DISPLAY --debugger \
+    launch_in_background $slave_ident ddd -display $DISPLAY --debugger \
      "gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD
   elif [ x$DO_GDB = x1 ]
   then
@@ -1539,11 +1594,11 @@
 r
 EOF
       fi )  > $GDB_SLAVE_INIT
-      manager_launch $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
+      launch_in_background $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
       gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD
     fi
   else
-    manager_launch $slave_ident $SLAVE_MYSQLD $slave_args
+    launch_in_background $slave_ident $SLAVE_MYSQLD $slave_args
   fi
   eval "SLAVE$1_RUNNING=1"
   sleep_until_file_created $slave_pid $wait_for_slave
@@ -1559,7 +1614,6 @@
 #  start_master
 #  start_slave
   cd $MYSQL_TEST_DIR
-  start_ndbcluster
   return 1
 }
 
@@ -1576,7 +1630,7 @@
   if [ x$this_slave_running = x1 ]
   then
     pid=`$CAT $slave_pid`
-    manager_term $pid $slave_ident
+    shutdown_mysqld $pid $slave_ident
     if [ $? != 0 ] && [ -f $slave_pid ]
     then # try harder!
       $ECHO "slave not cooperating with mysqladmin, will try manual kill"
@@ -1593,6 +1647,14 @@
       sleep $SLEEP_TIME_AFTER_RESTART
     fi
     eval "SLAVE$1_RUNNING=0"
+    if [ -n "$USE_NDBCLUSTER_SLAVE_OPT" ] ; then
+      savedir=`pwd`
+      cd $MYSQL_TEST_DIR
+        $ECHO "Stopping slave cluster"
+      ./ndb/ndbcluster $NDBCLUSTER_OPTS_SLAVE --stop
+      rm_ndbcluster_tables $SLAVE_MYDDIR
+      cd $savedir
+    fi
   fi
 }
 
@@ -1615,7 +1677,7 @@
     # MASTER_RUNNING=0 to get cleanup when calling start_master().
     if [ x$USE_EMBEDDED_SERVER != x1 ] ; then
       pid=`$CAT $MASTER_MYPID$1`
-      manager_term $pid master $1
+      shutdown_mysqld $pid master $1
       if [ $? != 0 ] && [ -f $MASTER_MYPID$1 ]
       then # try harder!
 	$ECHO "master not cooperating with mysqladmin, will try manual kill"
@@ -1682,6 +1744,9 @@
  echo $tname > $CURRENT_TEST
  SKIP_SLAVE=`$EXPR \( $tname : rpl \) = 0 \& \( $tname : federated \) = 0`
  NDBCLUSTER_TEST=`$EXPR \( $tname : '.*ndb.*' \) != 0`
+ if [ "x$USE_NDBCLUSTER_ALL" = "x1" ] ; then
+   NDBCLUSTER_TEST=1
+ fi
  if [ "x$USE_NDBCLUSTER_ONLY" = "x1" -a "x$NDBCLUSTER_TEST" != "x1" ] ; then
    skip_test $tname
    return
@@ -1778,9 +1843,20 @@
      esac
      stop_master
      stop_master 1
+
+     # only stop the cluster if this test will not use cluster
+     if [ x$NDBCLUSTER_TEST != x1 ] ;
+     then
+       stop_ndbcluster
+     fi
+
      report_current_test $tname
+     USING_NDBCLUSTER=$NDBCLUSTER_TEST
+     # start_ndbcluster knows if cluster is already started
+     start_ndbcluster
      start_master
-     if [ -n "$USE_NDBCLUSTER" -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
+     if [ x$USING_NDBCLUSTER = x1 -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
+       echo "CURRENT_TEST: $tname" >> $MASTER_MYERR"1"
        start_master 1
      fi
      TZ=$MY_TZ; export TZ
@@ -1789,14 +1865,26 @@
      # or there is no master running (FIXME strange.....)
      # or there is a master init script
      if [ ! -z "$EXTRA_MASTER_OPT" ] || [ x$MASTER_RUNNING != x1 ] || \
-	[ -f $master_init_script ]
+	[ -f $master_init_script ] || \
+        [ -n "$USE_NDBCLUSTER" -a x$NDBCLUSTER_TEST != x$USING_NDBCLUSTER ]
      then
        EXTRA_MASTER_OPT=""
        stop_master
        stop_master 1
+
+       # only stop the cluster if this test will not use cluster
+       if [ x$NDBCLUSTER_TEST != x1 ] ;
+       then
+         stop_ndbcluster
+       fi
+
        report_current_test $tname
+       USING_NDBCLUSTER=$NDBCLUSTER_TEST
+       # start_ndbcluster knows if cluster is already started
+       start_ndbcluster
        start_master
-       if [ -n "$USE_NDBCLUSTER"  -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
+       if [ x$USING_NDBCLUSTER = x1  -a -z "$DO_BENCH" -a -z "$DO_STRESS" ] ; then
+         echo "CURRENT_TEST: $tname" >> $MASTER_MYERR"1"
          start_master 1
        fi
      else
@@ -1830,6 +1918,18 @@
        fi
      fi
 
+     USING_NDBCLUSTER=$NDBCLUSTER_TEST
+     if [ -n "$USE_NDBCLUSTER_SLAVE_OPT" ] ; then
+       if [ x$USING_NDBCLUSTER != x1 ] ; then
+         do_slave_restart=1
+       fi
+     else
+       if [ x$USING_NDBCLUSTER = x1 ] ; then
+         do_slave_restart=1
+       fi
+     fi
+
+
      if [ x$do_slave_restart = x1 ] ; then
        stop_slave
        echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR
@@ -1906,7 +2006,6 @@
 	    [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
 	 then
 	   mysql_stop
-	   stop_manager
    	 fi
 	 exit 1
 	fi
@@ -2065,10 +2164,10 @@
     $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
     $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK1 -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
     $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
-    $MYSQLADMIN --no-defaults --host=$hostname --port=$MASTER_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
-    $MYSQLADMIN --no-defaults --host=$hostname --port=`expr $MASTER_MYPORT+1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
-    $MYSQLADMIN --no-defaults --host=$hostname --port=$SLAVE_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
-    $MYSQLADMIN --no-defaults --host=$hostname --port=`expr $SLAVE_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
+    $MYSQLADMIN --no-defaults --host=$hostname --port=$MASTER_MYPORT --protocol=tcp -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
+    $MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $MASTER_MYPORT+1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
+    $MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=$SLAVE_MYPORT -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
+    $MYSQLADMIN --no-defaults --host=$hostname --protocol=tcp --port=`expr $SLAVE_MYPORT + 1` -u root -O connect_timeout=5 -O shutdown_timeout=20 shutdown > /dev/null 2>&1
     sleep_until_file_deleted 0 $MASTER_MYPID
     sleep_until_file_deleted 0 $MASTER_MYPID"1"
     sleep_until_file_deleted 0 $SLAVE_MYPID
@@ -2076,22 +2175,13 @@
     rm $MASTER_MYPID $MASTER_MYPID"1" $SLAVE_MYPID
   fi
 
-  # Kill any running managers
-  if [ -f "$MANAGER_PID_FILE" ]
-  then
-    kill `cat $MANAGER_PID_FILE`
-    sleep 1
-    if [ -f "$MANAGER_PID_FILE" ]
-    then
-      kill -9 `cat $MANAGER_PID_FILE`
-      sleep 1
-    fi
-  fi
-
+  # just to force stopping anything from previous runs
+  USE_NDBCLUSTER_OPT=$USE_NDBCLUSTER
   stop_ndbcluster
 
   # Remove files that can cause problems
   $RM -rf $MYSQL_TEST_DIR/var/ndbcluster
+  $RM -rf $MYSQL_TEST_DIR/var/tmp/snapshot*
   $RM -f $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
 
   # Remove old berkeley db log files that can confuse the server
@@ -2105,10 +2195,10 @@
 
   if [ -n "$1" -a `expr "X$*" : '.*ndb'` -eq 0 ]
   then
-    USE_NDBCLUSTER=""
+    USING_NDBCLUSTER=0
+    USE_NDBCLUSTER_OPT=
   fi
 
-  start_manager
   mysql_start
   $ECHO  "Loading Standard Test Databases"
   mysql_loadstd
@@ -2131,7 +2221,7 @@
     EXTRA_BENCH_ARGS="--small-test --small-tables"
   fi
 
-  if [ ! -z "$USE_NDBCLUSTER" ]
+  if [ x$USING_NDBCLUSTER = x1 ]
   then
     EXTRA_BENCH_ARGS="--create-options=TYPE=ndb $EXTRA_BENCH_ARGS"
   fi 
@@ -2152,7 +2242,6 @@
   fi
   cd $savedir
   mysql_stop
-  stop_manager
   exit
 fi
 
@@ -2174,7 +2263,6 @@
 
   if [ $USE_RUNNING_SERVER -eq 0 ] ; then
     mysql_stop
-    stop_manager
   fi
   
   exit
@@ -2221,7 +2309,6 @@
 then
     mysql_stop
 fi
-stop_manager
 report_stats
 $ECHO
 

--- 1.6/BitKeeper/deleted/.del-gcc.cpp~3d2e013cfac48838	2006-11-10 20:02:44 +01:00
+++ 1.7/BitKeeper/deleted/.del-gcc.cpp~3d2e013cfac48838	2006-11-10 20:02:44 +01:00
@@ -4,4 +4,7 @@
  */
 #if 0
 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

--- 1.229/mysql-test/mysql-test-run.pl	2006-11-10 20:02:44 +01:00
+++ 1.230/mysql-test/mysql-test-run.pl	2006-11-10 20:02:44 +01:00
@@ -220,6 +220,7 @@
 
 our $opt_record;
 our $opt_check_testcases;
+my  $opt_report_features;
 
 our $opt_skip;
 our $opt_skip_rpl;
@@ -642,7 +643,7 @@
 
   $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 )
   {
@@ -650,11 +651,19 @@
     $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" )
+  {
+    $glob_basedir=       dirname($glob_basedir);
+  }
 
   # Expect mysql-bench to be located adjacent to the source tree, by default
   $glob_mysql_bench_dir= "$glob_basedir/../mysql-bench"
     unless defined $glob_mysql_bench_dir;
+  $glob_mysql_bench_dir= undef
+    unless -d $glob_mysql_bench_dir;
 
   $path_my_basedir=
     $opt_source_dist ? $glob_mysql_test_dir : $glob_basedir;
@@ -682,7 +691,8 @@
 				       "$path_client_bindir/mysqld-debug",
 				       "$path_client_bindir/mysqld-max",
 				       "$glob_basedir/libexec/mysqld",
-				       "$glob_basedir/bin/mysqld");
+				       "$glob_basedir/bin/mysqld",
+				       "$glob_basedir/sbin/mysqld");
 
   # Use the mysqld found above to find out what features are available
   collect_mysqld_features();
@@ -799,6 +809,13 @@
     $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");
+  }
+
   # --------------------------------------------------------------------------
   # Set tmpdir
   # --------------------------------------------------------------------------
@@ -1320,7 +1337,9 @@
   $exe_im=
     mtr_exe_maybe_exists(
       "$glob_basedir/server-tools/instance-manager/mysqlmanager",
-      "$glob_basedir/libexec/mysqlmanager");
+      "$glob_basedir/libexec/mysqlmanager",
+      "$glob_basedir/bin/mysqlmanager",
+      "$glob_basedir/sbin/mysqlmanager");
 
   return ($exe_im eq "");
 }

--- 1.16/mysql-test/t/rename.test	2006-11-10 20:02:44 +01:00
+++ 1.17/mysql-test/t/rename.test	2006-11-10 20:02:44 +01:00
@@ -60,9 +60,6 @@
 connection con2;
 show tables;
 UNLOCK TABLES;
-connection con1;
-reap;
-connection con2;
 
 # Wait for the the tables to be renamed
 # i.e the query below succeds
Thread
bk commit into 5.1 tree (joerg:1.2353)Joerg Bruehe10 Nov