Commit 1a603185 authored by unknown's avatar unknown

fixed up mysql-test - will not push this yet, as more clean up/testing is to follow


BitKeeper/deleted/.del-README~b8e00a1b57b91f69:
  ***MISSING WEAVE***
BitKeeper/deleted/.del-README~2bddc2706d0834d0:
  ***MISSING WEAVE***
mysql-test/r/alt000001.result:
  mvdir
mysql-test/r/ins000001.result:
  mvdir
mysql-test/r/rpl000001.a.result:
  mvdir
mysql-test/r/rpl000001.b.result:
  mvdir
mysql-test/r/rpl000002.result:
  mvdir
mysql-test/r/rpl000003.result:
  mvdir
mysql-test/r/rpl000004.a.result:
  mvdir
mysql-test/r/rpl000004.b.result:
  mvdir
mysql-test/r/rpl000005.result:
  mvdir
mysql-test/r/rpl000006.result:
  mvdir
mysql-test/r/rpl000007.result:
  mvdir
mysql-test/r/rpl000008.result:
  mvdir
mysql-test/r/rpl000009.result:
  mvdir
mysql-test/r/rpl000010.result:
  mvdir
mysql-test/r/rpl000011.result:
  mvdir
mysql-test/r/rpl000012.result:
  mvdir
mysql-test/r/rpl000012.status.result:
  mvdir
mysql-test/r/rpl000013.result:
  mvdir
mysql-test/r/rpl000013.status.result:
  mvdir
mysql-test/r/sel000001.result:
  mvdir
mysql-test/r/sel000002.result:
  mvdir
mysql-test/r/sel000003.result:
  mvdir
mysql-test/r/sel000004.result:
  mvdir
mysql-test/r/sel000005.result:
  mvdir
mysql-test/r/sel000006.result:
  mvdir
mysql-test/r/sel000007.result:
  mvdir
mysql-test/r/sel000008.result:
  mvdir
mysql-test/r/sel000009.result:
  mvdir
mysql-test/r/sel000010.result:
  mvdir
mysql-test/r/sel000011.result:
  mvdir
mysql-test/r/sel000012.result:
  mvdir
mysql-test/r/sel000013.result:
  mvdir
mysql-test/r/sel000014.result:
  mvdir
mysql-test/r/sel000015.result:
  mvdir
mysql-test/r/sel000016.result:
  mvdir
mysql-test/r/sel000017.result:
  mvdir
mysql-test/r/sel000018.result:
  mvdir
mysql-test/r/sel000019.result:
  mvdir
mysql-test/r/sel000020.result:
  mvdir
mysql-test/r/sel000021.result:
  mvdir
mysql-test/r/sel000022.result:
  mvdir
mysql-test/r/sel000023.result:
  mvdir
mysql-test/r/sel000024.result:
  mvdir
mysql-test/r/sel000025.result:
  mvdir
mysql-test/r/sel000026.result:
  mvdir
mysql-test/r/sel000027.result:
  mvdir
mysql-test/r/sel000028.result:
  mvdir
mysql-test/r/sel000029.result:
  mvdir
mysql-test/r/sel000030.result:
  mvdir
mysql-test/r/sel000100.result:
  mvdir
mysql-test/r/shw000001.result:
  mvdir
mysql-test/t/README:
  mvdir
mysql-test/t/err000001.test:
  mvdir
mysql-test/t/rpl000007-slave.opt:
  mvdir
mysql-test/t/rpl000008-slave.opt:
  mvdir
mysql-test/t/rpl000009-slave.opt:
  mvdir
mysql-test/t/rpl000010-slave.opt:
  mvdir
mysql-test/t/rpl000013-slave.opt:
  mvdir
BitKeeper/deleted/.del-start-mysqld~9c8f21a7ab97793a:
  ***MISSING WEAVE***
BitKeeper/deleted/.del-stop-mysqld~89a1194045f05d1c:
  ***MISSING WEAVE***
BitKeeper/deleted/.del-translate-tests~3869c1fdf0a5ea1a:
  ***MISSING WEAVE***
BitKeeper/deleted/.del-README~108667adaeabe3f5:
  ***MISSING WEAVE***
BitKeeper/deleted/.del-README~c5aaceda4c2b1a8:
  ***MISSING WEAVE***
BitKeeper/deleted/.del-select-key.master~e6b83af25df0ce5:
  ***MISSING WEAVE***
mysql-test/std_data/words.dat:
  Rename: mysql-test/std_data/words -> mysql-test/std_data/words.dat
BitKeeper/deleted/.del-simple-select.master~6f3eb98812926caf:
  ***MISSING WEAVE***
Makefile.am:
  add mysql-test to distribution
configure.in:
  added mysql-test
libmysql/Makefile.am:
  include hash.h
libmysql/Makefile.shared:
  add hash to libmysqlclient
mysql-test/Makefile.am:
  mysql-test is now in source dist also
mysql-test/chew_on_this/select.res:
  ***MISSING WEAVE***
mysql-test/install_test_db:
  renamed file, moved to different directory, and fixed up to work on binary dist
mysql-test/mysql-test-run:
  clean-up of test suite, make it work on binary dist
mysql-test/t/alt000001.test:
  moved directory
mysql-test/t/ins000001.test:
  moved directory
mysql-test/t/rpl000001.test:
  moved dir
mysql-test/t/rpl000002.test:
  moved dir
mysql-test/t/rpl000003.test:
  moved dir
mysql-test/t/rpl000004.test:
  moved dir
mysql-test/t/rpl000005.test:
  moved dir
mysql-test/t/rpl000006.test:
  moved dir
mysql-test/t/rpl000007.test:
  moved dir
mysql-test/t/rpl000008.test:
  moved dir
