Merge pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
into pilot.(none):/data/msvensson/mysql/mysql-5.1-new-maint
This commit is contained in:
commit
0b27b3bc0e
@ -352,16 +352,11 @@ static my_bool get_full_path_to_executable(char* path)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
Look for the tool in the same directory as mysql_upgrade.
|
Look for the tool in the same directory as mysql_upgrade.
|
||||||
|
|
||||||
When running in a not yet installed build the the program
|
|
||||||
will exist but it need to be invoked via it's libtool wrapper.
|
|
||||||
Check if the found tool can executed and if not look in the
|
|
||||||
directory one step higher up where the libtool wrapper normally
|
|
||||||
is found
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static void find_tool(char *tool_path, const char *tool_name)
|
static void find_tool(char *tool_path, const char *tool_name)
|
||||||
{
|
{
|
||||||
|
size_t path_len;
|
||||||
char path[FN_REFLEN];
|
char path[FN_REFLEN];
|
||||||
DYNAMIC_STRING ds_tmp;
|
DYNAMIC_STRING ds_tmp;
|
||||||
DBUG_ENTER("find_tool");
|
DBUG_ENTER("find_tool");
|
||||||
@ -395,38 +390,52 @@ static void find_tool(char *tool_path, const char *tool_name)
|
|||||||
path[0]= 0;
|
path[0]= 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
do
|
|
||||||
|
DBUG_PRINT("info", ("path: '%s'", path));
|
||||||
|
|
||||||
|
/* Chop off binary name (i.e mysql-upgrade) from path */
|
||||||
|
dirname_part(path, path, &path_len);
|
||||||
|
|
||||||
|
/*
|
||||||
|
When running in a not yet installed build and using libtool,
|
||||||
|
the program(mysql_upgrade) will be in .libs/ and executed
|
||||||
|
through a libtool wrapper in order to use the dynamic libraries
|
||||||
|
from this build. The same must be done for the tools(mysql and
|
||||||
|
mysqlcheck). Thus if path ends in .libs/, step up one directory
|
||||||
|
and execute the tools from there
|
||||||
|
*/
|
||||||
|
path[max(path_len-1, 0)]= 0; /* Chop off last / */
|
||||||
|
if (strncmp(path + dirname_length(path), ".libs", 5) == 0)
|
||||||
{
|
{
|
||||||
size_t path_len;
|
DBUG_PRINT("info", ("Chopping off .libs from '%s'", path));
|
||||||
DBUG_PRINT("enter", ("path: %s", path));
|
|
||||||
|
|
||||||
/* Chop off last char(since it might be a /) */
|
/* Chop off .libs */
|
||||||
path[max((strlen(path)-1), 0)]= 0;
|
|
||||||
|
|
||||||
/* Chop off last dir part */
|
|
||||||
dirname_part(path, path, &path_len);
|
dirname_part(path, path, &path_len);
|
||||||
|
|
||||||
/* Format name of the tool to search for */
|
|
||||||
fn_format(tool_path, tool_name,
|
|
||||||
path, "", MYF(MY_REPLACE_DIR));
|
|
||||||
|
|
||||||
verbose("Looking for '%s' in: %s", tool_name, tool_path);
|
|
||||||
|
|
||||||
/* Make sure the tool exists */
|
|
||||||
if (my_access(tool_path, F_OK) != 0)
|
|
||||||
die("Can't find '%s'", tool_path);
|
|
||||||
|
|
||||||
/*
|
|
||||||
Make sure it can be executed, otherwise try again
|
|
||||||
in higher level directory
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
while(run_tool(tool_path,
|
|
||||||
&ds_tmp, /* Get output from command, discard*/
|
|
||||||
"--help",
|
DBUG_PRINT("info", ("path: '%s'", path));
|
||||||
"2>&1",
|
|
||||||
IF_WIN("> NUL", "> /dev/null"),
|
/* Format name of the tool to search for */
|
||||||
NULL));
|
fn_format(tool_path, tool_name,
|
||||||
|
path, "", MYF(MY_REPLACE_DIR));
|
||||||
|
|
||||||
|
verbose("Looking for '%s' in: %s", tool_name, tool_path);
|
||||||
|
|
||||||
|
/* Make sure the tool exists */
|
||||||
|
if (my_access(tool_path, F_OK) != 0)
|
||||||
|
die("Can't find '%s'", tool_path);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Make sure it can be executed
|
||||||
|
*/
|
||||||
|
if (run_tool(tool_path,
|
||||||
|
&ds_tmp, /* Get output from command, discard*/
|
||||||
|
"--help",
|
||||||
|
"2>&1",
|
||||||
|
IF_WIN("> NUL", "> /dev/null"),
|
||||||
|
NULL))
|
||||||
|
die("Can't execute '%s'", tool_path);
|
||||||
|
|
||||||
dynstr_free(&ds_tmp);
|
dynstr_free(&ds_tmp);
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
sub mtr_full_hostname ();
|
|
||||||
sub mtr_short_hostname ();
|
|
||||||
sub mtr_native_path($);
|
sub mtr_native_path($);
|
||||||
sub mtr_init_args ($);
|
sub mtr_init_args ($);
|
||||||
sub mtr_add_arg ($$@);
|
sub mtr_add_arg ($$@);
|
||||||
@ -40,30 +38,6 @@ sub mtr_cmp_opts($$);
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# We want the fully qualified host name and hostname() may have returned
|
|
||||||
# only the short name. So we use the resolver to find out.
|
|
||||||
# Note that this might fail on some platforms
|
|
||||||
|
|
||||||
sub mtr_full_hostname () {
|
|
||||||
|
|
||||||
my $hostname= hostname();
|
|
||||||
if ( $hostname !~ /\./ )
|
|
||||||
{
|
|
||||||
my $address= gethostbyname($hostname)
|
|
||||||
or mtr_error("Couldn't resolve $hostname : $!");
|
|
||||||
my $fullname= gethostbyaddr($address, AF_INET);
|
|
||||||
$hostname= $fullname if $fullname;
|
|
||||||
}
|
|
||||||
return $hostname;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub mtr_short_hostname () {
|
|
||||||
|
|
||||||
my $hostname= hostname();
|
|
||||||
$hostname =~ s/\..+$//;
|
|
||||||
return $hostname;
|
|
||||||
}
|
|
||||||
|
|
||||||
# Convert path to OS native format
|
# Convert path to OS native format
|
||||||
sub mtr_native_path($)
|
sub mtr_native_path($)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +61,6 @@ use File::Copy;
|
|||||||
use File::Temp qw /tempdir/;
|
use File::Temp qw /tempdir/;
|
||||||
use Cwd;
|
use Cwd;
|
||||||
use Getopt::Long;
|
use Getopt::Long;
|
||||||
use Sys::Hostname;
|
|
||||||
use IO::Socket;
|
use IO::Socket;
|
||||||
use IO::Socket::INET;
|
use IO::Socket::INET;
|
||||||
use strict;
|
use strict;
|
||||||
@ -100,7 +99,6 @@ $Devel::Trace::TRACE= 1;
|
|||||||
our $mysql_version_id;
|
our $mysql_version_id;
|
||||||
our $glob_mysql_test_dir= undef;
|
our $glob_mysql_test_dir= undef;
|
||||||
our $glob_mysql_bench_dir= undef;
|
our $glob_mysql_bench_dir= undef;
|
||||||
our $glob_hostname= undef;
|
|
||||||
our $glob_scriptname= undef;
|
our $glob_scriptname= undef;
|
||||||
our $glob_timers= undef;
|
our $glob_timers= undef;
|
||||||
our $glob_use_embedded_server= 0;
|
our $glob_use_embedded_server= 0;
|
||||||
@ -646,8 +644,6 @@ sub command_line_setup () {
|
|||||||
$source_dist= 1;
|
$source_dist= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
$glob_hostname= mtr_short_hostname();
|
|
||||||
|
|
||||||
# Find the absolute path to the test directory
|
# Find the absolute path to the test directory
|
||||||
$glob_mysql_test_dir= cwd();
|
$glob_mysql_test_dir= cwd();
|
||||||
if ( $glob_cygwin_perl )
|
if ( $glob_cygwin_perl )
|
||||||
@ -3086,11 +3082,15 @@ sub install_db ($$) {
|
|||||||
mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
|
mtr_appendfile_to_file("$path_sql_dir/fill_help_tables.sql",
|
||||||
$bootstrap_sql_file);
|
$bootstrap_sql_file);
|
||||||
|
|
||||||
|
mtr_tofile($bootstrap_sql_file,
|
||||||
|
"DELETE FROM mysql.user where user= '';");
|
||||||
|
|
||||||
# Log bootstrap command
|
# Log bootstrap command
|
||||||
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
|
my $path_bootstrap_log= "$opt_vardir/log/bootstrap.log";
|
||||||
mtr_tofile($path_bootstrap_log,
|
mtr_tofile($path_bootstrap_log,
|
||||||
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
|
"$exe_mysqld_bootstrap " . join(" ", @$args) . "\n");
|
||||||
|
|
||||||
|
|
||||||
if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
|
if ( mtr_run($exe_mysqld_bootstrap, $args, $bootstrap_sql_file,
|
||||||
$path_bootstrap_log, $path_bootstrap_log,
|
$path_bootstrap_log, $path_bootstrap_log,
|
||||||
"", { append_log_file => 1 }) != 0 )
|
"", { append_log_file => 1 }) != 0 )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user