diff -Naur -Naur mysql-4.0.26/scripts/Makefile.am mysql-4.0.26.new/scripts/Makefile.am --- mysql-4.0.26/scripts/Makefile.am 2005-09-02 22:38:04.000000000 +0000 +++ mysql-4.0.26.new/scripts/Makefile.am 2005-12-06 15:30:25.000000000 +0000 @@ -81,11 +81,41 @@ mysql_find_rows \ mysqlhotcopy \ mysqldumpslow \ + mysql_explain_log \ + mysql_tableinfo \ mysqld_multi \ make_win_src_distribution SUPERCLEANFILES = mysqlbug +sql_libexec_REPLACE = mysqld +instance_manager_libexec_REPLACE= mysqlmanager +client_bin_REPLACE = mysql mysqladmin mysqlcheck mysqlshow \ + mysqldump mysqlimport mysqltest mysqlbinlog \ + mysqltestmanagerc mysqltestmanager-pwgen +extra_bin_REPLACE = replace comp_err perror resolveip my_print_defaults \ + resolve_stack_dump mysql_waitpid innochecksum +myisam_bin_REPLACE = myisamchk myisamlog myisampack myisam_ftdump +tools_bin_REPLACE = mysqltestmanager +cw_cpcd_ndbbin_REPLACE = ndb_cpcd +kernel_ndbbin_REPLACE = ndbd +mgmsrv_ndbbin_REPLACE = ndb_mgmd +sql_bin_REPLACE = mysql_tzinfo_to_sql +tests_bin_REPLACE = mysql_client_test +ndbtools_bin_REPLACE = ndb_test_platform ndb_waiter \ + ndb_drop_table ndb_delete_all \ + ndb_desc ndb_drop_index \ + ndb_show_tables ndb_select_all \ + ndb_select_count ndb_restore ndb_config +EXTRA_REPLACE_BIN = safe_mysqld mysqlanalyze mysqloptimize mysqlrepair mysqld-max isamchk \ + $(sql_libexec_REPLACE) $(ndbtools_bin_REPLACE) \ + $(instance_manager_libexec_REPLACE) $(client_bin_REPLACE) \ + $(extra_bin_REPLACE) $(myisam_bin_REPLACE) $(tools_bin_REPLACE) \ + $(cw_cpcd_ndbbin_REPLACE) $(kernel_ndbbin_REPLACE) $(mgmsrv_ndbbin_REPLACE) \ + $(sql_bin_REPLACE) $(tests_bin_REPLACE) + +dist_pkgdata_DATA = fill_help_tables.sql mysql_fix_privilege_tables.sql + # We want the right version and configure comand line in mysqlbug mysqlbug: ${top_builddir}/config.status mysqlbug.sh @@ -93,8 +123,17 @@ .sh: @RM@ -f $@ $@-t + bin_REPLACE='';\ + list='$(EXTRA_SCRIPTS) $(EXTRA_REPLACE_BIN)'; \ + for p in $${list}; do \ + f1=$${p/\.sh}; \ + f2=`echo "$${p}" | @SED@ -e 's|\.sh$$||' -e 's|^.*/||;$(transform)'`; \ + bin_REPLACE="$${bin_REPLACE}s!@mybin_$${f1}@!$${f2}!g;";\ + done; \ @SED@ \ + -e "$${bin_REPLACE}" \ -e 's!@''bindir''@!$(bindir)!g' \ + -e 's!@''sharedstatedir''@!$(sharedstatedir)!g' \ -e 's!@''sbindir''@!$(sbindir)!g' \ -e 's!@''scriptdir''@!$(bindir)!g' \ -e 's!@''prefix''@!$(prefix)!g' \ diff -Naur -Naur mysql-4.0.26/scripts/msql2mysql.sh mysql-4.0.26.new/scripts/msql2mysql.sh --- mysql-4.0.26/scripts/msql2mysql.sh 2005-09-02 22:38:10.000000000 +0000 +++ mysql-4.0.26.new/scripts/msql2mysql.sh 2005-12-06 15:26:25.000000000 +0000 @@ -13,4 +13,4 @@ # described in the License. Among other things, the License requires that # the copyright notice and this notice be preserved on all copies. -@bindir@/replace msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* +@bindir@/@mybin_replace@ msqlConnect mysql_connect msqlListDBs mysql_list_dbs msqlNumRows mysql_num_rows msqlFetchRow mysql_fetch_row msqlFetchField mysql_fetch_field msqlFreeResult mysql_free_result msqlListFields mysql_list_fields msqlListTables mysql_list_tables msqlErrMsg 'mysql_error(mysql)' msqlStoreResult mysql_store_result msqlQuery mysql_query msqlField mysql_field msqlSelect mysql_select msqlSelectDB mysql_select_db msqlNumFields mysql_num_fields msqlClose mysql_close msqlDataSeek mysql_data_seek m_field MYSQL_FIELD m_result MYSQL_RES m_row MYSQL_ROW msql mysql mSQL mySQL MSQL MYSQL msqlCreateDB mysql_create_db msqlDropDB mysql_drop_db msqlFieldSeek mysql_field_seek -- $* diff -Naur -Naur mysql-4.0.26/scripts/mysql_config.sh mysql-4.0.26.new/scripts/mysql_config.sh --- mysql-4.0.26/scripts/mysql_config.sh 2005-09-02 22:37:59.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysql_config.sh 2005-12-06 15:26:25.000000000 +0000 @@ -69,7 +69,7 @@ me=`get_full_path $0` -basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` +basedir=`echo $me | sed -e 's;/bin/@mybin_mysql_config@;;'` ldata='@localstatedir@' execdir='@libexecdir@' diff -Naur -Naur mysql-4.0.26/scripts/mysql_config.sh.orig mysql-4.0.26.new/scripts/mysql_config.sh.orig --- mysql-4.0.26/scripts/mysql_config.sh.orig 1970-01-01 00:00:00.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysql_config.sh.orig 2005-09-02 22:37:59.000000000 +0000 @@ -0,0 +1,152 @@ +#!/bin/sh +# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult 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; either version 2 of the License, or +# (at your option) any later version. +# +# 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +# This script reports various configuration settings that may be needed +# when using the MySQL client library. + +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 "which: no $file in ($PATH)" + exit 1 + done + IFS="$save_ifs" +} + +# +# If we can find the given directory relatively to where mysql_config is +# we should use this instead of the incompiled one. +# This is to ensure that this script also works with the binary MySQL +# version + +fix_path () +{ + var=$1 + shift + for filename + do + path=$basedir/$filename + if [ -d "$path" ] ; + then + eval "$var"=$path + return + fi + done +} + +get_full_path () +{ + case $1 in + /*) echo "$1";; + ./*) tmp=`pwd`/$1; echo $tmp | sed -e 's;/\./;/;' ;; + *) which $1 ;; + esac +} + +me=`get_full_path $0` + +basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` + +ldata='@localstatedir@' +execdir='@libexecdir@' +bindir='@bindir@' +pkglibdir='@pkglibdir@' +fix_path pkglibdir lib/mysql lib +pkgincludedir='@pkgincludedir@' +fix_path pkgincludedir include/mysql include +version='@VERSION@' +socket='@MYSQL_UNIX_ADDR@' +port='@MYSQL_TCP_PORT@' +ldflags='@LDFLAGS@' +client_libs='@CLIENT_LIBS@' + +# Create options + +libs="$ldflags -L$pkglibdir -lmysqlclient $client_libs" +libs=`echo "$libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +libs_r="$ldflags -L$pkglibdir -lmysqlclient_r @LIBS@ @openssl_libs@" +libs_r=`echo "$libs_r" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` +cflags="-I$pkgincludedir @CFLAGS@ " #note: end space! +include="-I$pkgincludedir" +embedded_libs="$ldflags -L$pkglibdir -lmysqld @LIBS@ @WRAPLIBS@ @innodb_system_libs@" +embedded_libs=`echo "$embedded_libs" | sed -e 's; \+; ;g' | sed -e 's;^ *;;' | sed -e 's; *\$;;'` + +# Remove some options that a client doesn't have to care about +for remove in DDBUG_OFF DSAFEMALLOC USAFEMALLOC DSAFE_MUTEX \ + DPEDANTIC_SAFEMALLOC DUNIV_MUST_NOT_INLINE DFORCE_INIT_OF_VARS \ + DEXTRA_DEBUG DHAVE_purify 'O[0-9]' 'W[-A-Za-z]*' +do + cflags=`echo "$cflags"|sed -e "s/-$remove *//g"` +done +cflags=`echo "$cflags"|sed -e 's/ *\$//'` + +usage () { + cat <&1` + resolved=`$bindir/@mybin_resolveip@ $hostname 2>&1` if [ $? -ne 0 ] then - resolved=`$bindir/resolveip localhost 2>&1` + resolved=`$bindir/@mybin_resolveip@ localhost 2>&1` if [ $? -ne 0 ] then echo "Neither host '$hostname' nor 'localhost' could not be looked up with" - echo "$bindir/resolveip" + echo "$bindir/@mybin_resolveip@" echo "Please configure the 'hostname' command to return a correct hostname." echo "If you want to solve this at a later stage, restart this script with" echo "the --force option" exit 1 fi - echo "WARNING: The host '$hostname' could not be looked up with resolveip." + echo "WARNING: The host '$hostname' could not be looked up with @mybin_resolveip@." echo "This probably means that your libc libraries are not 100 % compatible" - echo "with this binary MySQL version. The MySQL daemon, mysqld, should work" + echo "with this binary MySQL version. The MySQL daemon, @mybin_mysqld@, should work" echo "normally with the exception that host name resolving will not work." echo "This means that you should use IP addresses instead of hostnames" echo "when specifying MySQL privileges !" @@ -371,8 +371,8 @@ fi echo "PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !" echo "To do so, start the server, then issue the following commands:" - echo "$bindir/mysqladmin -u root password 'new-password'" - echo "$bindir/mysqladmin -u root -h $hostname password 'new-password'" + echo "$bindir/@mybin_mysqladmin@ -u root password 'new-password'" + echo "$bindir/@mybin_mysqladmin@ -u root -h $hostname password 'new-password'" echo "See the manual for more instructions." # # Print message about upgrading unless we have created a new db table. @@ -380,14 +380,14 @@ then echo echo "NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run" - echo "the $bindir/mysql_fix_privilege_tables. Otherwise you will not be" + echo "the $bindir/@mybin_mysql_fix_privilege_tables@. Otherwise you will not be" echo "able to use the new GRANT command!" fi echo if test "$in_rpm" = "0" then echo "You can start the MySQL daemon with:" - echo "cd @prefix@ ; $bindir/mysqld_safe &" + echo "cd @prefix@ ; $bindir/@mybin_mysqld_safe@ &" echo echo "You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:" echo "cd sql-bench ; perl run-all-tests" @@ -407,13 +407,13 @@ echo "You can also try to start the mysqld daemon with:" echo "$execdir/mysqld --skip-grant &" echo "You can use the command line tool" - echo "$bindir/mysql to connect to the mysql" + echo "$bindir/@mybin_mysql@ to connect to the mysql" echo "database and look at the grant tables:" echo - echo "shell> $bindir/mysql -u root mysql" + echo "shell> $bindir/@mybin_mysql@ -u root mysql" echo "mysql> show tables" echo - echo "Try 'mysqld --help' if you have problems with paths. Using --log" + echo "Try '@mybin_mysqld@ --help' if you have problems with paths. Using --log" echo "gives you a log in $ldata that may be helpful." echo echo "The latest information about MySQL is available on the web at" @@ -422,6 +422,6 @@ echo "and the manual section that describes problems on your OS." echo "Another information source is the MySQL email archive." echo "Please check all of the above before mailing us!" - echo "And if you do mail us, you MUST use the @scriptdir@/mysqlbug script!" + echo "And if you do mail us, you MUST use the @scriptdir@/@mybin_mysqlbug@ script!" exit 1 fi diff -Naur -Naur mysql-4.0.26/scripts/mysql_secure_installation.sh mysql-4.0.26.new/scripts/mysql_secure_installation.sh --- mysql-4.0.26/scripts/mysql_secure_installation.sh 2005-09-02 22:37:55.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysql_secure_installation.sh 2005-12-06 15:26:49.000000000 +0000 @@ -30,7 +30,7 @@ do_query() { echo $1 >$command - mysql --defaults-file=$config <$command + @mybin_mysql@ --defaults-file=$config <$command return $? } diff -Naur -Naur mysql-4.0.26/scripts/mysqlaccess.sh mysql-4.0.26.new/scripts/mysqlaccess.sh --- mysql-4.0.26/scripts/mysqlaccess.sh 2005-09-02 22:37:59.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysqlaccess.sh 2005-12-06 15:26:49.000000000 +0000 @@ -17,7 +17,7 @@ # **************************** # information on MySQL - $MYSQL = '@bindir@/mysql'; # path to mysql executable + $MYSQL = '@bindir@/@mybin_mysql@'; # path to mysql executable $SERVER = '3.21'; $MYSQL_OPT = ' --batch --unbuffered'; $ACCESS_DB = 'mysql'; # name of DB with grant-tables @@ -32,7 +32,7 @@ $ACCESS_U_BCK = 'user_backup'; $ACCESS_D_BCK = 'db_backup'; $DIFF = '/usr/bin/diff'; - $MYSQLDUMP = '@bindir@/mysqldump'; + $MYSQLDUMP = '@bindir@/@mybin_mysqldump@'; #path to mysqldump executable $MYSQLADMIN= 'http://foobar.com/MySQLadmin'; diff -Naur -Naur mysql-4.0.26/scripts/mysqld_multi.sh mysql-4.0.26.new/scripts/mysqld_multi.sh --- mysql-4.0.26/scripts/mysqld_multi.sh 2005-09-02 22:38:07.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysqld_multi.sh 2005-12-06 15:41:13.000000000 +0000 @@ -10,8 +10,8 @@ $opt_example = 0; $opt_help = 0; $opt_log = undef(); -$opt_mysqladmin = "@bindir@/mysqladmin"; -$opt_mysqld = "@libexecdir@/mysqld"; +$opt_mysqladmin = "@bindir@/@mybin_mysqladmin@"; +$opt_mysqld = "@libexecdir@/@mybin_mysqld@"; $opt_no_log = 0; $opt_password = undef(); $opt_tcp_ip = 0; @@ -37,11 +37,11 @@ { my ($flag_exit); - if (!defined(my_which(my_print_defaults))) + if (!defined(my_which(@mybin_my_print_defaults@))) { # We can't throw out yet, since --version, --help, or --example may # have been given - print "WARNING! my_print_defaults command not found!\n"; + print "WARNING! @mybin_my_print_defaults@ command not found!\n"; print "Please make sure you have this command available and\n"; print "in your path. The command is available from the latest\n"; print "MySQL distribution.\n"; @@ -67,9 +67,9 @@ } } } - my $com= "my_print_defaults "; + my $com= "@mybin_my_print_defaults@ "; $com.= "--config-file=$opt_config_file " if (defined($opt_config_file)); - $com.= "mysqld_multi"; + $com.= "@mybin_mysqld_multi@"; my @defops = `$com`; chop @defops; splice @ARGV, 0, 0, @defops; @@ -102,9 +102,9 @@ print "Error with an option, see $my_progname --help for more info!\n"; exit(1); } - if (!defined(my_which(my_print_defaults))) + if (!defined(my_which(@mybin_my_print_defaults@))) { - print "ABORT: Can't find command 'my_print_defaults'!\n"; + print "ABORT: Can't find command '@mybin_my_print_defaults@'!\n"; print "This command is available from the latest MySQL\n"; print "distribution. Please make sure you have the command\n"; print "in your PATH.\n"; @@ -149,7 +149,7 @@ { if ($my_print_defaults_exists) { - @mysqld_opts= `my_print_defaults mysqld`; + @mysqld_opts= `@mybin_my_print_defaults@ mysqld`; chomp @mysqld_opts; foreach my $opt (@mysqld_opts) { @@ -263,7 +263,7 @@ @groups = &find_groups($groupids); for ($i = 0; defined($groups[$i]); $i++) { - $com = "my_print_defaults"; + $com = "@mybin_my_print_defaults@"; $com.= defined($opt_config_file) ? " --config-file=$opt_config_file" : ""; $com.= " $groups[$i]"; @options = `$com`; @@ -574,8 +574,8 @@ # give you extra performance in a threaded system! # [mysqld_multi] -mysqld = @bindir@/mysqld_safe -mysqladmin = @bindir@/mysqladmin +mysqld = @bindir@/@mybin_safe_mysqld@ +mysqladmin = @bindir@/@mybin_mysqladmin@ user = root password = your_password diff -Naur -Naur mysql-4.0.26/scripts/mysqld_safe.sh mysql-4.0.26.new/scripts/mysqld_safe.sh --- mysql-4.0.26/scripts/mysqld_safe.sh 2005-09-02 22:37:59.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysqld_safe.sh 2005-12-06 15:43:55.000000000 +0000 @@ -67,7 +67,7 @@ then MYSQLD="mysqld-$tmp" else - MYSQLD="mysqld" + MYSQLD="@mybin_mysqld@" fi ;; --nice=*) niceness=`echo "$arg" | sed -e "s;--nice=;;"` ;; @@ -87,7 +87,7 @@ MY_PWD=`pwd` # Check if we are starting this relative (for the binary release) if test -d $MY_PWD/data/mysql -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./bin/mysqld + -x ./bin/@mybin_mysqld@ then MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is @@ -98,7 +98,7 @@ fi # Check if this is a 'moved install directory' elif test -f ./var/mysql/db.frm -a -f ./share/mysql/english/errmsg.sys -a \ - -x ./libexec/mysqld + -x ./libexec/@mybin_mysqld@ then MY_BASEDIR_VERSION=$MY_PWD # Where libexec, share and var are ledir=$MY_BASEDIR_VERSION/libexec # Where mysqld is @@ -113,11 +113,11 @@ niceness=0 # Use the mysqld-max binary by default if the user doesn't specify a binary -if test -x $ledir/mysqld-max +if test -x $ledir/@mybin_mysqld-max@ then - MYSQLD=mysqld-max + MYSQLD=@mybin_mysqld-max@ else - MYSQLD=mysqld + MYSQLD=@mybin_mysqld@ fi # these rely on $DATADIR by default, so we'll set them later on @@ -126,17 +126,17 @@ # Get first arguments from the my.cnf file, groups [mysqld] and [mysqld_safe] # and then merge with the command line arguments -if test -x ./bin/my_print_defaults +if test -x "./bin/@mybin_my_print_defaults@" then - print_defaults="./bin/my_print_defaults" -elif test -x @bindir@/my_print_defaults + print_defaults="./bin/@mybin_my_print_defaults@" +elif test -x "@bindir@/@mybin_my_print_defaults@" then - print_defaults="@bindir@/my_print_defaults" -elif test -x @bindir@/mysql_print_defaults + print_defaults="@bindir@/@mybin_my_print_defaults@" +elif test -x "@bindir@/@mybin_my_print_defaults@" then - print_defaults="@bindir@/mysql_print_defaults" + print_defaults="@bindir@/@mybin_my_print_defaults@" else - print_defaults="my_print_defaults" + print_defaults="@mybin_my_print_defaults@" fi args= @@ -155,7 +155,7 @@ echo "The file $ledir/$MYSQLD doesn't exist or is not executable" echo "Please do a cd to the mysql installation directory and restart" echo "this script from there as follows:" - echo "./bin/mysqld_safe". + echo "./bin/@mybin_mysqld_safe@". echo "See http://dev.mysql.com/doc/mysql/en/mysqld_safe.html for more" echo "information" exit 1 @@ -284,12 +284,12 @@ # checked and repaired during startup. You should add sensible key_buffer # and sort_buffer values to my.cnf to improve check performance or require # less disk space. -# Alternatively, you can start mysqld with the "myisam-recover" option. See +# Alternatively, you can start @mybin_mysqld@ with the "myisam-recover" option. See # the manual for details. # # echo "Checking tables in $DATADIR" -# $MY_BASEDIR_VERSION/bin/myisamchk --silent --force --fast --medium-check $DATADIR/*/*.MYI -# $MY_BASEDIR_VERSION/bin/isamchk --silent --force $DATADIR/*/*.ISM +# $MY_BASEDIR_VERSION/bin/@mybin_myisamchk@ --silent --force --fast --medium-check $DATADIR/*/*.MYI +# $MY_BASEDIR_VERSION/bin/@mybin_isamchk@ --silent --force $DATADIR/*/*.ISM echo "Starting $MYSQLD daemon with databases from $DATADIR" @@ -299,7 +299,7 @@ # ulimit -n 256 > /dev/null 2>&1 # Fix for BSD and FreeBSD systems #fi -echo "`date +'%y%m%d %H:%M:%S mysqld started'`" >> $err_log +echo "`date +'%y%m%d %H:%M:%S @mybin_mysqld@ started'`" >> $err_log while true do rm -f $safe_mysql_unix_port $pid_file # Some extra safety @@ -344,9 +344,9 @@ I=`expr $I + 1` done fi - echo "`date +'%y%m%d %H:%M:%S'` mysqld restarted" | tee -a $err_log + echo "`date +'%y%m%d %H:%M:%S'` @mybin_mysqld@ restarted" | tee -a $err_log done -echo "`date +'%y%m%d %H:%M:%S'` mysqld ended" | tee -a $err_log +echo "`date +'%y%m%d %H:%M:%S'` @mybin_mysqld@ ended" | tee -a $err_log echo "" | tee -a $err_log diff -Naur -Naur mysql-4.0.26/scripts/mysqldumpslow.sh mysql-4.0.26.new/scripts/mysqldumpslow.sh --- mysql-4.0.26/scripts/mysqldumpslow.sh 2005-09-02 22:37:59.000000000 +0000 +++ mysql-4.0.26.new/scripts/mysqldumpslow.sh 2005-12-06 15:26:49.000000000 +0000 @@ -32,16 +32,16 @@ unless (@ARGV) { - my $defaults = `my_print_defaults mysqld`; + my $defaults = `@mybin_my_print_defaults@ mysqld`; my $basedir = ($defaults =~ m/--basedir=(.*)/)[0] - or die "Can't determine basedir from 'my_print_defaults mysqld' output: $defaults"; + or die "Can't determine basedir from '@mybin_my_print_defaults@ mysqld' output: $defaults"; warn "basedir=$basedir\n" if $opt{v}; my $datadir = ($defaults =~ m/--datadir=(.*)/)[0]; if (!$datadir or $opt{i}) { # determine the datadir from the instances section of /etc/my.cnf, if any - my $instances = `my_print_defaults instances`; - die "Can't determine datadir from 'my_print_defaults mysqld' output: $defaults" + my $instances = `@mybin_my_print_defaults@ instances`; + die "Can't determine datadir from '@mybin_my_print_defaults@ mysqld' output: $defaults" unless $instances; my @instances = ($instances =~ m/^--(\w+)-/mg); die "No -i 'instance_name' specified to select among known instances: @instances.\n" @@ -49,7 +49,7 @@ die "Instance '$opt{i}' is unknown (known instances: @instances)\n" unless grep { $_ eq $opt{i} } @instances; $datadir = ($instances =~ m/--$opt{i}-datadir=(.*)/)[0] - or die "Can't determine --$opt{i}-datadir from 'my_print_defaults instances' output: $instances"; + or die "Can't determine --$opt{i}-datadir from '@mybin_my_print_defaults@ instances' output: $instances"; warn "datadir=$datadir\n" if $opt{v}; }