mysql-test/t/rpl000009.test:
  moved dir
mysql-test/t/rpl000010.test:
  moved dir
mysql-test/t/rpl000011.test:
  moved dir
mysql-test/t/rpl000012.test:
  moved dir
mysql-test/t/rpl000013.test:
  moved dir
mysql-test/t/sel000001.test:
  moved dir
mysql-test/t/sel000002.test:
  moved dir
BitKeeper/etc/ignore:
  Added libmysql_r/hash.c scripts/mysql-3.23.29-gamma-pc-linux-gnu-i686.tar.gz to the ignore list
mysql-test/t/sel000003.test:
  moved dir
mysql-test/t/sel000004.test:
  moved dir
mysql-test/t/sel000005.test:
  moved dir
mysql-test/t/sel000100.test:
  moved dir
mysql-test/t/shw000001.test:
  moved dir
scripts/make_binary_distribution.sh:
  fixes to include mysql-test
  added -debug option to exit after building temp dir before tar.gz 
  removed a bunch of SCCS files
parent e5c58586
...@@ -401,3 +401,5 @@ mysql-test/var/lib/test/test2.MYI ...@@ -401,3 +401,5 @@ mysql-test/var/lib/test/test2.MYI
mysql-test/var/run/mysqld.pid mysql-test/var/run/mysqld.pid
mysql-test/var/tmp/mysql.sock mysql-test/var/tmp/mysql.sock
mysql-test/var/lib/mysql-bin.008 mysql-test/var/lib/mysql-bin.008
libmysql_r/hash.c
scripts/mysql-3.23.29-gamma-pc-linux-gnu-i686.tar.gz
...@@ -3,3 +3,5 @@ mwagner@evoq.home.mwagner.org|mysql-test/var/log/README|20001009213643|16203|df5 ...@@ -3,3 +3,5 @@ mwagner@evoq.home.mwagner.org|mysql-test/var/log/README|20001009213643|16203|df5
mwagner@evoq.home.mwagner.org|mysql-test/var/run/README|20001009213643|17062|acb305e4c2ed5990 mwagner@evoq.home.mwagner.org|mysql-test/var/run/README|20001009213643|17062|acb305e4c2ed5990
mwagner@evoq.home.mwagner.org|mysql-test/var/tmp/README|20001009213643|17904|b32d866bfd50e72e mwagner@evoq.home.mwagner.org|mysql-test/var/tmp/README|20001009213643|17904|b32d866bfd50e72e
mwagner@evoq.home.mwagner.org|mysql-test/share/README|20001009213643|10987|6cd25db633f30de5 mwagner@evoq.home.mwagner.org|mysql-test/share/README|20001009213643|10987|6cd25db633f30de5
mwagner@evoq.home.mwagner.org|mysql-test/r/3.23/README|20001009213643|10190|f9fd36f3c3711305
sasha@mysql.sashanet.com|mysql-test/t/include/master-slave.inc|20001118030458|01636|556fd038c3a3d54
...@@ -24,7 +24,7 @@ EXTRA_DIST = INSTALL-SOURCE README \ ...@@ -24,7 +24,7 @@ EXTRA_DIST = INSTALL-SOURCE README \
SUBDIRS = include @docs_dirs@ @readline_dir@ \ SUBDIRS = include @docs_dirs@ @readline_dir@ \
@thread_dirs@ @sql_client_dirs@ \ @thread_dirs@ @sql_client_dirs@ \
@sql_server_dirs@ scripts tests man \ @sql_server_dirs@ scripts tests man \
@bench_dirs@ support-files @bench_dirs@ support-files mysql-test
# Relink after clean # Relink after clean
CLEANFILES = linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources linked_include_sources CLEANFILES = linked_client_sources linked_server_sources linked_libmysql_sources linked_libmysql_r_sources linked_include_sources
......
...@@ -1887,6 +1887,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile \ ...@@ -1887,6 +1887,7 @@ AC_OUTPUT(Makefile extra/Makefile mysys/Makefile isam/Makefile \
merge/Makefile dbug/Makefile scripts/Makefile \ merge/Makefile dbug/Makefile scripts/Makefile \
include/Makefile sql-bench/Makefile \ include/Makefile sql-bench/Makefile \
tests/Makefile Docs/Makefile support-files/Makefile \ tests/Makefile Docs/Makefile support-files/Makefile \
mysql-test/Makefile \
include/mysql_version.h include/mysql_version.h
, , [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h]) , , [test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h])
......
...@@ -65,7 +65,7 @@ nh = global.h config-win32.h dbug.h errmsg.h global.h \ ...@@ -65,7 +65,7 @@ nh = global.h config-win32.h dbug.h errmsg.h global.h \
m_ctype.h m_string.h \ m_ctype.h m_string.h \
my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \ my_alarm.h my_config.h my_dir.h my_list.h my_net.h my_sys.h \
mysql.h mysql_com.h mysql_version.h mysqld_error.h mysys_err.h \ mysql.h mysql_com.h mysql_version.h mysqld_error.h mysys_err.h \
my_pthread.h thr_alarm.h violite.h my_pthread.h thr_alarm.h violite.h hash.h
# Get a list of the needed objects # Get a list of the needed objects
lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects) lobjs = $(mysysobjects1) $(dbugobjects) $(mystringsobjects)
......
...@@ -55,7 +55,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \ ...@@ -55,7 +55,7 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
mf_loadpath.lo my_pthread.lo my_thr_init.lo \ mf_loadpath.lo my_pthread.lo my_thr_init.lo \
thr_mutex.lo mulalloc.lo string.lo default.lo \ thr_mutex.lo mulalloc.lo string.lo default.lo \
my_compress.lo array.lo my_once.lo list.lo my_net.lo \ my_compress.lo array.lo my_once.lo list.lo my_net.lo \
charset.lo charset.lo hash.lo
# Not needed in the minimum library # Not needed in the minimum library
mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo mysysobjects2 = getopt.lo getopt1.lo getvar.lo my_lib.lo
mysysobjects = $(mysysobjects1) $(mysysobjects2) mysysobjects = $(mysysobjects1) $(mysysobjects2)
......
EXTRA_DIST=README README.gcov mysql-test-run t/*.test t/*.opt r/*.result \
mybin/mysql-test_install_db mybin/start-mysqld mybin/stop-mysqld \
mybin/translate-tests
connect (master,localhost,root,,test,0,var/tmp/mysql.sock);
connect (master1,localhost,root,,test,0,var/tmp/mysql.sock);
connect (slave,localhost,root,,test,0,var/tmp/mysql-slave.sock);
connect (slave1,localhost,root,,test,0,var/tmp/mysql-slave.sock);
connection slave;
!slave stop;
connection master;
reset master;
connection slave;
reset slave;
!slave start;
...@@ -5,26 +5,36 @@ ...@@ -5,26 +5,36 @@
# This scripts creates the privilege tables db, host, user, tables_priv, # This scripts creates the privilege tables db, host, user, tables_priv,
# columns_priv in the mysql database, as well as the func table. # columns_priv in the mysql database, as well as the func table.
if [ x$1 = x"-bin" ]; then
shift 1
execdir=../bin
bindir=../bin
BINARY_DIST=1
fix_bin=mysql-test
else
execdir=../sql
bindir=../client
fix_bin=.
fi
if [ x$1 = x"-slave" ] if [ x$1 = x"-slave" ]
then then
shift $# shift 1
ldata=var/slave-data data=var/slave-data
ldata=$fix_bin/var/slave-data
logdir=var/log logdir=var/log
mdata=$ldata/mysql
execdir=../sql
bindir=../client
else else
ldata=var/lib data=var/lib
ldata=$fix_bin/var/lib
logdir=var/log logdir=var/log
mdata=$ldata/mysql
execdir=../sql
bindir=../client
fi fi
mdata=$data/mysql
if test ! -x $execdir/mysqld if test ! -x $execdir/mysqld
then then
echo "I can't find no stinking mysqld!" echo "mysqld is missing - looked in $execdir"
exit 1 exit 1
fi fi
...@@ -36,25 +46,18 @@ resolved=127.0.0.1 ...@@ -36,25 +46,18 @@ resolved=127.0.0.1
# Create database directories mysql & test # Create database directories mysql & test
if test ! -d $ldata; then (mkdir -p $ldata || exit 1) && \ if [ -d $data ] ; then rm -rf $data ; fi
(chmod 700 $ldata || exit 1) ; fi mkdir -p $data $data/mysql $data/test
if test ! -d $ldata/mysql;
then
mkdir -p $ldata/mysql || exit 1;
chmod 700 $ldata/mysql || exit 1 ; fi
if test ! -d $ldata/test;
then
mkdir -p $ldata/test || exit 1;
chmod 700 $ldata/test || exit 1 ;
fi
if test -w / -a ! -z "$user"; then
chown $user $ldata $ldata/mysql $ldata/test || exit 1;
fi
#for error messages #for error messages
if [ x$BINARY_DIST = x1 ] ; then
basedir=..
else
basedir=.
rm -rf share rm -rf share
mkdir share mkdir share
ln -sf ../../sql/share share/mysql ln -sf ../../sql/share share/mysql
fi
#create the directory for logs #create the directory for logs
mkdir -p $logdir mkdir -p $logdir
...@@ -192,7 +195,7 @@ then ...@@ -192,7 +195,7 @@ then
fi fi
if $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \ if $execdir/mysqld --no-defaults --bootstrap --skip-grant-tables \
--basedir=. --datadir=$ldata << END_OF_DATA --basedir=$basedir --datadir=$ldata << END_OF_DATA
use mysql; use mysql;
$c_d $c_d
$i_d $i_d
......
#! /bin/sh #! /bin/sh
# mysql-test-run - originally written by Matt Wagner <matt@mysql.com>
# modified by Sasha Pachev <sasha@mysql.com>
#++ #++
# Access Definitions # Access Definitions
...@@ -7,17 +9,42 @@ DB=test ...@@ -7,17 +9,42 @@ DB=test
DBUSER=test DBUSER=test
DBPASSWD= DBPASSWD=
# Are we on source or binary distribution?
if [ $0 = scripts/mysql-test-run ] ;
then
BINARY_DIST=1
cd mysql-test
else
if [ -d mysql-test ] ; then
cd mysql-test
fi
if [ -f ./mysql-test-run ] && [ -d ../sql ] ; then
SOURCE_DIST=1
else
echo "If you are using binary distirubution, run me from install root as \
scripts/mysql-test-run. On source distribution run me from source root as \
mysql-test/mysql-test-run or from mysql-test as ./mysql-test-run"
exit 1
fi
fi
#++ #++
# Misc. Definitions # Misc. Definitions
#-- #--
#BASEDIR is always one above mysql-test directory
CWD=`pwd` CWD=`pwd`
cd .. cd ..
BASEDIR=`pwd` BASEDIR=`pwd`
cd $CWD cd $CWD
MYBIN="$CWD/mybin" MYSQL_TEST_DIR=$BASEDIR/mysql-test
TESTVER=3.23
TESTDIR="$CWD/t/$TESTVER" TESTDIR="$MYSQL_TEST_DIR/t/"
TESTSUFFIX=test TESTSUFFIX=test
TOT_PASS=0 TOT_PASS=0
TOT_FAIL=0 TOT_FAIL=0
...@@ -25,8 +52,8 @@ TOT_TEST=0 ...@@ -25,8 +52,8 @@ TOT_TEST=0
USERT=0 USERT=0
SYST=0 SYST=0
REALT=0 REALT=0
MY_TMP_DIR=$CWD/var/tmp MY_TMP_DIR=$MYSQL_TEST_DIR/var/tmp
TIMEFILE="$CWD/var/tmp/mysqltest-time" TIMEFILE="$MYSQL_TEST_DIR/var/tmp/mysqltest-time"
DASHBLANK="---- ---- -------" DASHBLANK="---- ---- -------"
MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \ MYSQLD_SRC_DIRS="strings mysys include extra regex isam merge myisam \
myisammrg heap sql" myisammrg heap sql"
...@@ -53,18 +80,25 @@ done ...@@ -53,18 +80,25 @@ done
#-- #--
MYRUN_DIR=var/run MYRUN_DIR=var/run
MASTER_MYPORT=9306 MASTER_MYPORT=9306
MASTER_MYDDIR="$CWD/var/lib" MASTER_MYDDIR="$MYSQL_TEST_DIR/var/lib"
MASTER_MYSOCK="$CWD/var/tmp/mysql.sock" MASTER_MYSOCK="$MYSQL_TEST_DIR/var/tmp/mysql.sock"
MASTER_MYPID="$CWD/var/run/mysqld.pid" MASTER_MYPID="$MYSQL_TEST_DIR/var/run/mysqld.pid"
MASTER_MYLOG="$CWD/var/log/mysqld.log" MASTER_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld.log"
MASTER_MYERR="$CWD/var/log/mysqld.err" MASTER_MYERR="$MYSQL_TEST_DIR/var/log/mysqld.err"
SLAVE_MYPORT=9307 SLAVE_MYPORT=9307
SLAVE_MYDDIR="$CWD/var/slave-data" SLAVE_MYDDIR="$MYSQL_TEST_DIR/var/slave-data"
SLAVE_MYSOCK="$CWD/var/tmp/mysql-slave.sock" SLAVE_MYSOCK="$MYSQL_TEST_DIR/var/tmp/mysql-slave.sock"
SLAVE_MYPID="$CWD/var/run/mysqld-slave.pid" SLAVE_MYPID="$MYSQL_TEST_DIR/var/run/mysqld-slave.pid"
SLAVE_MYLOG="$CWD/var/log/mysqld-slave.log" SLAVE_MYLOG="$MYSQL_TEST_DIR/var/log/mysqld-slave.log"
SLAVE_MYERR="$CWD/var/log/mysqld-slave.err" SLAVE_MYERR="$MYSQL_TEST_DIR/var/log/mysqld-slave.err"
if [ x$SOURCE_DIST = x1 ] ; then
MY_BASEDIR=$MYSQL_TEST_DIR
else
MY_BASEDIR=$BASEDIR
fi
#++ #++
# Program Definitions # Program Definitions
...@@ -81,22 +115,50 @@ RM=/bin/rm ...@@ -81,22 +115,50 @@ RM=/bin/rm
TIME=/usr/bin/time TIME=/usr/bin/time
TR=/usr/bin/tr TR=/usr/bin/tr
XARGS=`which xargs` XARGS=`which xargs`
MYSQLD="$BASEDIR/sql/mysqld"
MYSQL_TEST="$BASEDIR/client/mysqltest" # on source dist, we pick up freshly build executables
MYSQLADMIN="$BASEDIR/client/mysqladmin" # on binary, use what is installed
if [ x$SOURCE_DIST = x1 ] ; then
MYSQLD="$BASEDIR/sql/mysqld"
MYSQL_TEST="$BASEDIR/client/mysqltest"
MYSQLADMIN="$BASEDIR/client/mysqladmin"
INSTALL_DB="./install_test_db"
else
MYSQLD="$BASEDIR/bin/mysqld"
MYSQL_TEST="$BASEDIR/bin/mysqltest"
MYSQLADMIN="$BASEDIR/bin/mysqladmin"
INSTALL_DB="../scripts/install_test_db -bin"
fi
MYSQL_TEST="$MYSQL_TEST --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent" MYSQL_TEST="$MYSQL_TEST --socket=$MASTER_MYSOCK --database=$DB --user=$DBUSER --password=$DBPASSWD --silent"
INSTALL_DB="$MYBIN/mysql-test_install_db"
GDB_MASTER_INIT=/tmp/gdbinit.master GDB_MASTER_INIT=/tmp/gdbinit.master
GDB_SLAVE_INIT=/tmp/gdbinit.slave GDB_SLAVE_INIT=/tmp/gdbinit.slave
if [ "$1" = "-force" ] ; then
FORCE=1
shift 1
fi
if [ "$1" = "-gcov" ]; if [ "$1" = "-gcov" ];
then then
if [ x$BINARY_DIST = x1 ] ; then
echo "Cannot do coverage test without the source - please us source dist"
exit 1
fi
DO_GCOV=1 DO_GCOV=1
shift 1 shift 1
fi fi
if [ "$1" = "-gdb" ]; if [ "$1" = "-gdb" ];
then then
# if the user really wanted to run binary dist in a debugger, he can
# but we should warn him
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 DO_GDB=1
shift 1 shift 1
fi fi
...@@ -147,7 +209,7 @@ echo_pass () { ...@@ -147,7 +209,7 @@ echo_pass () {
prompt_user () prompt_user ()
{ {
echo $1 echo $1
read read unused
} }
echo_fail () { echo_fail () {
...@@ -224,7 +286,7 @@ gcov_prepare () { ...@@ -224,7 +286,7 @@ gcov_prepare () {
for f in *.h *.cc *.c; do for f in *.h *.cc *.c; do
cp $f $GCOV_SLAVE_SRC/$d cp $f $GCOV_SLAVE_SRC/$d
done done
cd $CWD cd $MYSQL_TEST_DIR
done done
} }
...@@ -239,12 +301,12 @@ gcov_collect () { ...@@ -239,12 +301,12 @@ gcov_collect () {
for f in *.h *.cc *.c; do for f in *.h *.cc *.c; do
$GCOV $f 2>>$GCOV_MASTER_ERR >>$GCOV_MASTER_MSG $GCOV $f 2>>$GCOV_MASTER_ERR >>$GCOV_MASTER_MSG
done done
cd $CWD cd $MYSQL_TEST_DIR
cd $GCOV_SLAVE_SRC/$d cd $GCOV_SLAVE_SRC/$d
for f in *.h *.cc *.c; do for f in *.h *.cc *.c; do
$GCOV $f 2>>$GCOV_SLAVE_ERR >>$GCOV_SLAVE_MSG $GCOV $f 2>>$GCOV_SLAVE_ERR >>$GCOV_SLAVE_MSG
done done
cd $CWD cd $MYSQL_TEST_DIR
done done
$ECHO "gcov master info in $GCOV_MASTER_MSG, errors in $GCOV_MASTER_ERR" $ECHO "gcov master info in $GCOV_MASTER_MSG, errors in $GCOV_MASTER_ERR"
...@@ -257,7 +319,7 @@ start_master() ...@@ -257,7 +319,7 @@ start_master()
#start master #start master
master_args="--no-defaults --log-bin \ master_args="--no-defaults --log-bin \
--server-id=1 \ --server-id=1 \
--basedir=$CWD \ --basedir=$MY_BASEDIR \
--port=$MASTER_MYPORT \ --port=$MASTER_MYPORT \
--core-file \ --core-file \
--datadir=$MASTER_MYDDIR \ --datadir=$MASTER_MYDDIR \
...@@ -286,7 +348,7 @@ start_slave() ...@@ -286,7 +348,7 @@ start_slave()
--master-host=127.0.0.1 \ --master-host=127.0.0.1 \
--master-port=$MASTER_MYPORT \ --master-port=$MASTER_MYPORT \
--core-file \ --core-file \
--basedir=$CWD \ --basedir=$MY_BASEDIR \
--datadir=$SLAVE_MYDDIR \ --datadir=$SLAVE_MYDDIR \
--pid-file=$SLAVE_MYPID \ --pid-file=$SLAVE_MYPID \
--port=$SLAVE_MYPORT \ --port=$SLAVE_MYPORT \
...@@ -307,7 +369,7 @@ start_slave() ...@@ -307,7 +369,7 @@ start_slave()
mysql_start () { mysql_start () {
start_master start_master
start_slave start_slave
cd $CWD cd $MYSQL_TEST_DIR
return 1 return 1
} }
...@@ -394,7 +456,7 @@ run_testcase () ...@@ -394,7 +456,7 @@ run_testcase ()
fi fi
fi fi
cd $CWD cd $MYSQL_TEST_DIR
if [ -f $tf ] ; then if [ -f $tf ] ; then
mytime=`$TIME -p $MYSQL_TEST < $tf 2> $TIMEFILE` mytime=`$TIME -p $MYSQL_TEST < $tf 2> $TIMEFILE`
...@@ -425,6 +487,13 @@ run_testcase () ...@@ -425,6 +487,13 @@ run_testcase ()
$CAT $TIMEFILE $CAT $TIMEFILE
$ECHO $ECHO
$ECHO $ECHO
if [ x$FORCE != x1 ] ; then
$SETCOLOR_NORMAL
echo "Aborting, if you want to continue, re-run with -force"
mysql_stop
exit 1
fi
$SETCOLOR_NORMAL && $ECHO -n "Restarting mysqld $DASHBLANK" $SETCOLOR_NORMAL && $ECHO -n "Restarting mysqld $DASHBLANK"
mysql_restart mysql_restart
$SETCOLOR_SUCCESS && echo_ok $SETCOLOR_SUCCESS && echo_ok
......
...@@ -3,4 +3,4 @@ drop table if exists x; ...@@ -3,4 +3,4 @@ drop table if exists x;
create table x (n int); create table x (n int);
insert into x values(9),(3),(12),(10); insert into x values(9),(3),(12),(10);
alter table x order by n; alter table x order by n;
@r/3.23/alt000001.result select * from x; @r/alt000001.result select * from x;
...@@ -8,4 +8,4 @@ insert into emails values ('sasha@mysql.com'),('monty@mysql.com'), ...@@ -8,4 +8,4 @@ insert into emails values ('sasha@mysql.com'),('monty@mysql.com'),
create table domain(id int not null auto_increment primary key, create table domain(id int not null auto_increment primary key,
domain varchar(50), unique(domain)); domain varchar(50), unique(domain));
insert into domain (domain) select distinct substring(email, locate('@', email)+1) from emails; insert into domain (domain) select distinct substring(email, locate('@', email)+1) from emails;
@r/3.23/ins000001.result select * from domain; @r/ins000001.result select * from domain;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
use test; use test;
drop table if exists words; drop table if exists words;
create table words (word char(20) not null); create table words (word char(20) not null);
load data infile '../../std_data/words' into table words; load data infile '../../std_data/words.dat' into table words;
drop table if exists foo; drop table if exists foo;
create table foo(n int); create table foo(n int);
insert into foo values(1),(2); insert into foo values(1),(2);
connection slave; connection slave;
sleep 2; sleep 2;
use test; use test;
@r/3.23/rpl000001.a.result select * from foo; @r/rpl000001.a.result select * from foo;
@r/3.23/rpl000001.b.result select sum(length(word)) from words; @r/rpl000001.b.result select sum(length(word)) from words;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
use test; use test;
drop table if exists x; drop table if exists x;
...@@ -8,4 +8,4 @@ insert into x values (NULL),(NULL),(NULL); ...@@ -8,4 +8,4 @@ insert into x values (NULL),(NULL),(NULL);
connection slave; connection slave;
use test; use test;
sleep 0.5; sleep 0.5;
@r/3.23/rpl000002.result select * from x; @r/rpl000002.result select * from x;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
drop table if exists x; drop table if exists x;
create table x(n int primary key); create table x(n int primary key);
...@@ -6,4 +6,4 @@ create table x(n int primary key); ...@@ -6,4 +6,4 @@ create table x(n int primary key);
insert into x values (3); insert into x values (3);
connection slave; connection slave;
sleep 0.5; sleep 0.5;
@r/3.23/rpl000003.result select * from x; @r/rpl000003.result select * from x;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
use test; use test;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
drop table if exists words; drop table if exists words;
create table words (word char(20) not null, index(word)); create table words (word char(20) not null, index(word));
load data infile '../../std_data/words' into table words; load data infile '../../std_data/words.dat' into table words;
drop table if exists words1; drop table if exists words1;
create table words1 (word char(20) not null); create table words1 (word char(20) not null);
load data infile '../../std_data/words' into table words1; load data infile '../../std_data/words.dat' into table words1;
connection slave; connection slave;
use test; use test;
drop table if exists words; drop table if exists words;
load table words from master; load table words from master;
drop table if exists words1; drop table if exists words1;
load table words1 from master; load table words1 from master;
@r/3.23/rpl000004.a.result check table words; @r/rpl000004.a.result check table words;
@r/3.23/rpl000004.b.result select count(*) from words1; @r/rpl000004.b.result select count(*) from words1;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
drop table if exists test; drop table if exists test;
CREATE TABLE test (name varchar(64), age smallint(3)); CREATE TABLE test (name varchar(64), age smallint(3));
...@@ -6,7 +6,7 @@ INSERT INTO test SET name='Andy', age=31; ...@@ -6,7 +6,7 @@ INSERT INTO test SET name='Andy', age=31;
INSERT test SET name='Jacob', age=2; INSERT test SET name='Jacob', age=2;
INSERT into test SET name='Caleb', age=1; INSERT into test SET name='Caleb', age=1;
ALTER TABLE test ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY; ALTER TABLE test ADD id int(8) ZEROFILL AUTO_INCREMENT PRIMARY KEY;
@r/3.23/rpl000005.result select * from test; @r/rpl000005.result select * from test;
connection slave; connection slave;
sleep 0.5; sleep 0.5;
@r/3.23/rpl000005.result select * from test; @r/rpl000005.result select * from test;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
set SQL_LOG_BIN=0; set SQL_LOG_BIN=0;
set timestamp=200006; set timestamp=200006;
drop table if exists foo; drop table if exists foo;
create table foo(t timestamp not null,a char(1)); create table foo(t timestamp not null,a char(1));
insert into foo ( a) values ('F'); insert into foo ( a) values ('F');
@r/3.23/rpl000006.result select unix_timestamp(t) from foo; @r/rpl000006.result select unix_timestamp(t) from foo;
connection slave; connection slave;
drop table if exists foo; drop table if exists foo;
load table foo from master; load table foo from master;
@r/3.23/rpl000006.result select unix_timestamp(t) from foo; @r/rpl000006.result select unix_timestamp(t) from foo;
#this one assumes we are ignoring updates on table foo, but doing #this one assumes we are ignoring updates on table foo, but doing
#the ones on bar #the ones on bar
source t/include/master-slave.inc; source include/master-slave.inc;
connection slave; connection slave;
use test; use test;
drop table if exists foo; drop table if exists foo;
...@@ -16,4 +16,4 @@ create table bar (m int); ...@@ -16,4 +16,4 @@ create table bar (m int);
insert into bar values(15); insert into bar values(15);
connection slave; connection slave;
sleep 1; sleep 1;
@r/3.23/rpl000007.result select foo.n,bar.m from foo,bar; @r/rpl000007.result select foo.n,bar.m from foo,bar;
#this one assumes we are ignoring updates on table foo, but doing #this one assumes we are ignoring updates on table foo, but doing
#the ones on all other tables #the ones on all other tables
source t/include/master-slave.inc; source include/master-slave.inc;
connection slave; connection slave;
use test; use test;
drop table if exists foo; drop table if exists foo;
...@@ -19,4 +19,4 @@ create table choo (k int); ...@@ -19,4 +19,4 @@ create table choo (k int);
insert into choo values(55); insert into choo values(55);
connection slave; connection slave;
sleep 1; sleep 1;
@r/3.23/rpl000008.result select foo.n,bar.m,choo.k from foo,bar,choo; @r/rpl000008.result select foo.n,bar.m,choo.k from foo,bar,choo;
#this one assumes we are ignoring updates on tables in database foo, but doing #this one assumes we are ignoring updates on tables in database foo, but doing
#the ones in database bar #the ones in database bar
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
drop database if exists foo; drop database if exists foo;
create database foo; create database foo;
...@@ -20,4 +20,4 @@ create table bar.bar (m int); ...@@ -20,4 +20,4 @@ create table bar.bar (m int);
insert into bar.bar values(15); insert into bar.bar values(15);
connection slave; connection slave;
sleep 1; sleep 1;
@r/3.23/rpl000009.result select foo.foo.n,bar.bar.m from foo.foo,bar.bar; @r/rpl000009.result select foo.foo.n,bar.bar.m from foo.foo,bar.bar;
#this tests the offset off by 22 mystery bug #this tests the offset off by 22 mystery bug
#must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1 #must run slave with --disconnect-slave-event-count=1 --master-connect-retry=1
source t/include/master-slave.inc; source include/master-slave.inc;
connection slave; connection slave;
drop table if exists foo; drop table if exists foo;
connection master; connection master;
...@@ -10,4 +10,4 @@ insert into foo values(NULL); ...@@ -10,4 +10,4 @@ insert into foo values(NULL);
insert into foo values(2); insert into foo values(2);
connection slave; connection slave;
sleep 5; sleep 5;
@r/3.23/rpl000010.result select n from foo; @r/rpl000010.result select n from foo;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
use test; use test;
drop table if exists foo; drop table if exists foo;
...@@ -14,5 +14,5 @@ insert into foo values(2); ...@@ -14,5 +14,5 @@ insert into foo values(2);
connection slave; connection slave;
#let slave catch up #let slave catch up
sleep 1; sleep 1;
@r/3.23/rpl000011.result select * from foo; @r/rpl000011.result select * from foo;
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
drop table if exists x; drop table if exists x;
create table x(n int); create table x(n int);
...@@ -15,5 +15,5 @@ insert into x values(6); ...@@ -15,5 +15,5 @@ insert into x values(6);
disconnect master1; disconnect master1;
connection slave; connection slave;
sleep 1; sleep 1;
@r/3.23/rpl000012.result select * from x; @r/rpl000012.result select * from x;
@r/3.23/rpl000012.status.result show status like 'Slave_open_temp_tables'; @r/rpl000012.status.result show status like 'Slave_open_temp_tables';
source t/include/master-slave.inc; source include/master-slave.inc;
connection master; connection master;
drop table if exists x; drop table if exists x;
create table x(n int); create table x(n int);
...@@ -21,5 +21,5 @@ while ($1) ...@@ -21,5 +21,5 @@ while ($1)
sleep 0.2; sleep 0.2;
dec $1; dec $1;
} }
@r/3.23/rpl000013.result select * from x; @r/rpl000013.result select * from x;
@r/3.23/rpl000013.status.result show status like 'Slave_open_temp_tables'; @r/rpl000013.status.result show status like 'Slave_open_temp_tables';
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
CREATE TABLE t (s CHAR(20) PRIMARY KEY, id INT); CREATE TABLE t (s CHAR(20) PRIMARY KEY, id INT);
INSERT INTO t VALUES ('cat', 1), ('mouse', 3), ('dog', 2), ('snake', 77); INSERT INTO t VALUES ('cat', 1), ('mouse', 3), ('dog', 2), ('snake', 77);
@r/3.23/sel000001.result SELECT s, id FROM t WHERE s = 'mouse'; @r/sel000001.result SELECT s, id FROM t WHERE s = 'mouse';
...@@ -13,4 +13,4 @@ ...@@ -13,4 +13,4 @@
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
CREATE TABLE t (n INT); CREATE TABLE t (n INT);
INSERT INTO t VALUES (1), (2), (3); INSERT INTO t VALUES (1), (2), (3);
@r/3.23/sel000002.result SELECT * FROM t; @r/sel000002.result SELECT * FROM t;
...@@ -14,4 +14,4 @@ ...@@ -14,4 +14,4 @@
DROP TABLE IF EXISTS t; DROP TABLE IF EXISTS t;
CREATE TABLE t (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score)); CREATE TABLE t (name CHAR(20) NOT NULL PRIMARY KEY, score SMALLINT NOT NULL, KEY(score));
INSERT INTO t VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10); INSERT INTO t VALUES ('Sasha', 20), ('Matt', 20), ('Monty', 10), ('David', 10), ('Tim', 10), ('Jeremy', 10);
@r/3.23/sel000003.result SELECT COUNT(*) as n, score FROM t GROUP BY score; @r/sel000003.result SELECT COUNT(*) as n, score FROM t GROUP BY score;
...@@ -16,6 +16,6 @@ val int(10) not null); ...@@ -16,6 +16,6 @@ val int(10) not null);
insert into elt_ck1 values (1),(2),(4); insert into elt_ck1 values (1),(2),(4);
insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2); insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2);
@r/3.23/sel000004.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two @r/sel000004.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two
where two.id=one.id order by one.id; where two.id=one.id order by one.id;
...@@ -16,6 +16,6 @@ val int(10) not null); ...@@ -16,6 +16,6 @@ val int(10) not null);
insert into elt_ck1 values (1),(2),(4); insert into elt_ck1 values (1),(2),(4);
insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2); insert into elt_ck2 values (1,1),(2,1),(3,1),(4,2);
@r/3.23/sel000005.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two @r/sel000005.result select one.id, elt(two.val,'one','two') from elt_ck1 one, elt_ck2 two
where two.id=one.id ; where two.id=one.id ;
...@@ -21,7 +21,7 @@ CREATE TABLE test2 ( ...@@ -21,7 +21,7 @@ CREATE TABLE test2 (
KEY NAME (NAME) KEY NAME (NAME)
); );
@r/3.23/sel000100.result SELECT DISTINCT @r/sel000100.result SELECT DISTINCT
test2.id AS key_link_id, test2.id AS key_link_id,
test2.name AS link test2.name AS link
FROM test1 FROM test1
......
...@@ -4,4 +4,4 @@ create table test ( ...@@ -4,4 +4,4 @@ create table test (
test_set set( 'val1', 'val2', 'val3' ) not null default '', test_set set( 'val1', 'val2', 'val3' ) not null default '',
name char(20) default 'O''Brien' name char(20) default 'O''Brien'
) comment = 'it\'s a table' ; ) comment = 'it\'s a table' ;
@r/3.23/shw000001.result show create table test ; @r/shw000001.result show create table test ;
...@@ -12,21 +12,36 @@ SOURCE=`pwd` ...@@ -12,21 +12,36 @@ SOURCE=`pwd`
# Save temporary distribution here (must be full path) # Save temporary distribution here (must be full path)
TMP=/tmp TMP=/tmp
if test $# -gt 0 if test $# -gt 0 -a x$1 != x"-debug"
then then
TMP=$1 TMP=$1
shift 1
fi fi
if test x$1 = x"-debug"
then
DEBUG=1
shift 1
fi
#make #make
# This should really be integrated with automake and not duplicate the # This should really be integrated with automake and not duplicate the
# installation list. # installation list.
BASE=$TMP/my_dist BASE=$TMP/my_dist
if [ -d $BASE ] ; then
rm -rf $BASE
fi
mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \ mkdir $BASE $BASE/bin $BASE/data $BASE/data/mysql $BASE/data/test \
$BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \ $BASE/include $BASE/lib $BASE/support-files $BASE/share $BASE/share/mysql \
$BASE/tests $BASE/scripts $BASE/sql-bench $BASE/tests $BASE/scripts $BASE/sql-bench $BASE/mysql-test \
$BASE/mysql-test/t $BASE/mysql-test/r \
$BASE/mysql-test/include $BASE/mysql-test/std_data
chmod o-rwx $BASE/data $BASE/data/* chmod o-rwx $BASE/data $BASE/data/*
for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \ for i in sql/ChangeLog COPYING COPYING.LIB README Docs/INSTALL-BINARY \
...@@ -37,8 +52,9 @@ done ...@@ -37,8 +52,9 @@ done
for i in extra/comp_err extra/replace extra/perror extra/resolveip \ for i in extra/comp_err extra/replace extra/perror extra/resolveip \
extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \ extra/my_print_defaults isam/isamchk isam/pack_isam myisam/myisamchk myisam/myisampack sql/mysqld sql/mysqlbinlog \
client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump client/mysqlimport \ client/mysql sql/mysqld client/mysqlshow client/mysqladmin client/mysqldump \
client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/mysqlimport client/mysqltest \
client/.libs/mysql client/.libs/mysqlshow client/.libs/mysqladmin client/.libs/mysqldump client/.libs/mysqlimport client/.libs/mysqltest
do do
cp -p $i $BASE/bin cp -p $i $BASE/bin
done done
...@@ -49,7 +65,16 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in ...@@ -49,7 +65,16 @@ rm $BASE/include/Makefile*; rm $BASE/include/*.in
cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests cp -p tests/*.res tests/*.tst tests/*.pl $BASE/tests
cp -p support-files/* $BASE/support-files cp -p support-files/* $BASE/support-files
cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib cp -p libmysql/.libs/libmysqlclient.a libmysql/.libs/libmysqlclient.so* libmysql/libmysqlclient.* libmysql_r/.libs/libmysqlclient_r.a libmysql_r/.libs/libmysqlclient_r.so* libmysql_r/libmysqlclient_r.* mysys/libmysys.a strings/libmystrings.a dbug/libdbug.a $BASE/lib
cp -r -p sql/share/* $BASE/share/mysql; rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD $BASE/share/CVS $BASE/share/*/CVS cp -r -p sql/share/* $BASE/share/mysql
rm -f $BASE/share/mysql/Makefile* $BASE/share/mysql/*/*.OLD
rm -rf $BASE/share/SCCS $BASE/share/*/SCCS
cp -p mysql-test/mysql-test-run mysql-test/install_test_db $BASE/scripts
cp -p mysql-test/README $BASE/README
cp -p mysql-test/include/*.inc $BASE/mysql-test/include
cp -p mysql-test/std_data/*.dat $BASE/mysql-test/std_data
cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t
cp -p mysql-test/r/*.result $BASE/mysql-test/r
cp -p scripts/* $BASE/bin cp -p scripts/* $BASE/bin
rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh rm -f $BASE/bin/Makefile* $BASE/bin/*.in $BASE/bin/*.sh $BASE/bin/mysql_install_db $BASE/bin/make_binary_distribution $BASE/bin/setsomevars $BASE/support-files/Makefile* $BASE/support-files/*.sh
...@@ -62,6 +87,8 @@ mv $BASE/support-files/binary-configure $BASE/configure ...@@ -62,6 +87,8 @@ mv $BASE/support-files/binary-configure $BASE/configure
chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure chmod a+x $BASE/bin/* $BASE/scripts/* $BASE/support-files/mysql-* $BASE/configure
cp -r -p sql-bench/* $BASE/sql-bench cp -r -p sql-bench/* $BASE/sql-bench
rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la rm -f $BASE/sql-bench/*.sh $BASE/sql-bench/Makefile* $BASE/lib/*.la
rm -rf `find $BASE/sql-bench -name SCCS`
rm -rf `find $BASE/share -name SCCS`
# Change the distribution to a long descreptive name # Change the distribution to a long descreptive name
NEW_NAME=mysql-$version-$system-$machine NEW_NAME=mysql-$version-$system-$machine
...@@ -86,6 +113,11 @@ then ...@@ -86,6 +113,11 @@ then
cd $SOURCE cd $SOURCE
fi fi
#if we are debugging, do not do tar/gz
if [ x$DEBUG = x1 ] ; then
exit
fi
# This is needed to prefere gnu tar instead of tar because tar can't # This is needed to prefere gnu tar instead of tar because tar can't
# always handle long filenames # always handle long filenames
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment