Below is the list of changes that have just been committed into a local
5.1 repository of msvensson. When msvensson 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, 2007-12-06 15:24:36+01:00, msvensson@stripped +18 -0
Remwrite Makefile for mysql-test
Remove old files and directories
BitKeeper/deleted/.del-Makefile.am~343467da4d0f211b@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/Makefile.am
BitKeeper/deleted/.del-basic.result@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/basic.result
BitKeeper/deleted/.del-basic.test@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/basic.test
BitKeeper/deleted/.del-basic_log.result@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/basic_log.result
BitKeeper/deleted/.del-install_test_db.sh@stripped, 2007-12-06 10:46:56+01:00, msvensson@stripped +0 -0
Delete: mysql-test/install_test_db.sh
BitKeeper/deleted/.del-kill_master.sh@stripped, 2007-12-06 10:47:06+01:00, msvensson@stripped +0 -0
Delete: mysql-test/misc/kill_master.sh
BitKeeper/deleted/.del-mysql-test-run-shell.sh@stripped, 2007-12-06 10:48:00+01:00, msvensson@stripped +0 -0
Delete: mysql-test/mysql-test-run-shell.sh
BitKeeper/deleted/.del-mysql-test_V1.9.pl@stripped, 2007-12-06 10:47:11+01:00, msvensson@stripped +0 -0
Delete: mysql-test/misc/mysql-test_V1.9.pl
BitKeeper/deleted/.del-ndb_config_1_node.ini~7ec640ed25570e16@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/ndb_config_1_node.ini
BitKeeper/deleted/.del-ndb_config_2_node.ini@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/ndb_config_2_node.ini
BitKeeper/deleted/.del-ndb_config_4_node.ini~d8e572e9b68f933a@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/ndb_config_4_node.ini
BitKeeper/deleted/.del-ndbcluster.sh@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/ndbcluster.sh
BitKeeper/deleted/.del-resolve-stack@stripped, 2007-12-06 10:50:41+01:00, msvensson@stripped +0 -0
Delete: mysql-test/resolve-stack
BitKeeper/deleted/.del-restart.result@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/restart.result
BitKeeper/deleted/.del-restart.test@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/restart.test
BitKeeper/deleted/.del-restart_log.result@stripped, 2007-12-06 10:48:50+01:00, msvensson@stripped +0 -0
Delete: mysql-test/ndb/restart_log.result
configure.in@stripped, 2007-12-06 15:24:28+01:00, msvensson@stripped +1 -1
Remove mysql-test/ndb/Makefile from configure
mysql-test/Makefile.am@stripped, 2007-12-06 15:24:28+01:00, msvensson@stripped +22 -130
Rewrite Makefile for mysql-test
diff -Nrup a/configure.in b/configure.in
--- a/configure.in 2007-10-19 22:03:16 +02:00
+++ b/configure.in 2007-12-06 15:24:28 +01:00
@@ -2665,7 +2665,7 @@ AC_CONFIG_FILES(Makefile extra/Makefile
cmd-line-utils/Makefile cmd-line-utils/libedit/Makefile dnl
libmysqld/Makefile libmysqld/examples/Makefile dnl
mysql-test/Makefile dnl
- mysql-test/ndb/Makefile netware/Makefile sql-bench/Makefile dnl
+ netware/Makefile sql-bench/Makefile dnl
include/mysql_version.h plugin/Makefile win/Makefile)
AC_CONFIG_COMMANDS([default], , test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h)
diff -Nrup a/mysql-test/Makefile.am b/mysql-test/Makefile.am
--- a/mysql-test/Makefile.am 2007-11-08 14:04:45 +01:00
+++ b/mysql-test/Makefile.am 2007-12-06 15:24:28 +01:00
@@ -17,152 +17,44 @@
## Process this file with automake to create Makefile.in
-SUBDIRS = ndb
-
testdir = $(prefix)/mysql-test
-EXTRA_SCRIPTS = mysql-test-run-shell.sh install_test_db.sh \
- valgrind.supp $(PRESCRIPTS)
-EXTRA_DIST = $(EXTRA_SCRIPTS) suite lib
-GENSCRIPTS = mysql-test-run-shell install_test_db mtr mysql-test-run
-PRESCRIPTS = mysql-test-run.pl mysql-stress-test.pl
-test_SCRIPTS = $(GENSCRIPTS) $(PRESCRIPTS)
-CLEANFILES = $(GENSCRIPTS)
-
-INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I..
-
-
-dist-hook:
- mkdir -p \
- $(distdir)/t \
- $(distdir)/extra/binlog_tests \
- $(distdir)/extra/rpl_tests \
- $(distdir)/r \
- $(distdir)/include \
- $(distdir)/std_data \
- $(distdir)/std_data/ndb_backup50 \
- $(distdir)/std_data/ndb_backup51 \
- $(distdir)/std_data/ndb_backup51_data_be \
- $(distdir)/std_data/ndb_backup51_data_le \
- $(distdir)/lib
- -$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.sql $(distdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(distdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.opt $(srcdir)/t/*.slave-mi $(distdir)/t
- -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(distdir)/t
- $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(distdir)/extra/binlog_tests
- $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(distdir)/extra/rpl_tests
- -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(distdir)/extra/binlog_tests
- -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(distdir)/extra/rpl_tests
- $(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/Index.xml $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(distdir)/std_data/ndb_backup50
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(distdir)/std_data/ndb_backup51
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(distdir)/std_data/ndb_backup51_data_be
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(distdir)/std_data/ndb_backup51_data_le
- $(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
- -rm -rf `find $(distdir)/suite -type d -name SCCS` $(distdir)/suite/row_lock
+EXTRA_SCRIPTS = mysql-test-run.pl \
+ mysql-stress-test.pl
+
+EXTRA_DIST = README \
+ $(EXTRA_SCRIPTS) \
+ t r include suite extra \
+ lib std_data configs \
+ valgrind.supp
+
+test_SCRIPTS = mtr mysql-test-run
+
+CLEANFILES = $(test_SCRIPTS)
+
+
+# Install all files found in the dirs listed in EXTRA_DIST
install-data-local:
- $(mkinstalldirs) \
- $(DESTDIR)$(testdir)/t \
- $(DESTDIR)$(testdir)/extra/binlog_tests \
- $(DESTDIR)$(testdir)/extra/rpl_tests \
- $(DESTDIR)$(testdir)/r \
- $(DESTDIR)$(testdir)/include \
- $(DESTDIR)$(testdir)/std_data \
- $(DESTDIR)$(testdir)/std_data/ndb_backup50 \
- $(DESTDIR)$(testdir)/std_data/ndb_backup51 \
- $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be \
- $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le \
- $(DESTDIR)$(testdir)/lib
- $(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
- -$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.imtest $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/t/*.sql $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.disabled $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t
- -$(INSTALL_SCRIPT) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t
- -$(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t
- $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r
- $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r
- $(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.test $(DESTDIR)$(testdir)/extra/binlog_tests
- $(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.test $(DESTDIR)$(testdir)/extra/rpl_tests
- -$(INSTALL_DATA) $(srcdir)/extra/binlog_tests/*.opt $(DESTDIR)$(testdir)/extra/binlog_tests
- -$(INSTALL_DATA) $(srcdir)/extra/rpl_tests/*.opt $(DESTDIR)$(testdir)/extra/rpl_tests
- $(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
- $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/Index.xml $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.pem $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.frm $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.MY* $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_be
- $(INSTALL_DATA) $(srcdir)/std_data/ndb_backup51_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup51_data_le
- $(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
- for f in `(cd $(srcdir); find suite -type f | egrep -v 'SCCS|row_lock')`; \
+ for f in `(cd $(srcdir); find $(EXTRA_DIST) -type f)`; \
do \
d=$(DESTDIR)$(testdir)/`dirname $$f`; \
mkdir -p $$d ; \
$(INSTALL_DATA) $(srcdir)/$$f $$d ; \
done
+# Uninstall by removing the testdir
uninstall-local:
- @RM@ -f -r $(DESTDIR)$(testdir)
+ rm -f -r $(DESTDIR)$(testdir)
# mtr - a shortcut for executing mysql-test-run.pl
mtr:
- $(RM) -f mtr
- $(LN_S) mysql-test-run.pl mtr
+ rm -f mtr
+ ln -s $(srcdir)/mysql-test-run.pl mtr
# mysql-test-run - a shortcut for executing mysql-test-run.pl
mysql-test-run:
- $(RM) -f mysql-test-run
- $(LN_S) mysql-test-run.pl mysql-test-run
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''testdir''@!$(testdir)!g' \
- -e 's!@''bindir''@!$(bindir)!g' \
- -e 's!@''scriptdir''@!$(bindir)!g' \
- -e 's!@''prefix''@!$(prefix)!g' \
- -e 's!@''datadir''@!$(datadir)!g' \
- -e 's!@''localstatedir''@!$(localstatedir)!g' \
- -e 's!@''libexecdir''@!$(libexecdir)!g' \
- -e 's!@''PERL''@!@PERL@!' \
- -e 's!@''VERSION''@!@VERSION@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''MYSQL_TCP_PORT_DEFAULT''@!@MYSQL_TCP_PORT_DEFAULT@!' \
- -e 's!@''MYSQL_BASE_VERSION''@!@MYSQL_BASE_VERSION@!' \
- -e 's!@''MYSQL_UNIX_ADDR''@!@MYSQL_UNIX_ADDR@!' \
- -e 's!@''MYSQL_TCP_PORT''@!@MYSQL_TCP_PORT@!' \
- -e 's!@''MYSQL_NO_DASH_VERSION''@!@MYSQL_NO_DASH_VERSION@!' \
- -e 's!@''MYSQL_SERVER_SUFFIX''@!@MYSQL_SERVER_SUFFIX@!' \
- -e 's!@''USE_NDBCLUSTER''@!@TEST_NDBCLUSTER@!g' \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
+ rm -f mysql-test-run
+ ln -s $(srcdir)/mysql-test-run.pl mysql-test-run
# Don't update the files from bitkeeper
%::SCCS/s.%
diff -Nrup a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh
--- a/mysql-test/install_test_db.sh 2007-03-21 14:34:23 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,115 +0,0 @@
-#!/bin/sh
-# Copyright (C) 1997-2006 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This scripts creates the privilege tables db, host, user, tables_priv,
-# columns_priv in the mysql database, as well as the func table.
-
-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
- fix_bin=mysql-test
-else
- execdir=../sql
- bindir=../client
- fix_bin=.
- scriptdir=scripts
- libexecdir=../libexec
-fi
-
-vardir=var
-logdir=$vardir/log
-if [ x$1 = x"-slave" ]
-then
- shift 1
- data=var/slave-data
-else
- if [ x$1 = x"-1" ]
- then
- data=var/master-data1
- else
- data=var/master-data
- fi
-fi
-ldata=$fix_bin/$data
-
-mdata=$data/mysql
-EXTRA_ARG=""
-
-mysqld=
-if test -x $execdir/mysqld
-then
- mysqld=$execdir/mysqld
-else
- if test ! -x $libexecdir/mysqld
- then
- echo "mysqld is missing - looked in $execdir and in $libexecdir"
- exit 1
- else
- mysqld=$libexecdir/mysqld
- fi
-fi
-
-# On IRIX hostname is in /usr/bsd so add this to the path
-PATH=$PATH:/usr/bsd
-hostname=`hostname` # Install this too in the user table
-hostname="$hostname%" # Fix if not fully qualified hostname
-
-
-#create the directories
-[ -d $vardir ] || mkdir $vardir
-[ -d $logdir ] || mkdir $logdir
-
-# Create database directories mysql & test
-if [ -d $data ] ; then rm -rf $data ; fi
-mkdir $data $data/mysql $data/test
-
-#for error messages
-if [ x$BINARY_DIST = x1 ] ; then
-basedir=..
-else
-basedir=.
-EXTRA_ARG="--windows"
-fi
-
-INSTALL_CMD="$scriptdir/mysql_install_db --no-defaults $EXTRA_ARG --basedir=$basedir --datadir=mysql-test/$ldata --srcdir=."
-echo "running $INSTALL_CMD"
-
-cd ..
-if $INSTALL_CMD
-then
- exit 0
-else
- echo "Error executing mysqld --bootstrap"
- exit 1
-fi
diff -Nrup a/mysql-test/misc/kill_master.sh b/mysql-test/misc/kill_master.sh
--- a/mysql-test/misc/kill_master.sh 2006-05-12 18:26:39 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,4 +0,0 @@
-kill -9 `cat var/run/master.pid`
-# The kill may fail if process has already gone away,
-# so don't use the exit code of the kill. Use 0.
-exit 0
diff -Nrup a/mysql-test/misc/mysql-test_V1.9.pl b/mysql-test/misc/mysql-test_V1.9.pl
--- a/mysql-test/misc/mysql-test_V1.9.pl 2000-12-07 16:01:09 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,1121 +0,0 @@
-#!/usr/bin/perl
-#
-# Tests MySQL. Output is given to the stderr. Use
-# diff to check the possible differencies.
-#
-
-use DBI;
-use Getopt::Long;
-
-$VER = "1.9";
-$| = 1;
-
-$opt_db = "test";
-$opt_user = $opt_password = $opt_without = "";
-$opt_host = "localhost";
-$opt_port = "3306";
-$opt_socket = "/tmp/mysql.sock";
-$opt_help = 0;
-
-$NO_ERR = 0; # No error
-$EXP_ERR = 1; # Expect error
-$MAY_ERR = 2; # Maybe error
-$HS = 0; # Horizontal style of output
-$VS = 1; # Vertical style of output
-$VERBOSE = 0; # Print the results
-$SILENT = 1; # No output
-
-@test_packages = ("FUNC", "PROC", "SHOW");
-
-####
-#### main program
-####
-
-main();
-
-sub main()
-{
- GetOptions("help", "db=s", "port=i", "host=s", "password=s", "user=s", "socket=s",
- "without=s") || usage();
-
- usage() if ($opt_help);
-
- $dbh = DBI->connect("DBI:mysql:$opt_db:$opt_host:port=$opt_port:mysql_socket=$opt_socket", $opt_user, $opt_password, { PrintError => 0 })
- || die $DBI::errstr;
-
-## QQ ######################################
-
-$sth = $dbh->prepare("show felds from t2")
-|| die "Couldn't prepare query: $DBI::errstr\n";
-if (!$sth->execute)
-{
- print "Couldn't execute query: $DBI::errstr\n";
- $sth->finish;
- die;
-}
-while (($row = $sth->fetchrow_arrayref))
-{
- print "$row->[1]\n";
-}
-
-
-exit(0);
-
-## QQ ######################################
-
- printf("####\n#### THIS IS mysql-test script RUNNING\n");
- printf("#### mysql-test version $VER\n####\n");
-
- test_mysql_functions() if (&chk_package($opt_without, $test_packages[0]));
- test_mysql_procedures() if (&chk_package($opt_without, $test_packages[1]));
- test_mysql_show() if (&chk_package($opt_without, $test_packages[2]));
-
- print "\n";
- return;
-}
-
-####
-#### test show -command of MySQL
-####
-
-sub test_mysql_show
-{
- my ($query, $i);
-
- $query = create_show_tables();
- &exec_query(["drop table my_t"], $MAY_ERR, $SILENT);
- for ($i = 0; $query[$i]; $i++)
- {
- &exec_query([$query[$i]], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["show fields from my_t"], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["show keys from my_t"], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["drop table my_t"], $NO_ERR, $SILENT);
- }
-}
-
-sub create_show_tables
-{
- my ($query, $i);
-
- $query[0] = <<EOF;
-create table my_t (i int, f float, s char(64), b blob, t text)
-EOF
- $query[1] = <<EOF;
-create table my_t (i int, f float, s char(64), b blob, t text, primary key (i))
-EOF
- $query[2] = <<EOF;
-create table my_t (i int, f float, s char(64), b blob, t text, unique (i), unique(s))
-EOF
- for ($i = 0; $query[$i]; $i++) { chop($query[$i]); }
- return $query;
-}
-
-####
-#### test procedures, currently only procedure analyze()
-####
-
-sub test_mysql_procedures
-{
- test_analyze();
-}
-
-sub test_analyze
-{
- my ($query, $i, $j);
-
- if ($opt_help)
- {
- usage();
- }
- # invalid queries
- &exec_query(["select * from mails procedure analyse(-1)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse(10, -1)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse(1, 2, 3)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse(-10, 10)"],
- $EXP_ERR, $VERBOSE, $HS);
- &exec_query(["select * from mails procedure analyse('a', 'a')"],
- $EXP_ERR, $VERBOSE, $HS);
- # valid queries
-# &exec_query(["select * from mails procedure analyse(10)"], 0, 0);
-# &exec_query(["select * from mails procedure analyse(10, 10)"], 0, 0);
-# &exec_query(["select hash from mails procedure analyse()"], 0, 0);
- &exec_query(["use mysql_test"], $NO_ERR, $VERBOSE, $HS);
-# &exec_query(["select timestamp from w32_user procedure analyse(0)"], 0, 0);
- $query = create_test_tables();
- &exec_query(["drop table my_t"], $MAY_ERR, $SILENT);
- for ($i = 0; $query[$i][0]; $i++)
- {
- &exec_query([$query[$i][0]], $NO_ERR, $SILENT); # create table
- for ($j = 1; $query[$i][$j]; $j++)
- {
- &exec_query([$query[$i][$j]], $NO_ERR, $SILENT); # do inserts
- }
- &exec_query(["select * from my_t procedure analyse(0,0)"],
- $NO_ERR, $VERBOSE, $HS);
- &exec_query(["select * from my_t procedure analyse()"],
- $NO_ERR, $VERBOSE, $HS);
- &exec_query(["drop table my_t"], $NO_ERR, $SILENT);
- }
-}
-
-####
-#### if $opt is found as a part from the '--without=...' option string
-#### return 0, else 1. if zero is returned, then that part of MySQL
-#### won't be tested
-####
-
-sub chk_package
-{
- my ($opt_str, $opt) = @_;
-
- $sub_opt_str = '';
- for ($i = 0, $ptr = substr($opt_str, $i, 1); $ptr || $ptr eq '0';
- $i++, $ptr = substr($opt_str, $i, 1))
- {
- $sub_opt_str .= $ptr;
- if ($sub_opt_str eq $opt)
- {
- $next_chr = substr($opt_str, ($i + 1), 1);
- if ($next_chr eq ',' || (!$next_chr && $next_chr ne '0'))
- {
- return 0;
- }
- }
- if ($ptr eq ',')
- {
- # next word on the opt_str
- $sub_opt_str = '';
- }
- }
- return 1;
-}
-
-####
-#### Tests given function(s) with given value(s) $count rounds
-#### If function doesn't have an arg, test it once and continue.
-#### ulargs (number of unlimited args) is the number of arguments
-#### to be placed in place of '.' . '.' means that any number
-#### of the last argument type is possible to the function.
-#### If force is given, never mind about errors
-#### args: $func: list of functions to be tested
-#### $value: list of values to be used with functions
-#### $count: number of times one function should be tested
-#### $ulargs: number of unlimited args to be used when possible
-#### $table_info: information about the table to be used, contains:
-#### table name, info about the fields in the table, for example:
-#### [mysql_test1, "Zi", "Rd"], where mysql_test1 is the name of the
-#### table, "Zi" tells, that the first field name is 'i' and it is
-#### type 'Z' (integer), see test_mysql_functions, 'Rd' tells that
-#### the second field name is 'd' and the type is 'R' (real number)
-#### $force: if given, never mind about errors
-#### $mix: if 0, use the same argument at a time in a
-#### function that has two or more same type arguments
-#### if 1, use different values
-####
-
-sub test_func()
-{
- my ($func, $value, $count, $ulargs, $table_info, $force, $mix) = @_;
- my ($query, $i, $j, $k, $no_arg, $row, $ulimit, $tbinfo, $tbused, $arg);
-
- if (!$func->[0][0])
- {
- printf("No function found!\n");
- if (!$force) { die; }
- }
-
- for ($i = 0; $func->[$i][0]; $i++)
- {
- $tbused = 0;
- $no_arg = 0;
- for ($j = 0; $j < $count && !$no_arg; $j++)
- {
- if ($tbused || $no_arg) { next; }
- $query = "select $func->[$i][0](";
- #search the values for the args
- for ($k = 0; $k < length($func->[$i][1]) && !$no_arg; $k++)
- {
- if ($mix)
- {
- $arg = $j + 1 + $k;
- }
- else
- {
- $arg = $j + 1;
- }
- if (substr($func->[$i][1], $k, 1) eq 'E')
- {
- $no_arg = 1;
- next;
- }
- if ($k) { $query .= ','; }
-
- if (substr($func->[$i][1], $k, 1) eq 'S')
- {
- $query .= &find_value(\@value, 'S', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'N')
- {
- $query .= &find_value(\@value, 'N', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'Z')
- {
- $query .= &find_value(\@value, 'Z', $arg);
- }
- elsif ((substr($func->[$i][1], $k, 1) eq 'R'))
- {
- $query .= &find_value(\@value, 'R', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'T')
- {
- $query .= &find_value(\@value, 'T', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'D')
- {
- $query .= &find_value(\@value, 'D', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'B')
- {
- $query .= &find_value(\@value, 'B', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'C')
- {
- $query .= &find_value(\@value, 'C', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'F')
- {
- $query .= &find_value(\@value, 'F', $arg);
- }
- elsif (substr($func->[$i][1], $k, 1) eq '.')
- {
- chop($query);
- for ($ulimit = 0; $ulimit < $ulargs; $ulimit++)
- {
- $query .= ',';
- $query .= &find_value(\@value,
- substr($func->[$i][1], $k - 1, 1),
- $j + $ulimit + 2);
- }
- }
- elsif (substr($func->[$i][1], $k, 1) eq 'A')
- {
- for ($tbinfo = 1; substr($table_info->[$tbinfo], 0, 1) ne
- substr($func->[$i][1], $k + 1, 1); $tbinfo++)
- {
- if (!defined($table_info->[$tbinfo]))
- {
- printf("Illegal function structure!\n");
- printf("A table was needed, but no type specified!\n");
- printf("Unready query was: $query\n");
- if (!$force) { die; }
- else { next; }
- }
- }
- if ($k) { $query .= ","; }
- $query .= substr($table_info->[$tbinfo], 1,
- length($table_info->[$tbinfo]) - 1);
- $k++;
- $tbused = 1;
- }
- else
- {
- printf("Not a valid type: \n");
- printf(substr($func->[$i][1], $k, 1));
- printf("\nAttempted to be used with unready query: \n");
- printf("$query\n");
- }
- }
- $query .= ")";
- if ($tbused)
- {
- $query .= " from ";
- $query .= $table_info->[0];
- }
- if (!($sth = $dbh->prepare($query)))
- {
- printf("Couldn't prepare: $query\n");
- if (!$force) { die; }
- }
- if (!$sth->execute)
- {
- printf("Execution failed: $DBI::errstr\n");
- printf("Attempted query was:\n$query\n");
- $sth->finish;
- if (!$force) { die; }
- }
- else
- {
- printf("mysql> $query;\n");
- display($sth, 1);
- printf("Query OK\n\n");
- }
- }
- }
-}
-
-####
-#### mk_str returns a string where the first arg is repeated second arg times
-#### if repeat is 1, return the original str
-####
-
-sub mk_str()
-{
- my ($str, $repeat) = @_;
- my ($res_str);
-
- if ($repeat <= 0)
- {
- die "Invalid repeat times!\n";
- }
-
- for ($repeat--, $res_str = $str; $repeat > 0; $repeat--)
- {
- $res_str .= $str;
- }
- return $res_str;
-}
-
-####
-#### find_value: returns a value from list of values
-#### args: $values: list of values
-#### $type: type of argument (S = string, N = integer etc.)
-#### $ordinal: the ordinal number of an argument in the list
-####
-
-sub find_value()
-{
- my ($values, $type, $ordinal) = @_;
- my ($total, $i, $j, $tmp, $val);
-
- $total = -1; # The first one is the type
-
- for ($i = 0; $values[$i][0]; $i++)
- {
- if ($values[$i][0] eq $type)
- {
- $tmp = $values[$i];
- foreach $val (@$tmp) { $total++; }
- for ( ;$total < $ordinal; )
- {
- $ordinal -= $total;
- }
- return $values[$i][$ordinal];
- }
- }
- printf("No type '$type' found in values\n");
- die;
-}
-
-####
-#### exec_query: execute a query, print information if wanted and exit
-#### args: $queries: list of queries to be executed
-#### $expect_error: if 0, error is not expected. In this case if an
-#### error occurs, inform about it and quit
-#### if 1, error is expected. In this case if sql server
-#### doesn't give an error message, inform about it
-#### and quit
-#### if 2, error may happen or not, don't care
-#### $silent: if true, reduce output
-#### $style: type of output, 0 == horizontal, 1 == vertical
-####
-
-sub exec_query()
-{
- my ($queries, $expect_error, $silent, $style) = @_;
- my ($query);
-
- foreach $query (@$queries)
- {
- if (!($sth = $dbh->prepare($query)))
- {
- printf("Couldn't prepare: $query\n");
- die;
- }
- if (!$sth->execute)
- {
- if ($expect_error == 1)
- {
- printf("An invalid instruction was purposely made,\n");
- printf("server failed succesfully:\n");
- printf("$DBI::errstr\n");
- printf("Everything OK, continuing...\n");
- return;
- }
- if ($expect_error != 2)
- {
- printf("Execution failed: $DBI::errstr\n");
- printf("Attempted query was:\n$query\n");
- die;
- }
- }
- if ($expect_error == 1)
- {
- printf("An invalid instruction was purposely made,\n");
- printf("server didn't note, ALARM!\n");
- printf("The query made was: $query\n");
- printf("The output from the server:\n");
- }
- if ($expect_error == 2) { return; }
- if (!$silent) { printf("mysql> $query;\n"); }
- display($sth, $style);
- if (!$silent) { printf("Query OK\n\n"); }
- if ($expect_error) { die; }
- }
- return;
-}
-
-####
-#### Display to stderr
-#### Args: 1: ($sth) statememt handler
-#### 2: ($style) 0 == horizontal style, 1 == vertical style
-####
-
-sub display()
-{
- my ($sth, $style) = @_;
- my (@data, @max_length, $row, $nr_rows, $nr_cols, $i, $j, $tmp, $mxl);
-
- # Store the field names and values in @data.
- # Store the max field lengths in @max_length
- for ($i = 0; ($row = $sth->fetchrow_arrayref); $i++)
- {
- if (!$i)
- {
- $nr_cols = $#$row;
- for ($j = 0; $j <= $#$row; $j++)
- {
- $data[$i][$j] = $sth->{NAME}->[$j];
- $max_length[$j] = length($data[$i][$j]);
- }
- $i++;
- }
- for ($j = 0; $j <= $#$row; $j++)
- {
- $data[$i][$j] = $row->[$j];
- $max_length[$j] = $tmp if ($max_length[$j] <
- ($tmp = length($data[$i][$j])));
- }
- }
- if (!($nr_rows = $i))
- {
- return;
- }
- # Display data
- if ($style == 0)
- {
- for ($i = 0; $i < $nr_rows; $i++)
- {
- if (!$i)
- {
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print "+"; print "-" x ($max_length[$j] + 2);
- }
- print "+\n";
- }
- print "|";
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print " ";
- if (defined($data[$i][$j]))
- {
- print $data[$i][$j];
- $tmp = length($data[$i][$j]);
- }
- else
- {
- print "NULL";
- $tmp = 4;
- }
- print " " x ($max_length[$j] - $tmp);
- print " |";
- }
- print "\n";
- if (!$i)
- {
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print "+"; print "-" x ($max_length[$j] + 2);
- }
- print "+\n";
- }
- }
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print "+"; print "-" x ($max_length[$j] + 2);
- }
- print "+\n";
- return;
- }
- if ($style == 1)
- {
- for ($i = 0; $max_length[$i]; $i++)
- {
- $mxl = $max_length[$i] if ($mxl < $max_length[$i]);
- }
-
- for ($i = 1; $i < $nr_rows; $i++)
- {
- print "*" x 27;
- print " " . $i . ". row ";
- print "*" x 27;
- print "\n";
- for ($j = 0; $j <= $nr_cols; $j++)
- {
- print " " x ($mxl - length($data[0][$j]));
- print "$data[0][$j]: ";
- if (defined($data[$i][$j]))
- {
- print "$data[$i][$j] \n";
- }
- else
- {
- print "NULL\n";
- }
- }
- }
- return;
- }
-}
-
-####
-#### usage
-####
-
-sub usage
-{
- print <<EOF;
-mysql-test $VER by Jani Tolonen
-
-Usage: mysql-test [options]
-
-Options:
---help Show this help
---db= Database to use (Default: $opt_db)
---port= TCP/IP port to use for connection (Default: $opt_port)
---socket= UNIX socket to use for connection (Default: $opt_socket)
---host= Connect to host (Default: $opt_host)
---user= User for login if not current user
---password Password to use when connecting to server
-
---without=PART_NAME1,PART_NAME2,...
- test without a certain part of MySQL, optional parts listed below
-
-Optional parts:
-
-FUNC Ignore MySQL basic functions
-PROC Ignore MySQL procedure functions
-EOF
- exit(0);
-}
-
-
-sub test_mysql_functions
-{
-
- ####
- #### MySQL functions
- ####
- #### Types: S = string (or real number) , N = unsigned integer, Z = integer,
- #### R = real number, T = time_stamp, E = no argument, D = date,
- #### B = boolean, C = character
- #### F = format (usually used with the date-types)
- #### . = any number of the last argument type possible
- #### A = require table for test, the following argument
- #### is the argument for the function
-
- # Muista get_lock,group_unique_users,
- # position, unique_users
-
- # adddate, date_add, subdate, date_sub, between, benchmark, count
-
- # decode, encode, get_lock, make_set, position
-
- @functions = (["abs","R"],["acos","R"],["ascii","C"],["asin","R"],
- ["atan","R"],["atan2","R"],["avg","AR"],["bin","Z"],
- ["bit_count","Z"],["bit_or","AZ"],["bit_and","AZ"],
- ["ceiling","R"],["char","N."],["char_length","S"],
- ["concat","SS."],["conv","ZZZ"],
- ["cos","R"],["cot","R"],["curdate","E"],
- ["curtime","E"],["database","E"],["date_format","DF"],
- ["dayofmonth","D"],["dayofyear","D"],["dayname","D"],
- ["degrees","R"],["elt","NS."],["encode","SS"],
- ["encrypt","S"],["encrypt","SS"],["exp","R"],["field","SS."],
- ["find_in_set","SS"],["floor","R"],["format","RN"],
- ["from_days","N"],["from_unixtime","N"],
- ["from_unixtime","NF"],["greatest","RR."],["hex","Z"],
- ["hour","D"],["if","ZSS"],["ifnull","SS"],["insert","SNNS"],
- ["instr","SS"],["interval","RR."],["isnull","S"],
- ["last_insert_id","E"],["lcase","S"],["least","RR."],
- ["left","SN"],["length","S"],["locate","SS"],
- ["log","R"],["log10","R"],["lpad","SNS"],["ltrim","S"],
- ["max","AR"],["mid","SNN"],["min","AR"],["minute","D"],
- ["mod","ZZ"],["monthname","D"],
- ["month","D"],["now","E"],["oct","Z"],
- ["octet_length","S"],["password","S"],["period_add","DD"],
- ["period_diff","DD"],["pi","E"],
- ["pow","RR"],["quarter","D"],["radians","R"],
- ["rand","E"],["rand","R"],["release_lock","S"],
- ["repeat","SN"],["replace","SSS"],["reverse","S"],
- ["right","SN"],["round","R"],["round","RN"],
- ["rpad","SNS"],["rtrim","S"],["sec_to_time","N"],
- ["second","T"],["sign","R"],["sin","R"],
- ["space","N"],["soundex","S"],["sqrt","R"],["std","AR"],
- ["strcmp","SS"],["substring","SN"],["substring","SNN"],
- ["substring_index","SSZ"],["sum","AR"],
- ["tan","R"],["time_format","TF"],["time_to_sec","T"],
- ["to_days","D"],["trim","S"],
- ["truncate","RN"],["ucase","S"],
- ["unix_timestamp","E"],["unix_timestamp","D"],["user","E"],
- ["version","E"],["week","D"],["weekday","D"],["year","D"]);
-
- ####
- #### Various tests for the functions above
- ####
-
- &exec_query(["drop table mysql_test1"], $MAY_ERR, $SILENT);
-
- $query .= <<EOF;
-create table mysql_test1 (
- i int,
- d double
-)
-EOF
- chop($query);
- &exec_query([$query], $NO_ERR, $SILENT);
-
- ####
- #### Basic tests
- ####
-
- printf("####\n#### BASIC TESTS FOR FUNCTIONS\n####\n\n");
-
- @bunch = ("insert into mysql_test1 values(-20,-10.5),(20,10.5),(50,100.00)",
- "insert into mysql_test1 values(100,500.333)");
- &exec_query(\@bunch, $NO_ERR, $SILENT);
-
- printf("\n####\n#### First basic test part\n####\n\n");
-
- @values = (["S", "'a'", "'abc'", "'abc def'", "'abcd'", "'QWERTY'",
- "?", "<>", "#__#"],
- ["N", -1000, -500, -100, -1, 0, 1, 40, 50, 70, 90,
- 100, 500, 1000],
- ["Z", -100, -50, 200, 1000],
- ["R", -500.5, -10.333, 100.667, 400.0],
- ["T", 19980728154204, 19980728154205, 19980728154206,
- 19980728154207],
- ["D", "'1997-12-06'", "'1997-12-07'", "'1997-12-08'",
- "'1997-12-09'"],
- ["B", 1, 0, 0, 1],
- ["C", "'a'", "'e'", "'r'", "'q'"],
- ["F", "'%a'", "'%b'", "'%d'", "'%H'"]);
- &test_func(\@functions, \@values, 4, 5, ["mysql_test1","Zi","Rd"]);
-
- printf("\n####\n#### Second basic test part\n####\n\n");
-
- @values = (["S", "'a'", "'BC'", "'def'", "'HIJK'", "'lmnop'", "'QRSTUV'"],
- ["N", 0, 1, 2, 3, 4, 5],
- ["Z", 0, 1, 2, 3, 4, 5],
- ["R", 0, 1, 2, 3, 4, 5],
- ["T", 19990608234530, 20000709014631, 20010810024732,
- 20020911034833, 20031012044934, 20041113055035],
- ["D", "'1999-06-08'", "'2000-07-09'", "'2001-08-10'",
- "'2002-09-11'", "'2003-10-12'", "'2004-11-13'"],
- ["B", 0, 1, 0, 1, 0, 1],
- ["C", "'a'", "'BC'", "'def'", "'HIJK'", "'lmnop'", "'QRSTUV'"],
- ["F", "'%a'", "'%b'", "'%d'", "'%h'", "'%H'", "'%i'"]);
- &test_func(\@functions, \@values, 6, 6, ["mysql_test1","Zi","Rd"], 0, 1);
-
- printf("\n####\n#### Third basic test part\n####\n\n");
-
- @values = (["S", "'Monty'", "'Jani'", "'MySQL'", "''"],
- ["N", 10, 54, -70, -499],
- ["Z", 11.03, "'Abo'", 54.333, "''"],
- ["R", 12, "'gnome'", -34.211, "''"],
- ["T", 3, "'Redhat'", -19984021774433, "''"],
- ["D", "'1990-01-31'", "'-3333-10-23'", -5631_23_12, "''"],
- ["B", 0, "'asb'", -4, "''"],
- ["C", "'a'", 503, -45353453, "''"],
- ["F", "'%a'", -231, "'Mitsubishi'", "''"]);
- &test_func(\@functions, \@values, 3, 3, ["mysql_test1","Zi","Rd"], 0, 1);
-
- &exec_query(["delete from mysql_test1"], $NO_ERR, $SILENT);
-
- ####
- #### Null tests
- ####
-
- printf("\n\n####\n#### NULL TESTS FOR FUNCTIONS\n####\n\n\n");
-
- &exec_query(["insert into mysql_test1 values(null,null)"], $NO_ERR,
- $SILENT);
- @values = (["S", "NULL"],
- ["N", "NULL"],
- ["Z", "NULL"],
- ["R", "NULL"],
- ["T", "NULL"],
- ["D", "NULL"],
- ["B", "NULL"],
- ["C", "NULL"],
- ["F", "NULL"]);
- &test_func(\@functions, \@values, 1, 5, ["mysql_test1","Zi","Rd"], 1);
- &exec_query(["delete from mysql_test1"], $NO_ERR, $SILENT);
-
- ####
- #### Tests to fulfill the main part of function tests above
- ####
-
- printf("\n\n####\n#### FULFILL TESTS \n####\n\n\n");
-
- &exec_query(["drop table my_t"], $MAY_ERR, $SILENT);
- &exec_query(["create table my_t (s1 char(64), s2 char(64))"],
- $NO_ERR, $VERBOSE, $HS);
- $query = <<EOF;
-insert into my_t values('aaa','aaa'),('aaa|qqq','qqq'),('gheis','^[^a-dXYZ]+\$'),('aab','^aa?b'),('Baaan','^Ba*n'),('aaa','qqq|aaa'),('qqq','qqq|aaa'),('bbb','qqq|aaa'),('bbb','qqq'),('aaa','aba'),(null,'abc'),('def',null),(null,null),('ghi','ghi[')
-EOF
- chop($query);
- &exec_query([$query], $NO_ERR, $VERBOSE, $HS);
- &exec_query(["select s1 regexp s2 from my_t"],
- $NO_ERR, $VERBOSE, $HS);
-
-
- ####
- #### ["position","SS"],
- ####
-
-}
-
-sub create_test_tables
-{
- $query[0][0] = <<EOF;
- CREATE TABLE my_t (
- auto int(5) unsigned DEFAULT '0' NOT NULL auto_increment,
- string varchar(10) DEFAULT 'hello',
- binary_string varchar(10) binary DEFAULT '' NOT NULL,
- tiny tinyint(4) DEFAULT '0' NOT NULL,
- short smallint(6) DEFAULT '1' NOT NULL,
- medium mediumint(8) DEFAULT '0' NOT NULL,
- longint int(11) DEFAULT '0' NOT NULL,
- longlong bigint(13) DEFAULT '0' NOT NULL,
- num decimal(5,2) DEFAULT '0.00' NOT NULL,
- num_fill decimal(6,2) unsigned zerofill DEFAULT '0000.00' NOT NULL,
- real_float float(13,1) DEFAULT '0.0' NOT NULL,
- real_double double(13,1),
- utiny tinyint(3) unsigned DEFAULT '0' NOT NULL,
- ushort smallint(5) unsigned zerofill DEFAULT '00000' NOT NULL,
- umedium mediumint(8) unsigned DEFAULT '0' NOT NULL,
- ulong int(11) unsigned DEFAULT '0' NOT NULL,
- ulonglong bigint(13) unsigned DEFAULT '0' NOT NULL,
- zero int(5) unsigned zerofill,
- time_stamp timestamp(14),
- date_field date,
- time_field time,
- date_time datetime,
- blob_col blob,
- tinyblob_col tinyblob,
- mediumblob_col mediumblob NOT NULL,
- longblob_col longblob NOT NULL,
- options enum('one','two','three'),
- flags set('one','two','three'),
- PRIMARY KEY (auto)
-)
-EOF
- chop($query[0][0]);
- $query[0][1] = <<EOF;
- INSERT INTO my_t VALUES (1,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154204,NULL,'01:00:00',
- NULL,NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][1]);
- $query[0][2] = <<EOF;
- INSERT INTO my_t VALUES (2,'hello','',0,1,0,0,0,0.00,0000.00,
- -340282346638528859811704183484516925440.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][2]);
- $query[0][3] = <<EOF;
- INSERT INTO my_t VALUES (3,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,00000,
- 0,0,0,NULL,19980728154205,NULL,NULL,
- '2002-12-30 22:04:02',NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][3]);
- $query[0][4] = <<EOF;
- INSERT INTO my_t VALUES (4,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,00000,
- 0,0,0,NULL,19980728154205,'1997-12-06',NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][4]);
- $query[0][5] = <<EOF;
- INSERT INTO my_t VALUES (5,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,00000,
- 0,0,0,NULL,19980728154205,NULL,'20:10:08',NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][5]);
- $query[0][6] = <<EOF;
- INSERT INTO my_t VALUES (6,'hello','',0,1,0,0,0,-0.22,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][6]);
- $query[0][7] = <<EOF;
- INSERT INTO my_t VALUES (7,'hello','',0,1,0,0,0,-0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][7]);
- $query[0][8] = <<EOF;
- INSERT INTO my_t VALUES (8,'hello','',0,1,0,0,0,+0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][8]);
- $query[0][9] = <<EOF;
- INSERT INTO my_t VALUES (9,'hello','',0,1,0,0,0,+0.90,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154205,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][9]);
- $query[0][10] = <<EOF;
- INSERT INTO my_t VALUES (10,'hello','',0,1,0,0,0,-999.99,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154206,NULL,NULL,NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][10]);
- $query[0][11] = <<EOF;
- INSERT INTO my_t VALUES (11,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,
- 329999996548271212625250308919809540096.0,9.0,255,
- 65535,16777215,4294967295,18446744073709551615,
- 4294967295,00000000000000,'9999-12-31','23:59:59',
- '9999-12-31 23:59:59',NULL,NULL,' ',' ','',
- 'one,two,three')
-EOF
- chop($query[0][11]);
- $query[0][12] = <<EOF;
- INSERT INTO my_t VALUES (12,'hello','',-128,-32768,-8388608,-2147483648,
- -9223372036854775808,-999.99,0000.00,
- -329999996548271212625250308919809540096.0,10.0,0,
- 00000,0,0,0,00000,00000000000000,
- '9999-12-31','23:59:59','9999-12-31 23:59:59',NULL,
- NULL,' ,-',' ,-','','one,two,three')
-EOF
- chop($query[0][12]);
- $query[0][13] = <<EOF;
- INSERT INTO my_t VALUES (13,'hello','',0,1,0,0,0,0.09,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][13]);
- $query[0][14] = <<EOF;
- INSERT INTO my_t VALUES (14,'hello','',0,1,0,0,0,0.00,0000.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][14]);
- $query[0][15] = <<EOF;
- INSERT INTO my_t VALUES (15,'hello','',0,1,0,0,0,0.00,0044.00,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][15]);
- $query[0][16] = <<EOF;
- INSERT INTO my_t VALUES (16,'hello','',0,1,0,0,0,0.00,9999.99,0.0,NULL,0,
- 00000,0,0,0,NULL,19980728154223,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][16]);
- $query[0][17] = <<EOF;
- INSERT INTO my_t VALUES (17,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,
- 329999996548271212625250308919809540096.0,9.0,255,
- 65535,16777215,4294967295,18446744073709551615,
- 4294967295,00000000000000,'9999-12-31','23:59:59',
- '9999-12-31 23:59:59',NULL,NULL,' ',' ','',
- 'one,two,three')
-EOF
- chop($query[0][17]);
- $query[0][18] = <<EOF;
- INSERT INTO my_t VALUES (18,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,0.0,NULL,255,
- 65535,16777215,4294967295,18446744073709551615,
- 4294967295,19980728154224,NULL,NULL,NULL,NULL,
- NULL,'','',NULL,NULL)
-EOF
- chop($query[0][18]);
- $query[0][19] = <<EOF;
- INSERT INTO my_t VALUES (19,'hello','',127,32767,8388607,2147483647,
- 9223372036854775807,9999.99,9999.99,0.0,NULL,255,
- 65535,16777215,4294967295,0,4294967295,
- 19980728154224,NULL,NULL,NULL,NULL,NULL,'','',
- NULL,NULL)
-EOF
- chop($query[0][19]);
- $query[0][20] = <<EOF;
- INSERT INTO my_t VALUES (20,'hello','',-128,-32768,-8388608,-2147483648,
- -9223372036854775808,-999.99,0000.00,0.0,NULL,0,
- 00000,0,0,18446744073709551615,00000,19980728154224,
- NULL,NULL,NULL,NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][20]);
- $query[0][21] = <<EOF;
- INSERT INTO my_t VALUES (21,'hello','',-128,-32768,-8388608,-2147483648,
- -9223372036854775808,-999.99,0000.00,0.0,NULL,0,
- 00000,0,0,0,00000,19980728154225,NULL,NULL,NULL,
- NULL,NULL,'','',NULL,NULL)
-EOF
- chop($query[0][21]);
- $query[0][22] = <<EOF;
- INSERT INTO my_t VALUES (22,NULL,'1',1,1,1,1,1,1.00,0001.00,1.0,NULL,1,00001,
- 1,1,1,00001,19980728154244,NULL,NULL,NULL,NULL,NULL,
- '1','1',NULL,NULL)
-EOF
- chop($query[0][22]);
- $query[0][23] = <<EOF;
- INSERT INTO my_t VALUES (23,'2','2',2,2,2,2,2,2.00,0002.00,2.0,2.0,2,00002,
- 2,2,2,00002,00000000000000,'0000-00-00','02:00:00',
- '0000-00-00 00:00:00','2','2','2','2','','')
-EOF
- chop($query[0][23]);
- $query[0][24] = <<EOF;
- INSERT INTO my_t VALUES (24,'3','3',3,3,3,3,3,3.00,0003.00,3.0,3.0,3,00003,
- 3,3,3,00003,00000000000000,'2000-00-03','00:00:03',
- '0000-00-00 00:00:03','3.00','3.00','3.00','3.00',
- 'three','one,two')
-EOF
- chop($query[0][24]);
- $query[0][25] = <<EOF;
- INSERT INTO my_t VALUES (25,'-4.7','-4.7',-5,-5,-5,-5,-5,-4.70,0000.00,-4.7,
- -4.7,0,00000,0,0,0,00000,00000000000000,'0000-00-00',
- '00:00:00','0000-00-00 00:00:00','-4.70','-4.70',
- '-4.70','-4.70','','three')
-EOF
- chop($query[0][25]);
- $query[0][26] = <<EOF;
- INSERT INTO my_t VALUES (26,'+0.09','+0.09',0,0,0,0,0,+0.09,0000.00,0.1,0.1,
- 0,00000,0,0,0,00000,00000000000000,'0000-00-00',
- '00:09:00','0000-00-00 00:00:00','+0.09','+0.09',
- '+0.09','+0.09','','')
-EOF
- chop($query[0][26]);
- $query[0][27] = <<EOF;
- INSERT INTO my_t VALUES (27,'1','1',1,1,1,1,1,1.00,0001.00,1.0,1.0,1,00001,
- 1,1,1,00001,00000000000000,'2000-00-01','00:00:01',
- '0000-00-00 00:00:01','1','1','1','1','one','one')
-EOF
- chop($query[0][27]);
- $query[0][28] = <<EOF;
- INSERT INTO my_t VALUES (28,'-1','-1',-1,-1,-1,-1,-1,-1.00,0000.00,-1.0,-1.0,
- 0,00000,0,0,18446744073709551615,00000,
- 00000000000000,'0000-00-00','00:00:00',
- '0000-00-00 00:00:00','-1','-1','-1','-1','',
- 'one,two,three')
-EOF
- chop($query[0][28]);
- $query[0][29] = <<EOF;
- INSERT INTO my_t VALUES (29,'','',0,0,0,0,0,0.00,0000.00,0.0,0.0,0,00000,0,0,
- 0,00000,00000000000000,'0000-00-00','00:00:00',
- '0000-00-00 00:00:00','','','','','','')
-EOF
- chop($query[0][29]);
- $query[1][0] = "CREATE TABLE my_t (str char(64))";
- $query[1][1] = "INSERT INTO my_t VALUES ('5.5')";
- $query[1][2] = "INSERT INTO my_t VALUES ('6.8')";
- $query[2][0] = "CREATE TABLE my_t (str char(64))";
- $query[2][1] = <<EOF;
- INSERT INTO my_t VALUES
- ('9999999999993242342442323423443534529999.02235000054213')
-EOF
- chop($query[2][1]);
- $query[3][0] = "CREATE TABLE my_t (str char(64))";
- $query[3][1] = <<EOF;
- INSERT INTO my_t VALUES
- ('8494357934579347593475349579347593845948793454350349543348736453')
-EOF
- chop($query[3][1]);
- $query[4][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[4][1] = "INSERT INTO my_t VALUES (10.0000000000)";
- $query[4][2] = "INSERT INTO my_t VALUES (-10.0000000000)";
- $query[5][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[5][1] = "INSERT INTO my_t VALUES (50000.0000000000)";
- $query[6][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[6][1] = "INSERT INTO my_t VALUES (5000000.0000000000)";
- $query[7][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[7][1] = "INSERT INTO my_t VALUES (500000000.0000000000)";
- $query[8][0] = "CREATE TABLE my_t (d double(20,10))";
- $query[8][1] = "INSERT INTO my_t VALUES (50000000000.0000000000)";
- $query[8][2] = "INSERT INTO my_t VALUES (NULL)";
- $query[9][0] = "CREATE TABLE my_t (d double(60,10))";
- $query[9][1] = "INSERT INTO my_t VALUES (93850983054983462912.0000000000)";
- $query[9][2] = "INSERT INTO my_t VALUES (93850983.3495762944)";
- $query[9][3] = <<EOF;
- INSERT INTO my_t VALUES (938509832438723448371221493568778534912.0000000000)
-EOF
- chop($query[9][3]);
- $query[10][0] = "CREATE TABLE my_t (i int(11))";
- $query[10][1] = "INSERT INTO my_t VALUES (-100)";
- $query[10][2] = "INSERT INTO my_t VALUES (-200)";
- $query[11][0] = "CREATE TABLE my_t (s char(64))";
- $query[11][1] = "INSERT INTO my_t VALUES ('100.')";
- $query[12][0] = "CREATE TABLE my_t (s char(64))";
- $query[12][1] = "INSERT INTO my_t VALUES ('1e+50')";
- $query[13][0] = "CREATE TABLE my_t (s char(64))";
- $query[13][1] = "INSERT INTO my_t VALUES ('1E+50u')";
- $query[14][0] = "CREATE TABLE my_t (s char(64))";
- $query[14][1] = "INSERT INTO my_t VALUES ('1EU50')";
- $query[15][0] = "CREATE TABLE my_t (s char(64))";
- $query[15][1] = "INSERT INTO my_t VALUES ('123.000')";
- $query[15][2] = "INSERT INTO my_t VALUES ('123.000abc')";
- $query[16][0] = "CREATE TABLE my_t (s char(128))";
- $query[16][1] = <<EOF;
- INSERT INTO my_t VALUES
- ('-999999999999999999999999999999999999999999999999999999999999999999999999')
-EOF
- chop($query[16][1]);
- $query[17][0] = "CREATE TABLE my_t (s char(128))";
- $query[17][1] = "INSERT INTO my_t VALUES ('-9999999999999999')";
- $query[18][0] = "CREATE TABLE my_t (s char(128))";
- $query[18][1] = "INSERT INTO my_t VALUES ('28446744073709551615001')";
- $query[18][2] = "INSERT INTO my_t VALUES ('184467440737095516150000000')";
- $query[19][0] = "CREATE TABLE my_t (s char(128))";
- $query[19][1] = "INSERT INTO my_t VALUES ('18446744073709551615')";
- $query[20][0] = "CREATE TABLE my_t (s char(128))";
- $query[20][1] = "INSERT INTO my_t VALUES ('18446744073709551616')";
- $query[21][0] = "CREATE TABLE my_t (s char(64))";
- $query[21][1] = "INSERT INTO my_t VALUES ('00740')";
- $query[21][2] = "INSERT INTO my_t VALUES ('00740.')";
- $query[22][0] = "CREATE TABLE my_t (s char(128))";
- $query[22][1] = "INSERT INTO my_t VALUES ('-18446744073709551615')";
- $query[23][0] = "CREATE TABLE my_t (s char(32))";
- $query[23][1] = "INSERT INTO my_t VALUES ('740')";
- $query[23][2] = "INSERT INTO my_t VALUES ('12345')";
- $query[23][3] = "INSERT INTO my_t VALUES ('12345')";
- $query[24][0] = "CREATE TABLE my_t (s char(32))";
- $query[24][1] = "INSERT INTO my_t VALUES ('00740')";
- $query[24][2] = "INSERT INTO my_t VALUES ('00730')";
- $query[24][3] = "INSERT INTO my_t VALUES ('00720')";
- $query[24][4] = "INSERT INTO my_t VALUES ('12345.02')";
- $query[25][0] = "CREATE TABLE my_t (i bigint(20) unsigned)";
- $query[25][1] = "INSERT INTO my_t VALUES (3000)";
- $query[25][2] = "INSERT INTO my_t VALUES (NULL)";
- $query[25][3] = "INSERT INTO my_t VALUES (900000000003)";
- $query[25][4] = "INSERT INTO my_t VALUES (90)";
- $query[26][0] = "CREATE TABLE my_t (i int(11))";
- $query[26][1] = "INSERT INTO my_t VALUES (NULL)";
- $query[27][0] = "CREATE TABLE my_t (d date)";
- $query[27][1] = "INSERT INTO my_t VALUES ('1999-05-01')";
- $query[28][0] = "CREATE TABLE my_t (y year(4))";
- $query[28][1] = "INSERT INTO my_t VALUES (1999)";
- $query[29][0] = "CREATE TABLE my_t (s char(128))";
- $query[29][1] = "INSERT INTO my_t VALUES ('453453444451.7976')";
- $query[30][0] = "CREATE TABLE my_t (s char(128))";
- $query[30][1] = "INSERT INTO my_t VALUES('')";
- $query[31][0] = "CREATE TABLE my_t (s char(128))";
- $query[31][1] = "INSERT INTO my_t VALUES(' ')";
- return $query;
-}
diff -Nrup a/mysql-test/mysql-test-run-shell.sh b/mysql-test/mysql-test-run-shell.sh
--- a/mysql-test/mysql-test-run-shell.sh 2007-10-08 18:38:29 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,2338 +0,0 @@
-#!/bin/sh
-# mysql-test-run - originally written by Matt Wagner <matt@stripped>
-# modified by Sasha Pachev <sasha@stripped>
-# Slightly updated by Monty
-# Cleaned up again by Matt
-# Fixed by Sergei
-# 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
-#--
-DB=test
-DBPASSWD=""
-VERBOSE=""
-USE_MANAGER=0
-MY_TZ=GMT-3
-TZ=$MY_TZ; export TZ # for UNIX_TIMESTAMP tests to work
-LOCAL_SOCKET=@MYSQL_UNIX_ADDR@
-
-if [ -z "$MYSQL_TCP_PORT" ]; then
- MYSQL_TCP_PORT=@MYSQL_TCP_PORT@
- if [ @MYSQL_TCP_PORT_DEFAULT@ -eq 0 ]; then
- ESP=`getent services mysql/tcp`
- if [ $? -eq 0 ]; then
- MYSQL_TCP_PORT=`echo "$ESP"|sed -e's-^[a-z]*[ ]*\([0-9]*\)/[a-z]*$-\1-g'`
- fi
- fi
-fi
-
-umask 022
-
-# For query_cache test
-case `uname` in
- SCO_SV | UnixWare | OpenUNIX )
- # do nothing (Causes strange behavior)
- ;;
- QNX)
- # do nothing (avoid error message)
- ;;
- * )
- ulimit -n 1024
- ;;
-esac
-
-#++
-# Program Definitions
-#--
-
-LC_COLLATE=C
-export LC_COLLATE
-PATH=/bin:/usr/bin:/usr/local/bin:/usr/bsd:/usr/X11R6/bin:/usr/openwin/bin:/usr/bin/X11:$PATH
-MASTER_40_ARGS="--rpl-recovery-rank=1 --init-rpl-role=master"
-
-# Standard functions
-
-which ()
-{
- IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
- for file
- do
- for dir in $PATH
- do
- if test -f $dir/$file
- then
- echo "$dir/$file"
- continue 2
- fi
- done
- echo "Fatal error: Cannot find program $file in $PATH" 1>&2
- exit 1
- done
- IFS="$save_ifs"
- exit 0
-}
-
-
-sleep_until_file_deleted ()
-{
- pid=$1;
- file=$2
- loop=$SLEEP_TIME_FOR_DELETE
- while (test $loop -gt 0)
- do
- if [ ! -r $file ]
- then
- if test $pid != "0"
- then
- wait_for_pid $pid
- fi
- return
- fi
- sleep 1
- loop=`expr $loop - 1`
- done
-}
-
-sleep_until_file_created ()
-{
- file=$1
- loop=$2
- org_time=$2
- while (test $loop -gt 0)
- do
- if [ -r $file ]
- then
- return 0
- fi
- sleep 1
- loop=`expr $loop - 1`
- done
- echo "ERROR: $file was not created in $org_time seconds; Aborting"
- exit 1;
-}
-
-# For the future
-
-wait_for_pid()
-{
- pid=$1
- #$WAIT_PID pid $SLEEP_TIME_FOR_DELETE
-}
-
-# Check that valgrind is installed
-find_valgrind()
-{
- FIND_VALGRIND=`which valgrind` # this will print an error if not found
- # Give good warning to the user and stop
- if [ -z "$FIND_VALGRIND" ] ; then
- $ECHO "You need to have the 'valgrind' program in your PATH to run mysql-test-run with option --valgrind. Valgrind's home page is http://valgrind.kde.org ."
- exit 1
- fi
- # >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
- valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && FIND_VALGRIND="$FIND_VALGRIND --tool=memcheck"
- FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$MYSQL_TEST_DIR/valgrind.supp"
-}
-
-# No paths below as we can't be sure where the program is!
-
-SED=sed
-
-BASENAME=`which basename`
-if test $? != 0; then exit 1; fi
-DIFF=`which diff | $SED q`
-if test $? != 0; then exit 1; fi
-CAT=cat
-CUT=cut
-HEAD=head
-TAIL=tail
-ECHO=echo # use internal echo if possible
-EXPR=expr # use internal if possible
-FIND=find
-GREP=grep
-if test $? != 0; then exit 1; fi
-PRINTF=printf
-RM=rm
-if test $? != 0; then exit 1; fi
-TR=tr
-XARGS=`which xargs`
-if test $? != 0; then exit 1; fi
-SORT=sort
-
-# Are we using a source or a binary distribution?
-
-testdir=@testdir@
-if [ -d bin/mysqld ] && [ -d mysql-test ] ; then
- cd mysql-test
-else
- if [ -d $testdir/mysql-test ] ; then
- cd $testdir
- fi
-fi
-
-if [ ! -f ./mysql-test-run ] ; then
- $ECHO "Can't find the location for the mysql-test-run script"
-
- $ECHO "Go to to the mysql-test directory and execute the script as follows:"
- $ECHO "./mysql-test-run."
- exit 1
-fi
-
-#++
-# Misc. Definitions
-#--
-
-# BASEDIR is always above mysql-test directory ...
-MYSQL_TEST_DIR=`pwd`
-cd ..
-
-if [ -d ./sql ] ; then
- SOURCE_DIST=1
-else
- BINARY_DIST=1
-
- # ... one level for tar.gz, two levels for a RPM installation
- if [ ! -f ./bin/mysql_upgrade ] ; then
- # Has to be RPM installation
- cd ..
- fi
-fi
-BASEDIR=`pwd`
-
-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
-STD_DATA=$MYSQL_TEST_DIR/std_data
-hostname=`hostname` # Installed in the mysql privilege table
-
-MANAGER_QUIET_OPT="-q"
-TESTDIR="$MYSQL_TEST_DIR/t"
-TESTSUFFIX=test
-TOT_SKIP=0
-TOT_PASS=0
-TOT_FAIL=0
-TOT_TEST=0
-GOT_WARNINGS=0
-USERT=0
-SYST=0
-REALT=0
-FAST_START=""
-MYSQL_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
-export MYSQL_TMP_DIR
-
-# Use a relative path for where the slave will find the dumps
-# generated by "LOAD DATA" on the master. The path is relative
-# since it must have fixed length to test logging
-# i.e otherwise the output from "SHOW MASTER STATUS" will vary
-# with the strlen() of MYSQL_TEST_DIR
-SLAVE_LOAD_TMPDIR=../tmp
-
-RES_SPACE=" "
-MYSQLD_SRC_DIRS="strings mysys include extra regex myisam \
- myisammrg heap sql"
-MY_LOG_DIR="$MYSQL_TEST_DIR/var/log"
-#
-# Set LD_LIBRARY_PATH if we are using shared libraries
-#
-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
-
-#
-# Allow anyone in the group to see the generated database files
-#
-UMASK=0660
-UMASK_DIR=0770
-export UMASK UMASK_DIR
-
-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_LOG=$MYSQL_TEST_DIR/var/log/manager.log
-NDBCLUSTER_PORT=9350
-NDBCLUSTER_PORT_SLAVE=9358
-
-#
-# To make it easier for different devs to work on the same host,
-# an environment variable can be used to control all ports. A small
-# number is to be used, 0 - 16 or similar.
-#
-# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
-# versions of this script, else a 4.0 test run might conflict with a
-# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
-# all port numbers might not be used in this version of the script.
-#
-if [ -n "$MTR_BUILD_THREAD" ] ; then
- MASTER_MYPORT=`expr $MTR_BUILD_THREAD '*' 10 + 10000`
- 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 SLAVE_MYPORT = $SLAVE_MYPORT"
- echo "Using NDBCLUSTER_PORT = $NDBCLUSTER_PORT"
- echo "Using NDBCLUSTER_PORT_SLAVE = $NDBCLUSTER_PORT_SLAVE"
-fi
-
-NO_SLAVE=0
-USER_TEST=
-FAILED_CASES=
-
-EXTRA_MASTER_OPT=""
-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=""
-DO_GDB=""
-MANUAL_GDB=""
-DO_DDD=""
-DO_CLIENT_GDB=""
-SLEEP_TIME_AFTER_RESTART=1
-SLEEP_TIME_FOR_DELETE=10
-SLEEP_TIME_FOR_FIRST_MASTER=400 # Enough time to create innodb tables
-SLEEP_TIME_FOR_SECOND_MASTER=400
-SLEEP_TIME_FOR_FIRST_SLAVE=400
-SLEEP_TIME_FOR_SECOND_SLAVE=300
-CHARACTER_SET=latin1
-DBUSER=""
-START_WAIT_TIMEOUT=10
-STOP_WAIT_TIMEOUT=10
-MYSQL_TEST_SSL_OPTS=""
-USE_TIMER=""
-USE_EMBEDDED_SERVER=""
-TEST_MODE=""
-
-NDB_MGM_EXTRA_OPTS=
-NDB_MGMD_EXTRA_OPTS=
-NDBD_EXTRA_OPTS=
-MASTER_MYSQLDBINLOG=1
-SLAVE_MYSQLDBINLOG=1
-
-DO_STRESS=""
-STRESS_SUITE="main"
-STRESS_MODE="random"
-STRESS_THREADS=5
-STRESS_TEST_COUNT=""
-STRESS_LOOP_COUNT=""
-STRESS_TEST_DURATION=""
-STRESS_INIT_FILE=""
-STRESS_TEST_FILE=""
-STRESS_TEST=""
-
-$ECHO "Logging: $0 $*" # To ensure we see all arguments in the output, for the test analysis tool
-
-while test $# -gt 0; do
- case "$1" in
- --embedded-server)
- USE_EMBEDDED_SERVER=1
- USE_MANAGER=0 NO_SLAVE=1
- USE_RUNNING_SERVER=0
- USE_NDBCLUSTER=""
- USE_NDBCLUSTER_SLAVE=""
- TEST_MODE="$TEST_MODE embedded" ;;
- --purify)
- USE_PURIFY=1
- USE_MANAGER=0
- USE_RUNNING_SERVER=0
- TEST_MODE="$TEST_MODE purify" ;;
- --user=*) DBUSER=`$ECHO "$1" | $SED -e "s;--user=;;"` ;;
- --force) FORCE=1 ;;
- --timer) USE_TIMER=1 ;;
- --old-master) MASTER_40_ARGS="";;
- --master-binary=*)
- MASTER_MYSQLD=`$ECHO "$1" | $SED -e "s;--master-binary=;;"` ;;
- --slave-binary=*)
- SLAVE_MYSQLD=`$ECHO "$1" | $SED -e "s;--slave-binary=;;"` ;;
- --local) USE_RUNNING_SERVER=0 ;;
- --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"
- USE_NDBCLUSTER_ONLY=1 ;;
- --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=*)
- NDB_MGMD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgmd-extra-opts=;;"` ;;
- --ndbd-extra-opts=*)
- NDBD_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndbd-extra-opts=;;"` ;;
- --tmpdir=*) MYSQL_TMP_DIR=`$ECHO "$1" | $SED -e "s;--tmpdir=;;"` ;;
- --local-master)
- MASTER_MYPORT=3306;
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT --host=127.0.0.1 \
- --port=$MYSQL_MYPORT"
- 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=;;"` ;;
- --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 \
- --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
- --ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
- --ssl-ca=$MYSQL_TEST_DIR/std_data/cacert.pem \
- --ssl-cert=$MYSQL_TEST_DIR/std_data/server-cert.pem \
- --ssl-key=$MYSQL_TEST_DIR/std_data/server-key.pem"
- 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" ;;
- --start-and-exit)
- START_AND_EXIT=1
- ;;
- --socket=*) LOCAL_SOCKET=`$ECHO "$1" | $SED -e "s;--socket=;;"` ;;
- --skip-rpl) NO_SLAVE=1 ;;
- --skip-test=*) SKIP_TEST=`$ECHO "$1" | $SED -e "s;--skip-test=;;"`;;
- --do-test=*) DO_TEST=`$ECHO "$1" | $SED -e "s;--do-test=;;"`;;
- --start-from=* ) START_FROM=`$ECHO "$1" | $SED -e "s;--start-from=;;"` ;;
- --warnings | --log-warnings)
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --log-warnings"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --log-warnings"
- ;;
- --wait-timeout=*)
- START_WAIT_TIMEOUT=`$ECHO "$1" | $SED -e "s;--wait-timeout=;;"`
- STOP_WAIT_TIMEOUT=$START_WAIT_TIMEOUT;;
- --record)
- RECORD=1;
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --small-bench)
- DO_SMALL_BENCH=1
- DO_BENCH=1
- NO_SLAVE=1
- ;;
- --bench)
- DO_BENCH=1
- NO_SLAVE=1
- ;;
- --stress)
- DO_STRESS=1
- NO_SLAVE=1
- SKIP_SLAVE=1
- ;;
- --stress-suite=*)
- STRESS_SUITE=`$ECHO "$1" | $SED -e "s;--stress-suite=;;"`
- ;;
- --stress-threads=*)
- STRESS_THREADS=`$ECHO "$1" | $SED -e "s;--stress-threads=;;"`
- ;;
- --stress-test-file=*)
- STRESS_TEST_FILE=`$ECHO "$1" | $SED -e "s;--stress-test-file=;;"`
- ;;
- --stress-init-file=*)
- STRESS_INIT_FILE=`$ECHO "$1" | $SED -e "s;--stress-init-file=;;"`
- ;;
- --stress-mode=*)
- STRESS_MODE=`$ECHO "$1" | $SED -e "s;--stress-mode=;;"`
- ;;
- --stress-loop-count=*)
- STRESS_LOOP_COUNT=`$ECHO "$1" | $SED -e "s;--stress-loop-count=;;"`
- ;;
- --stress-test-count=*)
- STRESS_TEST_COUNT=`$ECHO "$1" | $SED -e "s;--stress-test-count=;;"`
- ;;
- --stress-test-duration=*)
- STRESS_TEST_DURATION=`$ECHO "$1" | $SED -e "s;--stress-test-duration=;;"`
- ;;
- --big*) # Actually --big-test
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --compress)
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --sleep=*)
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1"
- SLEEP_TIME_AFTER_RESTART=`$ECHO "$1" | $SED -e "s;--sleep=;;"`
- ;;
- --ps-protocol)
- TEST_MODE="$TEST_MODE ps-protocol" EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT $1" ;;
- --user-test=*)
- USER_TEST=`$ECHO "$1" | $SED -e "s;--user-test=;;"`
- ;;
- --mysqld=*)
- TMP=`$ECHO "$1" | $SED -e "s;--mysqld=;;"`
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT $TMP"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT $TMP"
- ;;
- --gcov )
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Cannot do coverage test without the source - please use source dist"
- exit 1
- fi
- DO_GCOV=1
- GCOV=`which gcov`
- ;;
- --gprof )
- DO_GPROF=1
- ;;
- --gdb )
- START_WAIT_TIMEOUT=300
- STOP_WAIT_TIMEOUT=300
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --gdb option"
- fi
- DO_GDB=1
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- # This needs to be checked properly
- # USE_MANAGER=1
- USE_RUNNING_SERVER=0
- ;;
- --client-gdb )
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --client-gdb option"
- fi
- DO_CLIENT_GDB=1
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- ;;
- --manual-gdb )
- DO_GDB=1
- MANUAL_GDB=1
- USE_RUNNING_SERVER=0
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- ;;
- --ddd )
- if [ x$BINARY_DIST = x1 ] ; then
- $ECHO "Note: you will get more meaningful output on a source distribution compiled with debugging option when running tests with --ddd option"
- fi
- DO_DDD=1
- USE_RUNNING_SERVER=0
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --gdb"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --gdb"
- ;;
- --valgrind | --valgrind-all)
- find_valgrind;
- VALGRIND=$FIND_VALGRIND
- 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
- if test "$1" = "--valgrind-all"
- then
- VALGRIND="$VALGRIND -v --show-reachable=yes"
- fi
- ;;
- --valgrind-options=*)
- 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
- if test "$1" = "--valgrind-mysqltest-all"
- then
- VALGRIND_MYSQLTEST="$VALGRIND_MYSQLTEST -v --show-reachable=yes"
- fi
- ;;
- --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"
- ;;
- --strace-client )
- STRACE_CLIENT=1
- ;;
- --debug)
- EXTRA_MASTER_MYSQLD_TRACE=" \
- --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \
- --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace"
- EXTRA_MYSQL_TEST_OPT="$EXTRA_MYSQL_TEST_OPT \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqltest.trace"
- EXTRA_MYSQLCHECK_OPT="$EXTRA_MYSQLCHECK_OPT \
- --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 \
- --debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysqlbinlog.trace"
- EXTRA_MYSQL_CLIENT_TEST_OPT="--debug=d:t:A,$MYSQL_TEST_DIR/var/log/mysql_client_test.trace"
- ;;
- --fast)
- FAST_START=1
- ;;
- --use-old-data)
- USE_OLD_DATA=1
- ;;
- --comment=*)
- TMP=`$ECHO "$1" | $SED -e "s;--comment=;;"`
- echo
- echo '############################################'
- echo "# $TMP"
- echo '############################################'
- ;;
- -- ) shift; break ;;
- --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
- * ) break ;;
- esac
- shift
-done
-
-if [ -z "$TEST_MODE" ] ; then
- TEST_MODE="default"
-else
- # Remove the leading space if any
- TEST_MODE=`echo $TEST_MODE | sed 's/^ *//'`
-fi
-
-#
-# Skip tests that doesn't work with shell version
-#
-SKIP_TEST="$SKIP_TEST bootstrap"
-
-#++
-# mysqld Environment Parameters
-#--
-
-MYRUN_DIR=$MYSQL_TEST_DIR/var/run
-
-MASTER_MYDDIR="$MYSQL_TEST_DIR/var/master-data"
-MASTER_MYSOCK="$MYSQL_TMP_DIR/master.sock"
-MASTER_MYSOCK1=$MYSQL_MYSOCK"1"
-MASTER_MYPID="$MYRUN_DIR/master.pid"
-MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/master.log"
-MASTER_MYERR="$MYSQL_TEST_DIR/var/log/master.err"
-
-SLAVE_MYDDIR="$MYSQL_TEST_DIR/var/slave-data"
-SLAVE_MYSOCK="$MYSQL_TMP_DIR/slave.sock"
-SLAVE_MYPID="$MYRUN_DIR/slave.pid"
-SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/slave.log"
-SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/slave.err"
-
-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_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
-
-if [ x$SOURCE_DIST = x1 ] ; then
- MY_BASEDIR=$MYSQL_TEST_DIR
-else
- MY_BASEDIR=$BASEDIR
-fi
-
-# Create the directories
-
-# This should be fixed to be not be dependent on the contence of MYSQL_TMP_DIR
-# or MYRUN_DIR
-# (mkdir -p is not portable)
-[ -d $MYSQL_TEST_DIR/var ] || mkdir $MYSQL_TEST_DIR/var
-[ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp
-[ -d $MYSQL_TEST_DIR/var/run ] || mkdir $MYSQL_TEST_DIR/var/run
-[ -d $MYSQL_TEST_DIR/var/log ] || mkdir $MYSQL_TEST_DIR/var/log
-
-# Use 'test', not '[' as the shell builtin might not have '-L
-if test ! -L "$MYSQL_TEST_DIR/var/std_data_ln" ; then
- ln -s $MYSQL_TEST_DIR/std_data/ $MYSQL_TEST_DIR/var/std_data_ln
-fi
-
-if test ${COLUMNS:-0} -lt 80 ; then COLUMNS=80 ; fi
-E=`$EXPR $COLUMNS - 8`
-DASH72=`$ECHO '-------------------------------------------------------'|$CUT -c 1-$E`
-
-# on source dist, we pick up freshly build executables
-# on binary, use what is installed
-if [ x$SOURCE_DIST = x1 ] ; then
- if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
- if [ -f "$BASEDIR/libmysqld/examples/mysqltest_embedded" ] ; then
- MYSQL_TEST="$BASEDIR/libmysqld/examples/mysqltest_embedded"
- else
- echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2
- exit 1
- fi
- MYSQL_CLIENT_TEST="$BASEDIR/libmysqld/examples/mysql_client_test_embedded"
- else
- MYSQLD="$BASEDIR/sql/mysqld"
- if [ -n "$VALGRIND" ] ; then
- MYSQLD="$VALGRIND $MYSQLD"
- fi
- if [ -f "$BASEDIR/client/.libs/lt-mysqltest" ] ; then
- MYSQL_TEST="$BASEDIR/client/.libs/lt-mysqltest"
- elif [ -f "$BASEDIR/client/.libs/mysqltest" ] ; then
- MYSQL_TEST="$BASEDIR/client/.libs/mysqltest"
- else
- MYSQL_TEST="$BASEDIR/client/mysqltest"
- fi
- MYSQL_CLIENT_TEST="$BASEDIR/tests/mysql_client_test"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlcheck" ] ; then
- MYSQL_CHECK="$BASEDIR/client/.libs/mysqlcheck"
- else
- MYSQL_CHECK="$BASEDIR/client/mysqlcheck"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqldump" ] ; then
- MYSQL_DUMP="$BASEDIR/client/.libs/mysqldump"
- 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
- MYSQL_IMPORT="$BASEDIR/client/mysqlimport"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlshow" ] ; then
- MYSQL_SHOW="$BASEDIR/client/.libs/mysqlshow"
- else
- MYSQL_SHOW="$BASEDIR/client/mysqlshow"
- fi
- if [ -f "$BASEDIR/client/.libs/mysqlbinlog" ] ; then
- MYSQL_BINLOG="$BASEDIR/client/.libs/mysqlbinlog"
- else
- MYSQL_BINLOG="$BASEDIR/client/mysqlbinlog"
- fi
- if [ -n "$STRACE_CLIENT" ]; then
- MYSQL_TEST="strace -o $MYSQL_TEST_DIR/var/log/mysqltest.strace $MYSQL_TEST"
- fi
-
- CLIENT_BINDIR="$BASEDIR/client"
- MYSQLADMIN="$CLIENT_BINDIR/mysqladmin"
- WAIT_PID="$BASEDIR/extra/mysql_waitpid"
- MYSQL_MY_PRINT_DEFAULTS="$BASEDIR/extra/my_print_defaults"
- 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/storage/ndb/tools"
- NDB_MGM="$BASEDIR/storage/ndb/src/mgmclient/ndb_mgm"
-
- if [ -n "$USE_PURIFY" ] ; then
- PSUP="$MYSQL_TEST_DIR/suppress.purify"
- PURIFYOPTIONS="-windows=no -log-file=%v.purifylog -append-logfile -add-suppression-files=$PSUP"
- if [ -f "${MYSQL_TEST}-purify" ] ; then
- MYSQL_TEST="${MYSQL_TEST}-purify"
- PLOG="$MYSQL_TEST.purifylog"
- if [ -f $PLOG ]; then
- mv $PLOG $PLOG.$$
- fi
- PURIFY_LOGS="$PLOG"
- fi
- if [ -f "${MYSQLD}-purify" ] ; then
- MYSQLD="${MYSQLD}-purify"
- PLOG="$MYSQLD.purifylog"
- if [ -f $PLOG ]; then
- mv $PLOG $PLOG.$$
- fi
- PURIFY_LOGS="$PURIFY_LOGS $PLOG"
- fi
- fi
-
-else
-
- # We have a binary installation. Note that this can be both from
- # unpacking a MySQL AB binary distribution (created using
- # "scripts/make_binary_distribution", and from a "make install".
- # Unfortunately the structure differs a bit, for a "make install"
- # currently all binaries are in "bin", for a MySQL AB packaging
- # some are in "tests".
-
- if test -x "$BASEDIR/libexec/mysqld"
- then
- MYSQLD="$VALGRIND $BASEDIR/libexec/mysqld"
- 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"
- then
- TESTS_BINDIR="$BASEDIR/tests"
- else
- TESTS_BINDIR="$BASEDIR/bin"
- fi
- MYSQL_TEST="$CLIENT_BINDIR/mysqltest"
- MYSQL_CHECK="$CLIENT_BINDIR/mysqlcheck"
- 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="$CLIENT_BINDIR/mysql"
- INSTALL_DB="./install_test_db --bin"
- MYSQL_FIX_SYSTEM_TABLES="$CLIENT_BINDIR/mysql_fix_privilege_tables"
- NDB_TOOLS_DIR="$CLIENT_BINDIR"
- NDB_MGM="$CLIENT_BINDIR/ndb_mgm"
- if test -d "$BASEDIR/share/mysql/english"
- then
- LANGUAGE="$BASEDIR/share/mysql/english/"
- CHARSETSDIR="$BASEDIR/share/mysql/charsets"
- else
- LANGUAGE="$BASEDIR/share/english/"
- CHARSETSDIR="$BASEDIR/share/charsets"
- fi
- if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
- if [ -f "$CLIENT_BINDIR/mysqltest_embedded" ] ; then
- MYSQL_TEST="$CLIENT_BINDIR/mysqltest_embedded"
- else
- echo "Fatal error: Cannot find embedded server 'mysqltest_embedded'" 1>&2
- exit 1
- fi
- if [ -d "$BASEDIR/tests/mysql_client_test_embedded" ] ; then
- MYSQL_CLIENT_TEST="$TESTS_BINDIR/mysql_client_test_embedded"
- else
- MYSQL_CLIENT_TEST="$CLIENT_BINDIR/mysql_client_test_embedded"
- fi
- else
- 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" ]
-then
-MASTER_MYSQLD=$MYSQLD
-fi
-
-if [ -z "$SLAVE_MYSQLD" ]
-then
-SLAVE_MYSQLD=$MYSQLD
-fi
-
-# If we should run all tests cases, we will use a local server for that
-
-if [ -z "$1" -a -z "$DO_STRESS" ]
-then
- USE_RUNNING_SERVER=0
-fi
-if [ $USE_RUNNING_SERVER -eq 1 ]
-then
- MASTER_MYSOCK=$LOCAL_SOCKET;
- DBUSER=${DBUSER:-test}
-else
- DBUSER=${DBUSER:-root} # We want to do FLUSH xxx commands
-fi
-
-if [ -w / ]
-then
- # We are running as root; We need to add the --root argument
- EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --user=root"
- EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --user=root"
-fi
-
-MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent $EXTRA_MYSQL_CLIENT_TEST_OPT"
-# Need to pass additional arguments to MYSQL_CLIENT_TEST for embedded server
-# -A marks each argument for passing to the function which initializes the
-# embedded library
-if [ "x$USE_EMBEDDED_SERVER" = "x1" ]; then
- MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST -A --language=$LANGUAGE -A --datadir=$SLAVE_MYDDIR -A --character-sets-dir=$CHARSETSDIR"
-fi
-# Save path and name of mysqldump
-MYSQL_DUMP_DIR="$MYSQL_DUMP"
-export MYSQL_DUMP_DIR
-MYSQL_CHECK="$MYSQL_CHECK --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLCHECK_OPT"
-MYSQL_DUMP="$MYSQL_DUMP --no-defaults --debug-info -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 --no-defaults --debug-info -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLSHOW_OPT"
-MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --debug-info --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT"
-MYSQL_IMPORT="$MYSQL_IMPORT --no-defaults --debug-info -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 --debug-info --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD"
-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
-export NDB_TOOLS_OUTPUT
-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 \
- --tmpdir=$MYSQL_TMP_DIR --port=$MASTER_MYPORT $MYSQL_TEST_SSL_OPTS"
-if [ x$USE_TIMER = x1 ] ; then
- MYSQL_TEST_ARGS="$MYSQL_TEST_ARGS --timer-file=$MY_LOG_DIR/timer"
-fi
-MYSQL_TEST_BIN=$MYSQL_TEST
-MYSQL_TEST="$MYSQL_TEST $MYSQL_TEST_ARGS"
-
-# Export MYSQL_TEST variable for use from .test files
-export MYSQL_TEST
-
-GDB_CLIENT_INIT=$MYSQL_TMP_DIR/gdbinit.client
-GDB_MASTER_INIT=$MYSQL_TMP_DIR/gdbinit.master
-GDB_SLAVE_INIT=$MYSQL_TMP_DIR/gdbinit.slave
-GCOV_MSG=$MYSQL_TMP_DIR/mysqld-gcov.out
-GCOV_ERR=$MYSQL_TMP_DIR/mysqld-gcov.err
-GPROF_DIR=$MYSQL_TMP_DIR/gprof
-GPROF_MASTER=$GPROF_DIR/master.gprof
-GPROF_SLAVE=$GPROF_DIR/slave.gprof
-TIMEFILE="$MYSQL_TEST_DIR/var/log/mysqltest-time"
-MYSQLTEST_LOG="$MYSQL_TEST_DIR/var/log/mysqltest.log"
-if [ -n "$DO_CLIENT_GDB" -o -n "$DO_GDB" ] ; then
- XTERM=`which xterm`
-fi
-
-export MYSQL MYSQL_CHECK MYSQL_DUMP MYSQL_SHOW MYSQL_BINLOG MYSQL_FIX_SYSTEM_TABLES CLIENT_BINDIR MASTER_MYSOCK
-
-#++
-# Function Definitions
-#--
-
-prompt_user ()
-{
- $ECHO $1
- read unused
-}
-
-# We can't use diff -u or diff -a as these are not portable
-
-show_failed_diff ()
-{
- reject_file=r/$1.reject
- result_file=r/$1.result
- eval_file=r/$1.eval
-
- if [ -f $eval_file ]
- then
- result_file=$eval_file
- fi
-
- if [ -x "$DIFF" ] && [ -f $reject_file ]
- then
- echo "Below are the diffs between actual and expected results:"
- echo "-------------------------------------------------------"
- $DIFF -c $result_file $reject_file
- echo "-------------------------------------------------------"
- echo "Please follow the instructions outlined at"
- echo "http://forge.mysql.com/wiki/MySQL_Internals_Porting#Debugging_a_MySQL_Server"
- echo "to find the reason to this problem and how to report this."
- echo ""
- fi
-}
-
-do_gdb_test ()
-{
- mysql_test_args="$MYSQL_TEST_ARGS $1"
- $ECHO "set args $mysql_test_args < $2" > $GDB_CLIENT_INIT
- echo "Set breakpoints ( if needed) and type 'run' in gdb window"
- #this xterm should not be backgrounded
- $XTERM -title "Client" -e gdb -x $GDB_CLIENT_INIT $MYSQL_TEST_BIN
-}
-
-error () {
- $ECHO "Error: $1"
- exit 1
-}
-
-error_is () {
- $ECHO "Errors are (from $TIMEFILE) :"
- $CAT < $TIMEFILE
- $ECHO "(the last lines may be the most important ones)"
-}
-
-prefix_to_8() {
- $ECHO " $1" | $SED -e 's:.*\(........\)$:\1:'
-}
-
-pass_inc () {
- TOT_PASS=`$EXPR $TOT_PASS + 1`
-}
-
-fail_inc () {
- TOT_FAIL=`$EXPR $TOT_FAIL + 1`
-}
-
-skip_inc () {
- TOT_SKIP=`$EXPR $TOT_SKIP + 1`
-}
-
-total_inc () {
- TOT_TEST=`$EXPR $TOT_TEST + 1`
-}
-
-
-skip_test() {
- USERT=" ...."
- SYST=" ...."
- REALT=" ...."
- pname=`$ECHO "$1 "|$CUT -c 1-24`
- RES="$pname"
- skip_inc
- $ECHO "$RES$RES_SPACE [ skipped ]"
-}
-
-
-disable_test() {
- USERT=" ...."
- SYST=" ...."
- REALT=" ...."
- pname=`$ECHO "$1 "|$CUT -c 1-24`
- RES="$pname"
- skip_inc
- $ECHO "$RES$RES_SPACE [ disabled ] $2"
-}
-
-
-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
- echo "CURRENT_TEST: $tname" >> $log
- done
- fi
-}
-
-
-report_stats () {
- if [ $TOT_FAIL = 0 ]; then
- $ECHO "All $TOT_TEST tests were successful."
- else
- xten=`$EXPR $TOT_PASS \* 10000`
- raw=`$EXPR $xten / $TOT_TEST`
- raw=`$PRINTF %.4d $raw`
- whole=`$PRINTF %.2s $raw`
- xwhole=`$EXPR $whole \* 100`
- deci=`$EXPR $raw - $xwhole`
- $ECHO "Failed ${TOT_FAIL}/${TOT_TEST} tests, ${whole}.${deci}% were successful."
- $ECHO ""
- $ECHO "The log files in $MY_LOG_DIR may give you some hint"
- $ECHO "of what went wrong."
- $ECHO "If you want to report this error, please read first the documentation at"
- $ECHO "http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html"
- fi
-
- if [ $USE_RUNNING_SERVER -eq 0 ]
- then
-
- # Report if there was any fatal warnings/errors in the log files
- #
- $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' -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" "missing DBUG_RETURN" "mysqld: Warning" "Attempting backtrace" "Assertion .* failed"
- do
- if $GREP "$i" $MY_LOG_DIR/warnings.tmp >> $MY_LOG_DIR/warnings
- then
- GOT_WARNINGS=1
- fi
- done
- $RM -f $MY_LOG_DIR/warnings.tmp
- if [ $GOT_WARNINGS = "1" ]
- then
- echo "WARNING: Got errors/warnings while running tests. Please examine"
- echo "$MY_LOG_DIR/warnings for details."
- fi
-
- fi # USE_RUNNING_SERVER
-
- # Check valgrind errors from mysqltest
- if [ ! -z "$VALGRIND_MYSQLTEST" ]
- then
- if $GREP "ERROR SUMMARY" $MYSQLTEST_LOG | $GREP -v "0 errors" > /dev/null
- then
- $ECHO "Valgrind detected errors!"
- $GREP "ERROR SUMMARY" $MYSQLTEST_LOG | $GREP -v "0 errors"
- $ECHO "See $MYSQLTEST_LOG"
- fi
- fi
-}
-
-mysql_install_db () {
- $ECHO "Removing Stale Files"
- if [ -z "$USE_OLD_DATA" ]; then
- $RM -rf $MASTER_MYDDIR $MASTER_MYDDIR"1"
- $ECHO "Installing Master Databases"
- $INSTALL_DB
- if [ $? != 0 ]; then
- error "Could not install master test DBs"
- exit 1
- fi
- fi
- if [ ! -z "$USE_NDBCLUSTER" ]
- then
- $ECHO "Installing Master Databases 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
- fi
- fi
- $ECHO "Installing Slave Databases"
- $RM -rf $SLAVE_MYDDIR $MY_LOG_DIR/*
-# $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
- fi
-
- for slave_num in 1 2 ;
- do
- $RM -rf var/slave$slave_num-data
- mkdir -p var/slave$slave_num-data/mysql
- mkdir -p var/slave$slave_num-data/test
- cp var/slave-data/mysql/* var/slave$slave_num-data/mysql
- done
- return 0
-}
-
-gprof_prepare ()
-{
- $RM -rf $GPROF_DIR
- mkdir -p $GPROF_DIR
-}
-
-gprof_collect ()
-{
- if [ -f $MASTER_MYDDIR/gmon.out ]; then
- gprof $MASTER_MYSQLD $MASTER_MYDDIR/gmon.out > $GPROF_MASTER
- echo "Master execution profile has been saved in $GPROF_MASTER"
- fi
- if [ -f $SLAVE_MYDDIR/gmon.out ]; then
- gprof $SLAVE_MYSQLD $SLAVE_MYDDIR/gmon.out > $GPROF_SLAVE
- echo "Slave execution profile has been saved in $GPROF_SLAVE"
- fi
-}
-
-gcov_prepare () {
- $FIND $BASEDIR -name \*.gcov \
- -or -name \*.da | $XARGS $RM
-}
-
-gcov_collect () {
- $ECHO "Collecting source coverage info..."
- [ -f $GCOV_MSG ] && $RM $GCOV_MSG
- [ -f $GCOV_ERR ] && $RM $GCOV_ERR
- for d in $MYSQLD_SRC_DIRS; do
- cd $BASEDIR/$d
- for f in *.h *.cc *.c; do
- $GCOV $f 2>>$GCOV_ERR >>$GCOV_MSG
- done
- cd $MYSQL_TEST_DIR
- done
-
- $ECHO "gcov info in $GCOV_MSG, errors in $GCOV_ERR"
-}
-
-abort_if_failed()
-{
- if [ ! $? = 0 ] ; then
- echo $1
- exit 1
- fi
-}
-
-launch_in_background()
-{
- shift
- echo $@ | /bin/sh >> $CUR_MYERR 2>&1 &
- sleep 2 #hack
- return
-}
-
-shutdown_mysqld()
-{
- pid=$1
- ident=$2
- # 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
-}
-
-start_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
- if [ "$DO_BENCH" != 1 -a -z "$NDBCLUSTER_EXTRA_OPTS" ]
- then
- NDBCLUSTER_EXTRA_OPTS="--small"
- fi
- 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
- USING_NDBCLUSTER=0
- USE_NDBCLUSTER_OPT=
- return
- fi
-
- NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
- else
- NDB_CONNECTSTRING="$USE_RUNNING_NDBCLUSTER"
- echo "Using ndbcluster at $NDB_CONNECTSTRING"
- fi
- USE_NDBCLUSTER_OPT="$USE_NDBCLUSTER --ndb-connectstring=\"$NDB_CONNECTSTRING\" --ndb-extra-logging"
- export NDB_CONNECTSTRING
- fi
-}
-
-rm_ndbcluster_tables()
-{
- $RM -f $1/mysql/apply_status*
- $RM -f $1/mysql/schema*
-}
-
-stop_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
-}
-
-# The embedded server needs the cleanup so we do some of the start work
-# but stop before actually running mysqld or anything.
-
-start_master()
-{
- eval "this_master_running=\$MASTER$1_RUNNING"
- if [ x$this_master_running = x1 ] || [ x$LOCAL_MASTER = x1 ] ; then
- return
- fi
- # Remove stale binary logs except for 2 tests which need them
- if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" != "rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ]
- then
- $RM -f $MYSQL_TEST_DIR/var/log/master-bin$1.*
- fi
-
- # Remove old master.info and relay-log.info files
- $RM -f $MYSQL_TEST_DIR/var/master-data$1/master.info $MYSQL_TEST_DIR/var/master-data$1/relay-log.info
-
- #run master initialization shell script if one exists
-
- if [ -f "$master_init_script" ] ;
- then
- /bin/sh $master_init_script
- fi
- cd $BASEDIR # for gcov
- if [ -n "$1" ] ; then
- id=`$EXPR $1 + 101`;
- this_master_myport=`$EXPR $MASTER_MYPORT + $1`
- NOT_FIRST_MASTER_EXTRA_OPTS="--skip-innodb"
- eval "MASTER_MYPORT$1=$this_master_myport"
- export MASTER_MYPORT$1
- else
- id=1;
- this_master_myport=$MASTER_MYPORT
- NOT_FIRST_MASTER_EXTRA_OPTS=""
- fi
- if [ -n "$EXTRA_MASTER_MYSQLD_TRACE" ]
- 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 \
- --server-id=$id \
- --basedir=$MY_BASEDIR \
- --port=$this_master_myport \
- --port-open-timeout=380 \
- --local-infile \
- --exit-info=256 \
- --core \
- $USE_NDBCLUSTER_OPT \
- --datadir=$MASTER_MYDDIR$1 \
- --pid-file=$MASTER_MYPID$1 \
- --socket=$MASTER_MYSOCK$1 \
- --log=$MASTER_MYLOG$1 \
- --character-sets-dir=$CHARSETSDIR \
- --default-character-set=$CHARACTER_SET \
- --tmpdir=$MYSQL_TMP_DIR \
- --language=$LANGUAGE \
- --innodb_data_file_path=ibdata1:128M:autoextend \
- --open-files-limit=1024 \
- --log-bin-trust-function-creators \
- $MASTER_40_ARGS \
- $SMALL_SERVER \
- $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 \
- --server-id=$id --rpl-recovery-rank=1 \
- --basedir=$MY_BASEDIR --init-rpl-role=master \
- --port=$this_master_myport \
- --port-open-timeout=380 \
- --local-infile \
- --datadir=$MASTER_MYDDIR$1 \
- --pid-file=$MASTER_MYPID$1 \
- --socket=$MASTER_MYSOCK$1 \
- --character-sets-dir=$CHARSETSDIR \
- --default-character-set=$CHARACTER_SET \
- --core \
- $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 \
- $MASTER_MYSQLD_BINLOG_OPT \
- $EXTRA_MASTER_MYSQLD_OPT $EXTRA_MASTER_OPT \
- $NOT_FIRST_MASTER_EXTRA_OPTS"
- fi
-
- CUR_MYERR=$MASTER_MYERR$1
- CUR_MYSOCK=$MASTER_MYSOCK$1
-
- # For embedded server we collect the server flags and return
- if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
- # Add a -A to each argument to pass it to embedded server
- EMBEDDED_SERVER_OPTS=""
- for opt in $master_args
- do
- EMBEDDED_SERVER_OPTS="$EMBEDDED_SERVER_OPTS -A $opt"
- done
- EXTRA_MYSQL_TEST_OPT="$EMBEDDED_SERVER_OPTS"
- return
- fi
-
- if [ x$DO_DDD = x1 ]
- then
- $ECHO "set args $master_args" > $GDB_MASTER_INIT$1
- launch_in_background master ddd -display $DISPLAY --debugger \
- "gdb -x $GDB_MASTER_INIT$1" $MASTER_MYSQLD
- elif [ x$DO_GDB = x1 ]
- then
- if [ x$MANUAL_GDB = x1 ]
- then
- $ECHO "set args $master_args" > $GDB_MASTER_INIT$1
- $ECHO "To start gdb for the master , type in another window:"
- $ECHO "cd $MYSQL_TEST_DIR ; gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD"
- wait_for_master=1500
- else
- ( $ECHO set args $master_args;
- if [ $USE_MANAGER = 0 ] ; then
- cat <<EOF
-b mysql_parse
-commands 1
-disa 1
-end
-r
-EOF
- fi ) > $GDB_MASTER_INIT$1
- launch_in_background master $XTERM -display $DISPLAY \
- -title "Master" -e gdb -x $GDB_MASTER_INIT$1 $MASTER_MYSQLD
- fi
- else
- 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
- eval "MASTER$1_RUNNING=1"
-}
-
-start_slave()
-{
- [ 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"
- if [ -n "$1" ] ;
- then
- slave_server_id=`$EXPR 2 + $1`
- slave_rpl_rank=$slave_server_id
- slave_port=`expr $SLAVE_MYPORT + $1`
- slave_log="$SLAVE_MYLOG.$1"
- slave_err="$SLAVE_MYERR.$1"
- slave_datadir="$SLAVE_MYDDIR/../$slave_ident-data/"
- slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid"
- slave_sock="$SLAVE_MYSOCK-$1"
- else
- slave_server_id=2
- slave_rpl_rank=2
- slave_port=$SLAVE_MYPORT
- slave_log=$SLAVE_MYLOG
- slave_err=$SLAVE_MYERR
- slave_datadir=$SLAVE_MYDDIR
- 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" ]
- then
- $RM -f $MYSQL_TEST_DIR/var/log/$slave_ident-*bin.*
- $RM -f $slave_datadir/master.info $slave_datadir/relay-log.info
- fi
-
- #run slave initialization shell script if one exists
- if [ -f "$slave_init_script" ] ;
- then
- /bin/sh $slave_init_script
- fi
-
- if [ -z "$SLAVE_MASTER_INFO" ] ; then
- master_info="--master-user=root \
- --master-connect-retry=1 \
- --master-host=127.0.0.1 \
- --master-password="" \
- --master-port=$MASTER_MYPORT \
- --server-id=$slave_server_id --rpl-recovery-rank=$slave_rpl_rank"
- else
- 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 \
- $SLAVE_MYSQLDBINLOG_OPT \
- --relay-log=$MYSQL_TEST_DIR/var/log/$slave_ident-relay-bin \
- --log=$slave_log \
- --basedir=$MY_BASEDIR \
- --datadir=$slave_datadir \
- --pid-file=$slave_pid \
- --port=$slave_port \
- --port-open-timeout=380 \
- --socket=$slave_sock \
- --character-sets-dir=$CHARSETSDIR \
- --default-character-set=$CHARACTER_SET \
- --core --init-rpl-role=slave \
- --tmpdir=$MYSQL_TMP_DIR \
- --language=$LANGUAGE \
- --skip-innodb --skip-ndbcluster --skip-slave-start \
- --slave-load-tmpdir=$SLAVE_LOAD_TMPDIR \
- --report-host=127.0.0.1 --report-user=root \
- --report-port=$slave_port \
- --master-retry-count=10 \
- -O slave_net_timeout=10 \
- --log-bin-trust-function-creators \
- $SMALL_SERVER \
- $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
- launch_in_background $slave_ident ddd -display $DISPLAY --debugger \
- "gdb -x $GDB_SLAVE_INIT" $SLAVE_MYSQLD
- elif [ x$DO_GDB = x1 ]
- then
- if [ x$MANUAL_GDB = x1 ]
- then
- $ECHO "set args $slave_args" > $GDB_SLAVE_INIT
- echo "To start gdb for the slave, type in another window:"
- echo "cd $MYSQL_TEST_DIR ; gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD"
- wait_for_slave=1500
- else
- ( $ECHO set args $slave_args;
- if [ $USE_MANAGER = 0 ] ; then
- cat <<EOF
-b mysql_parse
-commands 1
-disa 1
-end
-r
-EOF
- fi ) > $GDB_SLAVE_INIT
- launch_in_background $slave_ident $XTERM -display $DISPLAY -title "Slave" -e \
- gdb -x $GDB_SLAVE_INIT $SLAVE_MYSQLD
- fi
- else
- launch_in_background $slave_ident $SLAVE_MYSQLD $slave_args
- fi
- eval "SLAVE$1_RUNNING=1"
- sleep_until_file_created $slave_pid $wait_for_slave
- wait_for_slave=$SLEEP_TIME_FOR_SECOND_SLAVE
-}
-
-mysql_start ()
-{
-# We should not start the daemon here as we don't know the arguments
-# for the test. Better to let the test start the daemon
-
-# $ECHO "Starting MySQL daemon"
-# start_master
-# start_slave
- cd $MYSQL_TEST_DIR
- return 1
-}
-
-stop_slave ()
-{
- eval "this_slave_running=\$SLAVE$1_RUNNING"
- slave_ident="slave$1"
- if [ -n "$1" ] ;
- then
- slave_pid="$MYRUN_DIR/mysqld-$slave_ident.pid"
- else
- slave_pid=$SLAVE_MYPID
- fi
- if [ x$this_slave_running = x1 ]
- then
- pid=`$CAT $slave_pid`
- shutdown_mysqld $pid $slave_ident
- if [ $? != 0 ] && [ -f $slave_pid ]
- then # try harder!
- $ECHO "slave not cooperating with mysqladmin, will try manual kill"
- kill $pid
- sleep_until_file_deleted $pid $slave_pid
- if [ -f $slave_pid ] ; then
- $ECHO "slave refused to die. Sending SIGKILL"
- kill -9 `$CAT $slave_pid`
- $RM -f $slave_pid
- else
- $ECHO "slave responded to SIGTERM "
- fi
- else
- 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
-}
-
-stop_slave_threads ()
-{
- eval "this_slave_running=\$SLAVE$1_RUNNING"
- slave_ident="slave$1"
- if [ x$this_slave_running = x1 ]
- then
- $MYSQLADMIN --no-defaults -uroot --socket=$MYSQL_TMP_DIR/$slave_ident.sock stop-slave > /dev/null 2>&1
- fi
-}
-
-stop_master ()
-{
- eval "this_master_running=\$MASTER$1_RUNNING"
- if [ x$this_master_running = x1 ]
- then
- # For embedded server we don't stop anyting but mark that
- # MASTER_RUNNING=0 to get cleanup when calling start_master().
- if [ x$USE_EMBEDDED_SERVER != x1 ] ; then
- pid=`$CAT $MASTER_MYPID$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"
- kill $pid
- sleep_until_file_deleted $pid $MASTER_MYPID$1
- if [ -f $MASTER_MYPID$1 ] ; then
- $ECHO "master refused to die. Sending SIGKILL"
- kill -9 `$CAT $MASTER_MYPID$1`
- $RM -f $MASTER_MYPID$1
- else
- $ECHO "master responded to SIGTERM "
- fi
- else
- sleep $SLEEP_TIME_AFTER_RESTART
- fi
- fi
- eval "MASTER$1_RUNNING=0"
- fi
-}
-
-mysql_stop ()
-{
- if [ "$MASTER_RUNNING" = 1 ]
- then
- $ECHO "Ending Tests"
- $ECHO "Shutting-down MySQL daemon"
- $ECHO ""
- stop_master
- stop_master 1
- $ECHO "Master shutdown finished"
- stop_slave
- stop_slave 1
- stop_slave 2
- $ECHO "Slave shutdown finished"
- stop_ndbcluster
- fi
- return 1
-}
-
-mysql_restart ()
-{
- mysql_stop
- mysql_start
- return 1
-}
-
-mysql_loadstd () {
-
- # cp $STD_DATA/*.frm $STD_DATA/*.MRG $MASTER_MYDDIR/test
- return 1
-}
-
-run_testcase ()
-{
- tf=$1
- tname=`$BASENAME $tf .test`
- master_opt_file=$TESTDIR/$tname-master.opt
- slave_opt_file=$TESTDIR/$tname-slave.opt
- master_init_script=$TESTDIR/$tname-master.sh
- slave_init_script=$TESTDIR/$tname-slave.sh
- slave_master_info_file=$TESTDIR/$tname.slave-mi
- tsrcdir=$TESTDIR/$tname-src
- result_file="r/$tname.result"
- 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
- fi
- if [ "$USE_MANAGER" = 1 ] ; then
- many_slaves=`$EXPR \( \( $tname : rpl_failsafe \) != 0 \) \| \( \( $tname : rpl_chain_temp_table \) != 0 \)`
- fi
- if $EXPR "$tname" '<' "$START_FROM" > /dev/null ; then
- #skip_test $tname
- return
- fi
-
- if [ "$SKIP_TEST" ] ; then
- if $EXPR \( "$tname" : "$SKIP_TEST" \) > /dev/null ; then
- skip_test $tname
- return
- fi
- fi
-
- if [ "$DO_TEST" ] ; then
- if $EXPR \( "$tname" : "$DO_TEST" \) > /dev/null ; then
- : #empty command to keep some shells happy
- else
- #skip_test $tname
- return
- fi
- fi
-
- if [ x${NO_SLAVE}x$SKIP_SLAVE = x1x0 ] ; then
- skip_test $tname
- return
- fi
-
-# if [ -f "$TESTDIR/$tname.disabled" ]
-# then
-# comment=`$CAT $TESTDIR/$tname.disabled`;
-# disable_test $tname "$comment"
-# return
-# fi
- if [ -f "$TESTDIR/disabled.def" ] ; then
- comment=`$GREP "^$tname *: *" $TESTDIR/disabled.def`;
- if [ -n "$comment" ]
- then
- comment=`echo $comment | sed 's/^[^:]*: *//'`
- disable_test $tname "$comment"
- return
- fi
- fi
-
- if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then
- # Stop all slave threads, so that we don't have useless reconnection
- # attempts and error messages in case the slave and master servers restart.
- stop_slave_threads
- stop_slave_threads 1
- stop_slave_threads 2
- fi
-
- # FIXME temporary solution, we will get a new C version of this
- # script soon anyway so it is not worth it spending the time
- if [ "x$USE_EMBEDDED_SERVER" = "x1" -a -z "$DO_TEST" ] ; then
- for t in \
- "init_connect" \
- "init_file"
- do
- if [ "$tname" = "$t" ] ; then
- skip_test $tname
- return
- fi
- done
- fi
-
- if [ $USE_RUNNING_SERVER -eq 0 ] ;
- then
- if [ -f $master_opt_file ] ;
- then
- EXTRA_MASTER_OPT=`$CAT $master_opt_file | $SED -e "s;\\$MYSQL_TEST_DIR;$MYSQL_TEST_DIR;"`
- case "$EXTRA_MASTER_OPT" in
- --timezone=*)
- TZ=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--timezone=;;"`
- export TZ
- # Note that this must be set to space, not "" for test-reset to work
- EXTRA_MASTER_OPT=" "
- ;;
- --result-file=*)
- result_file=`$ECHO "$EXTRA_MASTER_OPT" | $SED -e "s;--result-file=;;"`
- result_file="r/$result_file.result"
- # Note that this must be set to space, not "" for test-reset to work
- EXTRA_MASTER_OPT=" "
- ;;
- --force-restart)
- # Note that this must be set to space, not "" for test-reset to work
- EXTRA_MASTER_OPT=" "
- ;;
- 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 [ 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
- else
- # If we had extra master opts to the previous run
- # 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 ] || \
- [ -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 [ 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
- report_current_test $tname
- fi
- fi
-
- # We never start a slave if embedded server is used
- if [ "x$USE_EMBEDDED_SERVER" != "x1" ] ; then
- do_slave_restart=0
- if [ -f $slave_opt_file ] ;
- then
- EXTRA_SLAVE_OPT=`$CAT $slave_opt_file | $SED -e "s;\\$MYSQL_TEST_DIR;$MYSQL_TEST_DIR;"`
- do_slave_restart=1
- else
- if [ ! -z "$EXTRA_SLAVE_OPT" ] || [ x$SLAVE_RUNNING != x1 ] ;
- then
- EXTRA_SLAVE_OPT=""
- do_slave_restart=1
- fi
- fi
-
- if [ -f $slave_master_info_file ] ; then
- SLAVE_MASTER_INFO=`$CAT $slave_master_info_file`
- do_slave_restart=1
- else
- if [ ! -z "$SLAVE_MASTER_INFO" ] || [ x$SLAVE_RUNNING != x1 ] ;
- then
- SLAVE_MASTER_INFO=""
- do_slave_restart=1
- 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
- start_slave
- else
- echo "CURRENT_TEST: $tname" >> $SLAVE_MYERR
- fi
- if [ x$many_slaves = x1 ]; then
- start_slave 1
- start_slave 2
- fi
- fi
- fi
-
- if [ "x$START_AND_EXIT" = "x1" ] ; then
- echo "Servers started, exiting"
- exit
- fi
-
- cd $MYSQL_TEST_DIR
-
- if [ -f $tf ] ; then
- $RM -f r/$tname.*reject
- mysql_test_args="-R $result_file $EXTRA_MYSQL_TEST_OPT"
- if [ -z "$DO_CLIENT_GDB" ] ; then
- `$VALGRIND_MYSQLTEST $MYSQL_TEST $mysql_test_args < $tf 2> $TIMEFILE`;
- else
- do_gdb_test "$mysql_test_args" "$tf"
- fi
-
- res=$?
-
- # Save the testcase log to mysqltest log file
- echo "CURRENT_TEST: $tname" >> $MYSQLTEST_LOG
- cat $TIMEFILE >> $MYSQLTEST_LOG
-
- pname=`$ECHO "$tname "|$CUT -c 1-24`
- RES="$pname"
-
- if [ x$many_slaves = x1 ] ; then
- stop_slave 1
- stop_slave 2
- fi
-
- if [ $res = 0 ]; then
- total_inc
- pass_inc
- TIMER=""
- if [ x$USE_TIMER = x1 -a -f "$MY_LOG_DIR/timer" ]; then
- TIMER=`cat $MY_LOG_DIR/timer`
- TIMER=`$PRINTF "%13s" $TIMER`
- fi
- $ECHO "$RES$RES_SPACE [ pass ] $TIMER"
- else
- # why the following ``if'' ? That is why res==1 is special ?
- if [ $res = 62 ]; then
- skip_inc
- $ECHO "$RES$RES_SPACE [ skipped ]"
- else
- if [ $res -ne 1 ]; then
- $ECHO "mysqltest returned unexpected code $res, it has probably crashed" >> $TIMEFILE
- fi
- total_inc
- fail_inc
- $ECHO "$RES$RES_SPACE [ fail ]"
- $ECHO
- error_is
- show_failed_diff $tname
- $ECHO
- if [ x$FORCE != x1 ] ; then
- $ECHO "Aborting: $tname failed in $TEST_MODE mode. To continue, re-run with '--force'."
- $ECHO
- if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && \
- [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
- then
- mysql_stop
- fi
- exit 1
- fi
- FAILED_CASES="$FAILED_CASES $tname"
- if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && \
- [ -z "$DO_DDD" ] && [ -z "$USE_EMBEDDED_SERVER" ]
- then
- mysql_restart
- fi
- fi
- fi
- fi
-}
-
-run_stress_test()
-{
-
- STRESS_BASEDIR="$MYSQL_TEST_DIR/var/stress"
-
- #Clean-up old stress test basedir
- if [ -d $STRESS_BASEDIR ] ; then
- $RM -rf $STRESS_BASEDIR
- fi
- #Create stress test basedir
- mkdir $STRESS_BASEDIR
-
- if [ "$STRESS_SUITE" != "main" -a "$STRESS_SUITE" != "default" ] ; then
- STRESS_SUITE_DIR="$MYSQL_TEST_DIR/suite/$STRESS_SUITE"
- else
- STRESS_SUITE_DIR="$MYSQL_TEST_DIR"
- fi
-
- if [ -d "$STRESS_SUITE_DIR" ] ; then
- STRESS_SUITE_T_DIR="$STRESS_SUITE_DIR/t"
- STRESS_SUITE_R_DIR="$STRESS_SUITE_DIR/r"
- #FIXME: check that dirs above are exist
- else
- echo "Directory $STRESS_SUITE_DIR with test suite doesn't exists. Abort stress testing"
- exit 1
- fi
-
- if [ -n "$STRESS_TEST" ] ; then
- STRESS_TEST_FILE="$STRESS_BASEDIR/stress_tests.txt"
- echo $STRESS_TEST > $STRESS_TEST_FILE
- elif [ -n "$STRESS_TEST_FILE" ] ; then
- STRESS_TEST_FILE="$STRESS_SUITE_DIR/$STRESS_TEST_FILE"
- if [ ! -f "$STRESS_TEST_FILE" ] ; then
- echo "Specified file $STRESS_TEST_FILE with list of tests does not exist"
- echo "Please ensure that file exists and has proper permissions"
- exit 1
- fi
- else
- STRESS_TEST_FILE="$STRESS_SUITE_DIR/stress_tests.txt"
- if [ ! -f "$STRESS_TEST_FILE" ] ; then
- echo "Default file $STRESS_TEST_FILE with list of tests does not exist."
- echo "Please use --stress-test-file option to specify custom one or you can"
- echo "just specify name of test for testing as last argument in command line"
- exit 1
- fi
- fi
-
- if [ -n "$STRESS_INIT_FILE" ] ; then
- STRESS_INIT_FILE="$STRESS_SUITE_DIR/$STRESS_INIT_FILE"
- if [ ! -f "$STRESS_INIT_FILE" ] ; then
- echo "Specified file $STRESS_INIT_FILE with list of tests doesn't exist."
- echo "Please ensure that file exists and has proper permissions"
- exit 1
- fi
- else
- STRESS_INIT_FILE="$STRESS_SUITE_DIR/stress_init.txt"
- #Check for default init file
- if [ ! -f "$STRESS_INIT_FILE" ] ; then
- STRESS_INIT_FILE=""
- fi
- fi
-
- if [ "$STRESS_MODE" != "random" -a "$STRESS_MODE" != "seq" ] ; then
- echo "You specified wrong mode '$STRESS_MODE' for stress test."
- echo "Correct values are 'random' or 'seq'"
- exit 1
- fi
-
- STRESS_TEST_ARGS="--server-socket=$MASTER_MYSOCK \
- --server-user=$DBUSER \
- --server-database=$DB \
- --stress-suite-basedir=$MYSQL_TEST_DIR \
- --suite=$STRESS_SUITE \
- --stress-tests-file=$STRESS_TEST_FILE \
- --stress-basedir=$STRESS_BASEDIR \
- --server-logs-dir=$STRESS_BASEDIR \
- --stress-mode=$STRESS_MODE \
- --mysqltest=$CLIENT_BINDIR/mysqltest \
- --threads=$STRESS_THREADS \
- --verbose \
- --cleanup \
- --log-error-details \
- --abort-on-error"
-
- if [ -n "$STRESS_INIT_FILE" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --stress-init-file=$STRESS_INIT_FILE"
- fi
-
- if [ -z "$STRESS_LOOP_COUNT" -a -z "$STRESS_TEST_COUNT" -a
- -z "$STRESS_TEST_DURATION" ] ; then
-
- #Limit stress testing with 20 loops in case when any limit parameter
- #was specified
- STRESS_TEST_COUNT=20
- fi
-
- if [ -n "$STRESS_LOOP_COUNT" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --loop-count=$STRESS_LOOP_COUNT"
- fi
-
- if [ -n "$STRESS_TEST_COUNT" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --test-count=$STRESS_TEST_COUNT"
- fi
-
- if [ -n "$STRESS_TEST_DURATION" ] ; then
- STRESS_TEST_ARGS="$STRESS_TEST_ARGS --test-duration=$STRESS_TEST_DURATION"
- fi
-
- echo "Stress test related variables:"
- echo "TESTS - $1"
- echo "STRESS - $DO_STRESS"
- echo "STRESS_SUITE - $STRESS_SUITE"
- echo "STRESS_TEST_FILE - $STRESS_TEST_FILE"
- echo "STRESS_INIT_FILE - $STRESS_INIT_FILE"
- echo "STRESS_THREADS - $STRESS_THREADS"
- echo "STRESS_MODE - $STRESS_MODE"
- echo "STRESS_TEST_COUNT - $STRESS_TEST_COUNT"
- echo "STRESS_LOOP_COUNT - $STRESS_LOOP_COUNT"
- echo "STRESS_TEST_DURATION - $STRESS_TEST_DURATION"
-
- #echo "$STRESS_TEST_ARGS";
- #Run stress test
- $MYSQL_TEST_DIR/mysql-stress-test.pl $STRESS_TEST_ARGS
-
-
-}
-
-######################################################################
-# Main script starts here
-######################################################################
-
-[ "$DO_GCOV" -a ! -x "$GCOV" ] && error "No gcov found"
-
-[ "$DO_GCOV" ] && gcov_prepare
-[ "$DO_GPROF" ] && gprof_prepare
-
-if [ $USE_RUNNING_SERVER -eq 0 ]
-then
- if [ -z "$FAST_START" ]
- then
- # Ensure that no old mysqld test servers are running
- $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 --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
- else
- rm $MASTER_MYPID $MASTER_MYPID"1" $SLAVE_MYPID
- 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 -rf $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
-
- # Remove old berkeley db log files that can confuse the server
- $RM -f $MASTER_MYDDIR/log.*
- $RM -f $MASTER_MYDDIR"1"/log.*
-
- # Remove old log and reject files
- $RM -f r/*.reject r/*.progress r/*.log r/*.warnings
-
- wait_for_master=$SLEEP_TIME_FOR_FIRST_MASTER
- wait_for_slave=$SLEEP_TIME_FOR_FIRST_SLAVE
- $ECHO "Installing Test Databases"
- mysql_install_db
-
- if [ -n "$1" -a `expr "X$*" : '.*ndb'` -eq 0 ]
- then
- USING_NDBCLUSTER=0
- USE_NDBCLUSTER_OPT=
- fi
-
- mysql_start
- $ECHO "Loading Standard Test Databases"
- mysql_loadstd
-fi
-
-$ECHO "Starting Tests"
-
-# Some test cases need USE_RUNNING_SERVER
-export USE_RUNNING_SERVER
-
-#
-# This can probably be deleted
-#
-if [ "$DO_BENCH" = 1 ]
-then
- start_master
-
- if [ "$DO_SMALL_BENCH" = 1 ]
- then
- EXTRA_BENCH_ARGS="--small-test --small-tables"
- fi
-
- if [ x$USING_NDBCLUSTER = x1 ]
- then
- EXTRA_BENCH_ARGS="--create-options=TYPE=ndb $EXTRA_BENCH_ARGS"
- fi
-
- BENCHDIR=$BASEDIR/sql-bench/
- savedir=`pwd`
- cd $BENCHDIR
- if [ -z "$1" ]
- then
- ./run-all-tests --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS --log
- else
- if [ -x "./$1" ]
- then
- ./$1 --socket=$MASTER_MYSOCK --user=root $EXTRA_BENCH_ARGS
- else
- echo "benchmark $1 not found"
- fi
- fi
- cd $savedir
- mysql_stop
- exit
-fi
-
-#
-# Stress testing
-#
-if [ "$DO_STRESS" = 1 ]
-then
-
- if [ -n "$1" ] ; then
- STRESS_TEST="$1";
- fi
-
- if [ $USE_RUNNING_SERVER -eq 0 ] ; then
- start_master
- fi
-
- run_stress_test
-
- if [ $USE_RUNNING_SERVER -eq 0 ] ; then
- mysql_stop
- fi
-
- exit
-
-fi
-
-
-$ECHO
-if [ x$USE_TIMER = x1 ] ; then
-$ECHO "TEST RESULT TIME (ms)"
-else
-$ECHO "TEST RESULT"
-fi
-$ECHO $DASH72
-
-if [ -z "$1" ] ;
-then
- if [ x$RECORD = x1 ]; then
- $ECHO "Will not run in record mode without a specific test case."
- else
- for tf in $TESTDIR/*.$TESTSUFFIX
- do
- run_testcase $tf
- done
- $RM -f $TIMEFILE # Remove for full test
- fi
-else
- while [ ! -z "$1" ]; do
- tname=`$BASENAME $1 .test`
- tf=$TESTDIR/$tname.$TESTSUFFIX
- if [ -f $tf ] ; then
- run_testcase $tf
- else
- $ECHO "Test case $tf does not exist."
- fi
- shift
- done
-fi
-
-$ECHO $DASH72
-$ECHO
-
-if [ -z "$DO_GDB" ] && [ $USE_RUNNING_SERVER -eq 0 ] && [ -z "$DO_DDD" ]
-then
- mysql_stop
-fi
-report_stats
-$ECHO
-
-[ "$DO_GCOV" ] && gcov_collect # collect coverage information
-[ "$DO_GPROF" ] && gprof_collect # collect coverage information
-
-if [ $TOT_FAIL -ne 0 ]; then
- $ECHO "mysql-test-run in $TEST_MODE mode: *** Failing the test(s):$FAILED_CASES"
- $ECHO
- exit 1
-fi
-if [ $GOT_WARNINGS -ne 0 ]; then
- exit 1
-fi
-exit 0
diff -Nrup a/mysql-test/ndb/Makefile.am b/mysql-test/ndb/Makefile.am
--- a/mysql-test/ndb/Makefile.am 2006-04-12 14:08:11 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,23 +0,0 @@
-
-benchdir_root= $(prefix)
-testdir = $(benchdir_root)/mysql-test/ndb
-
-EXTRA_DIST = ndbcluster.sh
-CLEANFILES = ndbcluster
-dist_test_DATA = ndb_config_2_node.ini ndb_config_1_node.ini
-test_SCRIPTS = ndbcluster
-
-SUFFIXES = .sh
-
-.sh:
- @RM@ -f $@ $@-t
- @SED@ \
- -e 's!@''ndb_port''@!$(ndb_port)!g' \
- -e 's!@''ndbbindir''@!$(ndbbindir)!g' \
- -e 's!@''ndbtoolsdir''@!$(ndbtoolsdir)!g' \
- $< > $@-t
- @CHMOD@ +x $@-t
- @MV@ $@-t $@
-
-# Don't update the files from bitkeeper
-%::SCCS/s.%
diff -Nrup a/mysql-test/ndb/basic.result b/mysql-test/ndb/basic.result
--- a/mysql-test/ndb/basic.result 2005-01-09 23:02:01 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,69 +0,0 @@
--- NDB Cluster -- Management Client --
----------------------------------------------------------------------------
- NDB Cluster -- Management Client -- Help
----------------------------------------------------------------------------
-HELP Print help text
-HELP SHOW Help for SHOW command
-HELP DEBUG Help for debug compiled version
-SHOW Print information about cluster
-START BACKUP [NOWAIT | WAIT STARTED | WAIT COMPLETED]
- Start backup (default WAIT COMPLETED)
-ABORT BACKUP <backup id> Abort backup
-SHUTDOWN Shutdown all processes in cluster
-CLUSTERLOG ON [<severity>] ... Enable Cluster logging
-CLUSTERLOG OFF [<severity>] ... Disable Cluster logging
-CLUSTERLOG TOGGLE [<severity>] ... Toggle severity filter on/off
-CLUSTERLOG INFO Print cluster log information
-<id> START Start DB node (started with -n)
-<id> RESTART [-n] [-i] Restart DB node
-<id> STOP Stop DB node
-ENTER SINGLE USER MODE <api-node> Enter single user mode
-EXIT SINGLE USER MODE Exit single user mode
-<id> STATUS Print status
-<id> CLUSTERLOG {<category>=<level>}+ Set log level for cluster log
-PURGE STALE SESSIONS Reset reserved nodeid's in the mgmt server
-CONNECT [<connectstring>] Connect to management server (reconnect if already connected)
-QUIT Quit management client
-
-<severity> = ALERT | CRITICAL | ERROR | WARNING | INFO | DEBUG
-<category> = STARTUP | SHUTDOWN | STATISTICS | CHECKPOINT | NODERESTART | CONNECTION | INFO | ERROR | CONGESTION | DEBUG | BACKUP
-<level> = 0 - 15
-<id> = ALL | Any database node id
-
-Connected to Management Server at: localhost:1186
-Node 1: started (Version 5.0.3)
-Node 2: started (Version 5.0.3)
-
-Node 1: started (Version 5.0.3)
-
-Node 2: started (Version 5.0.3)
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Cluster logging is disabled
-Cluster logging is enabled.
-Cluster logging is disabled
-ALL disabled
-ALL enabled
diff -Nrup a/mysql-test/ndb/basic.test b/mysql-test/ndb/basic.test
--- a/mysql-test/ndb/basic.test 2004-12-08 22:47:36 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,17 +0,0 @@
-help
-all status
-1 status
-2 status
-all clusterlog connection=8
-all clusterlog startup=7
-all clusterlog checkpoint=7
-all clusterlog noderestart=15
-all clusterlog statistics=7
-all clusterlog error=7
-all clusterlog info=7
-all clusterlog backup=15
-clusterlog off
-clusterlog toggle
-clusterlog off
-clusterlog off all
-clusterlog on all
diff -Nrup a/mysql-test/ndb/ndb_config_1_node.ini b/mysql-test/ndb/ndb_config_1_node.ini
--- a/mysql-test/ndb/ndb_config_1_node.ini 2007-06-04 10:29:53 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,47 +0,0 @@
-[ndbd default]
-NoOfReplicas= 1
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
-DataMemory= CHOOSE_DataMemory
-IndexMemory= CHOOSE_IndexMemory
-Diskless= CHOOSE_Diskless
-TimeBetweenWatchDogCheck= 30000
-DataDir= CHOOSE_FILESYSTEM
-MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
-MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 8
-FragmentLogFileSize= 6M
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-
-[ndb_mgmd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-DataDir= CHOOSE_FILESYSTEM #
-PortNumber= CHOOSE_PORT_MGM
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff -Nrup a/mysql-test/ndb/ndb_config_2_node.ini b/mysql-test/ndb/ndb_config_2_node.ini
--- a/mysql-test/ndb/ndb_config_2_node.ini 2007-07-12 17:27:50 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,55 +0,0 @@
-[ndbd default]
-NoOfReplicas= 2
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
-DataMemory= CHOOSE_DataMemory
-IndexMemory= CHOOSE_IndexMemory
-Diskless= CHOOSE_Diskless
-TimeBetweenWatchDogCheck= 30000
-DataDir= CHOOSE_FILESYSTEM
-MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
-MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 4
-FragmentLogFileSize=12M
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-# O_DIRECT has issues on 2.4 whach have not been handled, Bug #29612
-#ODirect= 1
-# the following parametes just function as a small regression
-# test that the parameter exists
-InitialNoOfOpenFiles= 27
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress
-
-[ndb_mgmd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-DataDir= CHOOSE_FILESYSTEM #
-PortNumber= CHOOSE_PORT_MGM
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff -Nrup a/mysql-test/ndb/ndb_config_4_node.ini b/mysql-test/ndb/ndb_config_4_node.ini
--- a/mysql-test/ndb/ndb_config_4_node.ini 2007-05-08 19:07:33 +02:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,55 +0,0 @@
-[ndbd default]
-NoOfReplicas= 2
-MaxNoOfConcurrentTransactions= 64
-MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
-DataMemory= CHOOSE_DataMemory
-IndexMemory= CHOOSE_IndexMemory
-Diskless= CHOOSE_Diskless
-TimeBetweenWatchDogCheck= 30000
-DataDir= CHOOSE_FILESYSTEM
-MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
-MaxNoOfAttributes= CHOOSE_MaxNoOfAttributes
-TimeBetweenGlobalCheckpoints= 500
-NoOfFragmentLogFiles= 3
-DiskPageBufferMemory= CHOOSE_DiskPageBufferMemory
-
-#
-# Increase timeouts to cater for slow test-machines
-# (possibly running several tests in parallell)
-#
-HeartbeatIntervalDbDb= 30000
-HeartbeatIntervalDbApi= 30000
-#TransactionDeadlockDetectionTimeout= 7500
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_2 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_3 # hostname is a valid network adress
-
-[ndbd]
-HostName= CHOOSE_HOSTNAME_4 # hostname is a valid network adress
-
-[ndb_mgmd]
-HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
-DataDir= CHOOSE_FILESYSTEM #
-PortNumber= CHOOSE_PORT_MGM
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
-
-[mysqld]
diff -Nrup a/mysql-test/ndb/ndbcluster.sh b/mysql-test/ndb/ndbcluster.sh
--- a/mysql-test/ndb/ndbcluster.sh 2007-03-21 08:02:09 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,414 +0,0 @@
-#!/bin/sh
-# Copyright (C) 2004 MySQL AB
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; version 2 of the License.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-# This scripts starts the table handler ndbcluster
-
-# configurable parameters, make sure to change in mysqlcluterd as well
-port=@ndb_port@
-fsdir=`pwd`
-# end configurable parameters
-
-#BASEDIR is always one above mysql-test directory
-CWD=`pwd`
-cd ..
-BASEDIR=`pwd`
-cd $CWD
-
-# Are we using a source or a binary distribution?
-if [ -d ../sql ] ; then
- SOURCE_DIST=1
- ndbtop=$BASEDIR/storage/ndb
- exec_ndb=$ndbtop/src/kernel/ndbd
- exec_mgmtsrvr=$ndbtop/src/mgmsrv/ndb_mgmd
- exec_waiter=$ndbtop/tools/ndb_waiter
- exec_test=$ndbtop/tools/ndb_test_platform
- exec_test_ndberror=$ndbtop/src/ndbapi/ndberror_check
- exec_mgmtclient=$ndbtop/src/mgmclient/ndb_mgm
-else
- BINARY_DIST=1
- if test -x "$BASEDIR/libexec/ndbd"
- then
- exec_ndb=$BASEDIR/libexec/ndbd
- exec_mgmtsrvr=$BASEDIR/libexec/ndb_mgmd
- else
- exec_ndb=$BASEDIR/bin/ndbd
- exec_mgmtsrvr=$BASEDIR/bin/ndb_mgmd
- fi
- exec_waiter=$BASEDIR/bin/ndb_waiter
- exec_test=$BASEDIR/bin/ndb_test_platform
- exec_test_ndberror=
- exec_mgmtclient=$BASEDIR/bin/ndb_mgm
-fi
-
-if $exec_test ; then :; else
- echo "ndb not correctly compiled to support this platform"
- exit 1
-fi
-
-if [ $exec_test_ndberror ] ; then
-if $exec_test_ndberror ; then :; else
- echo "please fix in ndberror.c"
- exit 1
-fi
-fi
-
-pidfile=ndbcluster.pid
-cfgfile=Ndb.cfg
-test_ndb=
-stop_ndb=
-initial_ndb=
-status_ndb=
-ndb_diskless=0
-ndbd_nodes=2
-relative_config_data_dir=
-opt_core=
-
-ndb_no_ord=512
-ndb_no_attr=2048
-ndb_con_op=105000
-ndb_dmem=80M
-ndb_imem=24M
-ndb_pbmem=32M
-
-VERBOSE=100
-NDB_MGM_EXTRA_OPTS=
-NDB_MGMD_EXTRA_OPTS=
-NDBD_EXTRA_OPTS=
-CHARSETSDIR=
-
-while test $# -gt 0; do
- case "$1" in
- --test)
- test_ndb=1
- ;;
- --stop)
- stop_ndb=1
- ;;
- --initial)
- flags_ndb="$flags_ndb --initial"
- initial_ndb=1
- ;;
- --debug*)
- flags_ndb="$flags_ndb $1"
- ;;
- --ndbd-nodes=*)
- ndbd_nodes=`echo "$1" | sed -e "s;--ndbd-nodes=;;"`
- ;;
- --status)
- status_ndb=1
- ;;
- --small)
- ndb_no_ord=32
- ndb_con_op=5000
- ndb_dmem=20M
- ndb_imem=1M
- ndb_pbmem=4M
- ;;
- --diskless)
- ndb_diskless=1
- ;;
- --data-dir=*)
- fsdir=`echo "$1" | sed -e "s;--data-dir=;;"`
- ;;
- --relative-config-data-dir)
- relative_config_data_dir=1
- ;;
- --port=*)
- port=`echo "$1" | sed -e "s;--port=;;"`
- ;;
- --port-base=*)
- $ECHO "--port-base option depricated. Ignored."
- ;;
- --ndb_mgm-extra-opts=*)
- NDB_MGM_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgm-extra-opts=;;"`
- ;;
- --ndb_mgmd-extra-opts=*)
- NDB_MGMD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndb_mgmd-extra-opts=;;"`
- ;;
- --ndbd-extra-opts=*)
- NDBD_EXTRA_OPTS=`echo "$1" | sed -e "s;--ndbd-extra-opts=;;"`
- ;;
- --character-sets-dir=*)
- CHARSETSDIR=`echo "$1" | sed -e "s;--character-sets-dir=;;"`
- ;;
- --core)
- opt_core="--core"
- ;;
- --verbose=*)
- VERBOSE=`echo "$1" | sed -e "s;--verbose=;;"`
- ;;
- -- ) shift; break ;;
- --* ) $ECHO "Unrecognized option: $1"; exit 1 ;;
- * ) break ;;
- esac
- shift
-done
-
-fs_ndb="$fsdir/ndbcluster-$port"
-config_ini=ndb/ndb_config_${ndbd_nodes}_node.ini
-
-NDB_HOME=
-if [ ! -d "$fsdir" ]; then
- echo "$fsdir missing"
- exit 1
-fi
-if [ ! -x "$exec_ndb" ]; then
- echo "$exec_ndb missing"
- exit 1
-fi
-if [ ! -x "$exec_mgmtsrvr" ]; then
- echo "$exec_mgmtsrvr missing"
- exit 1
-fi
-if [ ! -x "$exec_waiter" ]; then
- echo "$exec_waiter missing"
- exit 1
-fi
-if [ ! -f "$config_ini" ]; then
- echo "$config_ini missing, unsupported number of nodes"
- exit 1
-fi
-
-exec_mgmtclient="$exec_mgmtclient --no-defaults $opt_core $NDB_MGM_EXTRA_OPTS"
-exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $opt_core $NDB_MGMD_EXTRA_OPTS"
-exec_ndb="$exec_ndb --no-defaults $opt_core $NDBD_EXTRA_OPTS --character-sets-dir=$CHARSETSDIR"
-exec_waiter="$exec_waiter --no-defaults $opt_core"
-
-ndb_host="localhost"
-ndb_mgmd_port=$port
-NDB_CONNECTSTRING="host=$ndb_host:$ndb_mgmd_port"
-export NDB_CONNECTSTRING
-
-sleep_until_file_created () {
- file=$1
- loop=$2
- org_time=$2
- message=$3
- while (test $loop -gt 0)
- do
- if [ -r $file ]
- then
- return 0
- fi
- sleep 1
- loop=`expr $loop - 1`
- done
- if [ $message ]
- then
- echo $message
- fi
- echo "ERROR: $file was not created in $org_time seconds; Aborting"
- return 1;
-}
-
-start_default_ndbcluster() {
-
-# do some checks
-
-if [ "$initial_ndb" ] ; then
- [ -d "$fs_ndb" ] || mkdir "$fs_ndb"
-fi
-if [ -d "$fs_ndb" ]; then :; else
- echo "$fs_ndb filesystem directory does not exist"
- exit 1
-fi
-
-# Start management server as deamon
-
-# Edit file system path and ports in config file
-if [ $relative_config_data_dir ] ; then
- config_fs_ndb="."
-else
- config_fs_ndb=$fs_ndb
-fi
-if [ $initial_ndb ] ; then
- rm -rf $fs_ndb/ndb_* 2>&1 | cat > /dev/null
- sed \
- -e s,"CHOOSE_MaxNoOfAttributes","$ndb_no_attr",g \
- -e s,"CHOOSE_MaxNoOfOrderedIndexes","$ndb_no_ord",g \
- -e s,"CHOOSE_MaxNoOfConcurrentOperations","$ndb_con_op",g \
- -e s,"CHOOSE_DataMemory","$ndb_dmem",g \
- -e s,"CHOOSE_IndexMemory","$ndb_imem",g \
- -e s,"CHOOSE_Diskless","$ndb_diskless",g \
- -e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
- -e s,"CHOOSE_FILESYSTEM","$config_fs_ndb",g \
- -e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \
- -e s,"CHOOSE_DiskPageBufferMemory","$ndb_pbmem",g \
- < "$config_ini" \
- > "$fs_ndb/config.ini"
-fi
-
-rm -f "$cfgfile" 2>&1 | cat > /dev/null
-rm -f "$fs_ndb/$cfgfile" 2>&1 | cat > /dev/null
-
-if ( cd "$fs_ndb" ; $exec_mgmtsrvr -f config.ini ) ; then :; else
- echo "Unable to start $exec_mgmtsrvr from `pwd`"
- exit 1
-fi
-if sleep_until_file_created $fs_ndb/ndb_`expr $ndbd_nodes + 1`.pid 120
-then :; else
- exit 1
-fi
-cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
-
-# Start database node
-
-id=1
-while [ $id -le $ndbd_nodes ]
-do
- if [ `expr $VERBOSE \> 1` = 1 ] ; then
- echo "Starting ndbd $id($ndbd_nodes)"
- fi
- ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
- if sleep_until_file_created $fs_ndb/ndb_${id}.pid 120
- then :; else
- stop_default_ndbcluster
- exit 1
- fi
- cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
- id=`expr $id + 1`
-done
-
-# test if Ndb Cluster starts properly
-
-if [ `expr $VERBOSE \> 1` = 1 ] ; then
- echo "Waiting for NDB data nodes to start..."
-fi
-if ( $exec_waiter ) | grep "NDBT_ProgramExit: 0 - OK" > /dev/null 2>&1 ; then :; else
- if [ `expr $VERBOSE \> 0` = 1 ] ; then
- echo "Ndbcluster startup failed"
- fi
- stop_default_ndbcluster
- exit 1
-fi
-if [ `expr $VERBOSE \> 1` = 1 ] ; then
- echo "Ok"
-fi
-
-cat `find "$fs_ndb" -name 'ndb_*.pid'` > $fs_ndb/$pidfile
-
-if [ `expr $VERBOSE \> 2` = 1 ] ; then
- status_ndbcluster
-fi
-}
-
-status_ndbcluster() {
- # Start management client
- $exec_mgmtclient -e show
-}
-
-stop_default_ndbcluster() {
-
-# Start management client
-
-exec_mgmtclient="$exec_mgmtclient --try-reconnect=1"
-
-$exec_mgmtclient -e shutdown 2>&1 | cat > /dev/null
-
-if [ -f "$fs_ndb/$pidfile" ] ; then
- kill_pids=`cat "$fs_ndb/$pidfile"`
- attempt=0
- while [ $attempt -lt 10 ] ; do
- new_kill_pid=""
- kill_pids2=""
- for p in $kill_pids ; do
- kill -0 $p 2> /dev/null
- if [ $? -eq 0 ] ; then
- new_kill_pid="$p $new_kill_pid"
- kill_pids2="-$p $kill_pids2"
- fi
- done
- kill_pids=$new_kill_pid
- if [ -z "$kill_pids" ] ; then
- break
- fi
- sleep 1
- attempt=`expr $attempt + 1`
- done
- if [ "$kill_pids2" != "" ] ; then
- echo "Failed to shutdown ndbcluster, executing kill "$kill_pids2
- kill -9 -- $kill_pids2 2> /dev/null
- /bin/kill -9 -- $kill_pids2 2> /dev/null
- /usr/bin/kill -9 -- $kill_pids2 2> /dev/null
- kill -9 $kill_pids2 2> /dev/null
- /bin/kill -9 $kill_pids2 2> /dev/null
- /usr/bin/kill -9 $kill_pids2 2> /dev/null
- fi
- rm "$fs_ndb/$pidfile"
-fi
-}
-
-initialize_ndb_test ()
-{
- fs_result=$fs_ndb/r
- rm -rf $fs_result
- mkdir $fs_result
- echo ------------------
- echo starting ndb tests
- echo ------------------
-}
-
-do_ndb_test ()
-{
- test_name=$1
-
- clusterlog=$fs_ndb/ndb_3_cluster.log
-
- test_log_result=$fs_result/${test_name}_log.result
- test_log_reject=$fs_result/${test_name}_log.reject
- test_result=$fs_result/${test_name}.result
- test_reject=$fs_result/${test_name}.reject
-
- clean_log='s/.*\[MgmSrvr\]//'
-
- cat $clusterlog ndb/${test_name}_log.result | sed -e $clean_log > $test_log_result
-
- cp ndb/${test_name}.result $test_result
-
- cat ndb/${test_name}.test | $exec_mgmtclient > $test_reject
- cat $clusterlog | sed -e $clean_log > $test_log_reject
-
- t="pass"
- diff -C 5 $test_result $test_reject || t="fail"
- printf "ndb_mgm output %20s [%s]\n" $test_name $t
- t="pass"
- diff -C 5 $test_log_result $test_log_reject || t="fail"
- printf "clusterlog output %20s [%s]\n" $test_name $t
-}
-
-if [ $status_ndb ] ; then
- status_ndbcluster
- exit 0
-fi
-
-if [ $stop_ndb ] ; then
- stop_default_ndbcluster
-else
- start_default_ndbcluster
-fi
-
-if [ $test_ndb ] ; then
- initialize_ndb_test
- all_tests=`ls ndb/*.test | sed "s#ndb/##" | sed "s#.test##"`
- for a in $all_tests ; do
- do_ndb_test $a
- done
- echo ------------------
- echo shutting down cluster
- stop_default_ndbcluster
-fi
-
-exit 0
diff -Nrup a/mysql-test/ndb/restart.result b/mysql-test/ndb/restart.result
--- a/mysql-test/ndb/restart.result 2004-12-08 23:49:03 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,16 +0,0 @@
--- NDB Cluster -- Management Client --
-Connected to Management Server at: localhost:1186
-ALL disabled
-Cluster logging is enabled.
-ALERT enabled
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Node 1 is being restarted.
-
-Executing CLUSTERLOG on node 1 OK!
-Executing CLUSTERLOG on node 2 OK!
-
-Node 1 is being restarted.
-
-ALL enabled
diff -Nrup a/mysql-test/ndb/restart.test b/mysql-test/ndb/restart.test
--- a/mysql-test/ndb/restart.test 2005-01-09 23:02:01 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,12 +0,0 @@
-clusterlog off all
-clusterlog on
-clusterlog on alert
-all clusterlog connection=0
-sleep 1
-1 restart
-sleep 5
-all clusterlog connection=8
-sleep 1
-1 restart
-sleep 10
-clusterlog on all
diff -Nrup a/mysql-test/ndb/restart_log.result b/mysql-test/ndb/restart_log.result
--- a/mysql-test/ndb/restart_log.result 2004-12-08 23:49:04 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,20 +0,0 @@
- ALERT -- Node 2: Network partitioning - arbitration required
- ALERT -- Node 2: Arbitration won - positive reply from node 3
- ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
- ALERT -- Node 2: Node failure of 1 DBLQH completed
- ALERT -- Node 2: Node failure of 1 DBDICT completed
- ALERT -- Node 2: Node failure of 1 DBDIH completed
- ALERT -- Node 2: Node failure of 1 DBTC completed
- ALERT -- Node 2: Node 2 completed failure of Node 1
- ALERT -- Node 2: All nodes completed failure of Node 1
- ALERT -- Node 3: Node 1 Disconnected
- ALERT -- Node 2: Node 1 Disconnected
- ALERT -- Node 2: Network partitioning - arbitration required
- ALERT -- Node 2: Arbitration won - positive reply from node 3
- ALERT -- Node 2: Node 1 has failed. The Node state at failure was 0
- ALERT -- Node 2: Node failure of 1 DBLQH completed
- ALERT -- Node 2: Node failure of 1 DBDICT completed
- ALERT -- Node 2: Node failure of 1 DBDIH completed
- ALERT -- Node 2: Node failure of 1 DBTC completed
- ALERT -- Node 2: Node 2 completed failure of Node 1
- ALERT -- Node 2: All nodes completed failure of Node 1
diff -Nrup a/mysql-test/resolve-stack b/mysql-test/resolve-stack
--- a/mysql-test/resolve-stack 2004-03-20 11:29:20 +01:00
+++ /dev/null Wed Dec 31 16:00:00 196900
@@ -1,8 +0,0 @@
-#! /bin/sh
-# A shortcut for resolving stacks when debugging when
-# we cannot duplicate the crash in a debugger and have to
-# resort to using stack traces
-
-nm --numeric-sort ../sql/mysqld > var/tmp/mysqld.sym
-echo "Please type or paste the numeric stack trace,Ctrl-C to quit:"
-../extra/resolve_stack_dump -s var/tmp/mysqld.sym
| Thread |
|---|
| • bk commit into 5.1 tree (msvensson:1.2551) | msvensson | 6 Dec |