Commit e9c2f7d4 authored by monty@donna.mysql.com's avatar monty@donna.mysql.com

Fixes to get mysql-test included in the distributions

parent 476d960b
...@@ -863,14 +863,16 @@ static char *add_load_option(char *ptr,const char *object, ...@@ -863,14 +863,16 @@ static char *add_load_option(char *ptr,const char *object,
{ {
if (object) if (object)
{ {
if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */ /* Don't escape hex constants */
ptr= strxmov(ptr," ",statement," ",object,NullS); if (object[0] == '0' && (object[1] == 'x' || object[1] == 'X'))
else /* char constant; escape */ ptr= strxmov(ptr," ",statement," ",object,NullS);
{ else
ptr= strxmov(ptr," ",statement," '",NullS); {
ptr= field_escape(ptr,object,(uint) strlen(object)); /* char constant; escape */
*ptr++= '\''; ptr= strxmov(ptr," ",statement," '",NullS);
} ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
} }
return ptr; return ptr;
} /* add_load_option */ } /* add_load_option */
......
...@@ -452,18 +452,21 @@ static void db_error(MYSQL *mysql) ...@@ -452,18 +452,21 @@ static void db_error(MYSQL *mysql)
} }
static char *add_load_option(char *ptr,const char *object,const char *statement) static char *add_load_option(char *ptr, const char *object,
const char *statement)
{ {
if (object) if (object)
{ {
if (!strncasecmp(object,"0x",2)) /* hex constant; don't escape */ /* Don't escape hex constants */
ptr= strxmov(ptr," ",statement," ",object,NullS); if (object[0] == '0' && (object[1] == 'x' || object[1] == 'X'))
else /* char constant; escape */ ptr= strxmov(ptr," ",statement," ",object,NullS);
{ else
ptr= strxmov(ptr," ",statement," '",NullS); {
ptr= field_escape(ptr,object,(uint) strlen(object)); /* char constant; escape */
*ptr++= '\''; ptr= strxmov(ptr," ",statement," '",NullS);
} ptr= field_escape(ptr,object,(uint) strlen(object));
*ptr++= '\'';
}
} }
return ptr; return ptr;
} }
......
...@@ -17,11 +17,12 @@ ...@@ -17,11 +17,12 @@
## Process this file with automake to create Makefile.in ## Process this file with automake to create Makefile.in
EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh benchdir_root= $(prefix)
EXTRA_DIST = $(EXTRA_SCRIPTS) testdir = $(benchdir_root)/mysql-test
testdir = $(prefix)/mysql-test EXTRA_SCRIPTS = mysql-test-run.sh install_test_db.sh
test_SCRIPTS = mysql-test-run install_test_db EXTRA_DIST = $(EXTRA_SCRIPTS)
CLEANFILES = $(test_SCRIPTS) test_SCRIPTS = mysql-test-run install_test_db
CLEANFILES = $(test_SCRIPTS)
dist-hook: dist-hook:
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \ mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
...@@ -52,7 +53,7 @@ SUFFIXES = .sh ...@@ -52,7 +53,7 @@ SUFFIXES = .sh
.sh: .sh:
@RM@ -f $@ $@-t @RM@ -f $@ $@-t
@SED@ \ @SED@ \
-e 's!@''benchdir''@!$(benchdir)!g' \ -e 's!@''testdir''@!$(testdir)!g' \
-e 's!@''bindir''@!$(bindir)!g' \ -e 's!@''bindir''@!$(bindir)!g' \
-e 's!@''scriptdir''@!$(bindir)!g' \ -e 's!@''scriptdir''@!$(bindir)!g' \
-e 's!@''prefix''@!$(prefix)!g' \ -e 's!@''prefix''@!$(prefix)!g' \
......
...@@ -15,31 +15,56 @@ DBPASSWD= ...@@ -15,31 +15,56 @@ DBPASSWD=
VERBOSE="" VERBOSE=""
TZ=GMT-3; export TZ # for UNIX_TIMESTAMP tests to work TZ=GMT-3; export TZ # for UNIX_TIMESTAMP tests to work
# Are we on source or binary distribution? #++
# Program Definitions
#--
if [ $0 = scripts/mysql-test-run ] ; PATH=/bin:/usr/bin:/usr/local/bin
then
BINARY_DIST=1 # No paths below as we can't be sure where the program is!
BASENAME=`which basename | head -1`
CAT=cat
CUT=cut
TAIL=tail
ECHO=echo # use internal echo if possible
EXPR=expr # use internal if possible
FIND=find
GCOV=`which gcov | head -1`
PRINTF=printf
RM=rm
TIME=time
TR=tr
XARGS=`which xargs | head -1`
# Are we using a source or a binary distribution?
testdir=@testdir@
if [ -d bin/mysqld ] && [ -d mysql-test ] ; then
cd mysql-test cd mysql-test
else else
if [ -d mysql-test ] ; then if [ -d $testdir/mysql-test ] ; then
cd mysql-test cd $testdir
fi fi
fi
if [ -f ./mysql-test-run ] && [ -d ../sql ] ; then
SOURCE_DIST=1 if [ ! -f ./mysql-test-run ] ; then
else $ECHO "Can't find the location for the mysql-test-run script"
$ECHO "If you are using binary distribution, run from install root as"
$ECHO "scripts/mysql-test-run. On source distribution run from source root" $ECHO "Go to to the mysql-test directory and execute the script as follows:"
$ECHO "as mysql-test/mysql-test-run or from mysql-test as ./mysql-test-run" $ECHO "./mysql-test-run."
exit 1 exit 1
fi
fi fi
#++ #++
# Misc. Definitions # Misc. Definitions
#-- #--
if [ -d ../sql ] ; then
SOURCE_DIST=1
else
BINARY_DIST=1
fi
#BASEDIR is always one above mysql-test directory #BASEDIR is always one above mysql-test directory
CWD=`pwd` CWD=`pwd`
cd .. cd ..
...@@ -101,22 +126,6 @@ fi ...@@ -101,22 +126,6 @@ fi
[ -d $MYSQL_TEST_DIR/var/tmp ] || mkdir $MYSQL_TEST_DIR/var/tmp [ -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/run ] || mkdir $MYSQL_TEST_DIR/var/run
#++
# Program Definitions
#--
BASENAME=`which basename | head -1`
CAT=/bin/cat
CUT=/usr/bin/cut
ECHO=echo # use internal echo if possible
EXPR=expr # use internal if possible
FIND=/usr/bin/find
GCOV=`which gcov | head -1`
PRINTF=/usr/bin/printf
RM=/bin/rm
TIME=/usr/bin/time
TR=/usr/bin/tr
XARGS=`which xargs | head -1`
[ -z "$COLUMNS" ] && COLUMNS=80 [ -z "$COLUMNS" ] && COLUMNS=80
E=`$EXPR $COLUMNS - 8` E=`$EXPR $COLUMNS - 8`
#DASH72=`expr substr '------------------------------------------------------------------------' 1 $E` #DASH72=`expr substr '------------------------------------------------------------------------' 1 $E`
...@@ -361,17 +370,18 @@ stop_slave () ...@@ -361,17 +370,18 @@ stop_slave ()
$MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root shutdown $MYSQLADMIN --no-defaults --socket=$SLAVE_MYSOCK -u root shutdown
if [ $? != 0 ] ; then # try harder! if [ $? != 0 ] ; then # try harder!
$ECHO "slave not cooperating with mysqladmin, will try manual kill" $ECHO "slave not cooperating with mysqladmin, will try manual kill"
kill `cat $SLAVE_MYPID` kill `$CAT $SLAVE_MYPID`
sleep 2 sleep 2
if [ -f $SLAVE_MYPID ] ; then if [ -f $SLAVE_MYPID ] ; then
$ECHO "slave refused to die, resorting to SIGKILL murder" $ECHO "slave refused to die, resorting to SIGKILL murder"
kill -9 `cat $SLAVE_MYPID` kill -9 `$CAT $SLAVE_MYPID`
$RM -f $SLAVE_MYPID $RM -f $SLAVE_MYPID
else else
$ECHO "slave responded to SIGTERM " $ECHO "slave responded to SIGTERM "
fi fi
fi fi
SLAVE_RUNNING=0 SLAVE_RUNNING=0
sleep 2 # Give mysqld time to go down properly
fi fi
} }
...@@ -382,17 +392,18 @@ stop_master () ...@@ -382,17 +392,18 @@ stop_master ()
$MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root shutdown $MYSQLADMIN --no-defaults --socket=$MASTER_MYSOCK -u root shutdown
if [ $? != 0 ] ; then # try harder! if [ $? != 0 ] ; then # try harder!
$ECHO "master not cooperating with mysqladmin, will try manual kill" $ECHO "master not cooperating with mysqladmin, will try manual kill"
kill `cat $MASTER_MYPID` kill `$CAT $MASTER_MYPID`
sleep 2 sleep 2
if [ -f $MASTER_MYPID ] ; then if [ -f $MASTER_MYPID ] ; then
$ECHO "master refused to die, resorting to SIGKILL murder" $ECHO "master refused to die, resorting to SIGKILL murder"
kill -9 `cat $MASTER_MYPID` kill -9 `$CAT $MASTER_MYPID`
$RM -f $MASTER_MYPID $RM -f $MASTER_MYPID
else else
$ECHO "master responded to SIGTERM " $ECHO "master responded to SIGTERM "
fi fi
fi fi
MASTER_RUNNING=0 MASTER_RUNNING=0
sleep 2 # Give mysqld time to go down properly
fi fi
} }
...@@ -400,7 +411,7 @@ mysql_stop () ...@@ -400,7 +411,7 @@ mysql_stop ()
{ {
$ECHO "Ending Tests" $ECHO "Ending Tests"
$ECHO "Shutting-down MySQL daemon" $ECHO "Shutting-down MySQL daemon"
$ECHO $ECHO ""
stop_master stop_master
stop_slave stop_slave
return 1 return 1
...@@ -436,7 +447,7 @@ run_testcase () ...@@ -436,7 +447,7 @@ run_testcase ()
if [ -f $master_opt_file ] ; if [ -f $master_opt_file ] ;
then then
EXTRA_MASTER_OPT=`cat $master_opt_file` EXTRA_MASTER_OPT=`$CAT $master_opt_file`
stop_master stop_master
start_master start_master
else else
...@@ -451,7 +462,7 @@ run_testcase () ...@@ -451,7 +462,7 @@ run_testcase ()
if [ -f $slave_opt_file ] ; if [ -f $slave_opt_file ] ;
then then
EXTRA_SLAVE_OPT=`cat $slave_opt_file` EXTRA_SLAVE_OPT=`$CAT $slave_opt_file`
do_slave_restart=1 do_slave_restart=1
else else
if [ ! -z "$EXTRA_SLAVE_OPT" ] || [ x$SLAVE_RUNNING != x1 ] ; if [ ! -z "$EXTRA_SLAVE_OPT" ] || [ x$SLAVE_RUNNING != x1 ] ;
...@@ -462,7 +473,7 @@ run_testcase () ...@@ -462,7 +473,7 @@ run_testcase ()
fi fi
if [ -f $slave_master_info_file ] ; then if [ -f $slave_master_info_file ] ; then
SLAVE_MASTER_INFO=`cat $slave_master_info_file` SLAVE_MASTER_INFO=`$CAT $slave_master_info_file`
do_slave_restart=1 do_slave_restart=1
else else
if [ ! -z "$SLAVE_MASTER_INFO" ] || [ x$SLAVE_RUNNING != x1 ] ; if [ ! -z "$SLAVE_MASTER_INFO" ] || [ x$SLAVE_RUNNING != x1 ] ;
...@@ -486,7 +497,7 @@ run_testcase () ...@@ -486,7 +497,7 @@ run_testcase ()
res=$? res=$?
if [ $res = 0 ]; then if [ $res = 0 ]; then
mytime=`$CAT $TIMEFILE | $TR '\n' '-'` mytime=`$CAT $TIMEFILE | $TAIL -3 | $TR '\n' '-'`
USERT=`$ECHO $mytime | $CUT -d - -f 2 | $CUT -d ' ' -f 2` USERT=`$ECHO $mytime | $CUT -d - -f 2 | $CUT -d ' ' -f 2`
USERT=`prefix_to_8 $USERT` USERT=`prefix_to_8 $USERT`
...@@ -527,7 +538,7 @@ run_testcase () ...@@ -527,7 +538,7 @@ run_testcase ()
mysql_restart mysql_restart
$ECHO "Resuming Tests" $ECHO "Resuming Tests"
$ECHO $ECHO ""
else else
pass_inc pass_inc
$ECHO "$RES_SPACE [ skipped ]" $ECHO "$RES_SPACE [ skipped ]"
......
...@@ -75,7 +75,7 @@ cp -p mysql-test/include/*.inc $BASE/mysql-test/include ...@@ -75,7 +75,7 @@ cp -p mysql-test/include/*.inc $BASE/mysql-test/include
cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \ cp -p mysql-test/std_data/*.dat mysql-test/std_data/*.frm \
mysql-test/std_data/*.MRG $BASE/mysql-test/std_data mysql-test/std_data/*.MRG $BASE/mysql-test/std_data
cp -p mysql-test/t/*.test mysql-test/t/*.opt $BASE/mysql-test/t 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 mysql-test/r/*.result mysql-test/r/*.require $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
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
## Process this file with automake to create Makefile.in ## Process this file with automake to create Makefile.in
benchdir = $(prefix)/sql-bench benchdir_root= $(prefix)
benchdir = $(benchdir_root)/sql-bench
bench_SCRIPTS = test-ATIS test-connect test-create test-insert \ bench_SCRIPTS = test-ATIS test-connect test-create test-insert \
test-big-tables test-select test-wisconsin \ test-big-tables test-select test-wisconsin \
test-alter-table \ test-alter-table \
......
...@@ -2355,7 +2355,7 @@ enum options { ...@@ -2355,7 +2355,7 @@ enum options {
OPT_INNOBASE_LOG_GROUP_HOME_DIR, OPT_INNOBASE_LOG_GROUP_HOME_DIR,
OPT_INNOBASE_LOG_ARCH_DIR, OPT_INNOBASE_LOG_ARCHIVE, OPT_INNOBASE_LOG_ARCH_DIR, OPT_INNOBASE_LOG_ARCHIVE,
OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT, OPT_SAFE_SHOW_DB, OPT_INNOBASE_FLUSH_LOG_AT_TRX_COMMIT, OPT_SAFE_SHOW_DB,
OPT_GEMINI_SKIP, OPT_GEMINI_SKIP
}; };
static struct option long_options[] = { static struct option long_options[] = {
......
...@@ -85,7 +85,7 @@ Este pacote cont ...@@ -85,7 +85,7 @@ Este pacote cont
%package bench %package bench
Release: %{release} Release: %{release}
Requires: MySQL-client MySQL-DBI-perl-bin perl Requires: MySQL-client MySQL-DBI-perl-bin perl
Summary: MySQL - Benchmarks Summary: MySQL - Benchmarks and test system
Group: Applications/Databases Group: Applications/Databases
Summary(pt_BR): MySQL - Medies de desempenho Summary(pt_BR): MySQL - Medies de desempenho
Group(pt_BR): Aplicaes/Banco_de_Dados Group(pt_BR): Aplicaes/Banco_de_Dados
...@@ -168,7 +168,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \ ...@@ -168,7 +168,7 @@ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
" "
# benchdir does not fit in above model. Maybe a separate bench distribution # benchdir does not fit in above model. Maybe a separate bench distribution
make benchdir=$RPM_BUILD_ROOT/usr/share/sql-bench make benchdir_root=$RPM_BUILD_ROOT/usr/share/
} }
# Use the build root for temporary storage of the shared libraries. # Use the build root for temporary storage of the shared libraries.
...@@ -208,11 +208,12 @@ MBD=$RPM_BUILD_DIR/mysql-%{mysql_version} ...@@ -208,11 +208,12 @@ MBD=$RPM_BUILD_DIR/mysql-%{mysql_version}
install -d $RBR/etc/{logrotate.d,rc.d/init.d} install -d $RBR/etc/{logrotate.d,rc.d/init.d}
install -d $RBR/var/lib/mysql/mysql install -d $RBR/var/lib/mysql/mysql
install -d $RBR/usr/share/sql-bench install -d $RBR/usr/share/sql-bench
install -d $RBR/usr/share/mysql-test
install -d $RBR/usr/{sbin,share,man,include} install -d $RBR/usr/{sbin,share,man,include}
install -d $RBR/usr/doc/MySQL-%{mysql_version} install -d $RBR/usr/doc/MySQL-%{mysql_version}
install -d $RBR/usr/lib install -d $RBR/usr/lib
# Make install # Make install
make install DESTDIR=$RBR benchdir=/usr/share/sql-bench make install DESTDIR=$RBR benchdir_root=/usr/share/
# Install shared libraries (Disable for architectures that don't support it) # Install shared libraries (Disable for architectures that don't support it)
(cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar) (cd $RBR/usr/lib; tar xf $RBR/shared-libs.tar)
...@@ -366,9 +367,14 @@ fi ...@@ -366,9 +367,14 @@ fi
%files bench %files bench
%attr(-, root, root) /usr/share/sql-bench %attr(-, root, root) /usr/share/sql-bench
%attr(-, root, root) /usr/share/mysql-test
%changelog %changelog
* Tue Jan 2 2001 Monty
- Added mysql-test to the bench package
* Fri Aug 18 2000 Tim Smith <tim@mysql.com> * Fri Aug 18 2000 Tim Smith <tim@mysql.com>
- Added separate libmysql_r directory; now both a threaded - Added separate libmysql_r directory; now both a threaded
......
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