Commit 8fdcff95 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.1-maint2

into  pilot.(none):/data/msvensson/mysql/mysql-5.1-maint2


mysql-test/mysql-test-run.pl:
  Auto merged
parents 60798296 17801e4b
...@@ -52,6 +52,9 @@ sub report_option { ...@@ -52,6 +52,9 @@ sub report_option {
#print $name, " setting $opt to ", (defined $value? $value : "undef") ,"\n"; #print $name, " setting $opt to ", (defined $value? $value : "undef") ,"\n";
} }
sub _name {
return $name ? $name." " : undef;
}
sub _mtr_report_test_name ($) { sub _mtr_report_test_name ($) {
my $tinfo= shift; my $tinfo= shift;
...@@ -63,7 +66,7 @@ sub _mtr_report_test_name ($) { ...@@ -63,7 +66,7 @@ sub _mtr_report_test_name ($) {
$tname.= " '$tinfo->{combination}'" $tname.= " '$tinfo->{combination}'"
if defined $tinfo->{combination}; if defined $tinfo->{combination};
print $name, _timestamp(); print _name(), _timestamp();
printf "%-40s ", $tname; printf "%-40s ", $tname;
} }
...@@ -388,7 +391,7 @@ sub _timestamp { ...@@ -388,7 +391,7 @@ sub _timestamp {
# Always print message to screen # Always print message to screen
sub mtr_print (@) { sub mtr_print (@) {
print $name, join(" ", @_), "\n"; print _name(), join(" ", @_), "\n";
} }
...@@ -396,21 +399,21 @@ sub mtr_print (@) { ...@@ -396,21 +399,21 @@ sub mtr_print (@) {
sub mtr_report (@) { sub mtr_report (@) {
if (defined $verbose) if (defined $verbose)
{ {
print $name, join(" ", @_), "\n"; print _name(), join(" ", @_), "\n";
} }
} }
# Print warning to screen # Print warning to screen
sub mtr_warning (@) { sub mtr_warning (@) {
print STDERR $name, _timestamp(), print STDERR _name(), _timestamp(),
"mysql-test-run: WARNING: ", join(" ", @_), "\n"; "mysql-test-run: WARNING: ", join(" ", @_), "\n";
} }
# Print error to screen and then exit # Print error to screen and then exit
sub mtr_error (@) { sub mtr_error (@) {
print STDERR $name, _timestamp(), print STDERR _name(), _timestamp(),
"mysql-test-run: *** ERROR: ", join(" ", @_), "\n"; "mysql-test-run: *** ERROR: ", join(" ", @_), "\n";
exit(1); exit(1);
} }
...@@ -419,7 +422,7 @@ sub mtr_error (@) { ...@@ -419,7 +422,7 @@ sub mtr_error (@) {
sub mtr_debug (@) { sub mtr_debug (@) {
if ( $verbose > 2 ) if ( $verbose > 2 )
{ {
print STDERR $name, print STDERR _name(),
_timestamp(), "####: ", join(" ", @_), "\n"; _timestamp(), "####: ", join(" ", @_), "\n";
} }
} }
...@@ -428,7 +431,7 @@ sub mtr_debug (@) { ...@@ -428,7 +431,7 @@ sub mtr_debug (@) {
sub mtr_verbose (@) { sub mtr_verbose (@) {
if ( $verbose ) if ( $verbose )
{ {
print STDERR $name, _timestamp(), print STDERR _name(), _timestamp(),
"> ",join(" ", @_),"\n"; "> ",join(" ", @_),"\n";
} }
} }
...@@ -439,7 +442,7 @@ sub mtr_verbose_restart (@) { ...@@ -439,7 +442,7 @@ sub mtr_verbose_restart (@) {
my $proc= $server->{proc}; my $proc= $server->{proc};
if ( $verbose_restart ) if ( $verbose_restart )
{ {
print STDERR $name,_timestamp(), print STDERR _name(),_timestamp(),
"> Restart $proc - ",join(" ", @args),"\n"; "> Restart $proc - ",join(" ", @args),"\n";
} }
} }
......
...@@ -220,7 +220,6 @@ sub main { ...@@ -220,7 +220,6 @@ sub main {
if ( not defined $opt_parallel ) { if ( not defined $opt_parallel ) {
# Try to find a suitable value for number of workers # Try to find a suitable value for number of workers
my $sys_info= My::SysInfo->new(); my $sys_info= My::SysInfo->new();
$sys_info->print_info();
$opt_parallel= $sys_info->num_cpus(); $opt_parallel= $sys_info->num_cpus();
for my $limit (2000, 1500, 1000, 500){ for my $limit (2000, 1500, 1000, 500){
...@@ -1197,7 +1196,13 @@ sub set_build_thread_ports($) { ...@@ -1197,7 +1196,13 @@ sub set_build_thread_ports($) {
sub collect_mysqld_features { sub collect_mysqld_features {
my $found_variable_list_start= 0; my $found_variable_list_start= 0;
my $tmpdir= tempdir(CLEANUP => 0); # Directory removed by this function my $use_tmpdir;
if ( defined $opt_tmpdir and -d $opt_tmpdir){
# Create the tempdir in $opt_tmpdir
$use_tmpdir= $opt_tmpdir;
}
my $tmpdir= tempdir(CLEANUP => 0, # Directory removed by this function
DIR => $use_tmpdir);
# #
# Execute "mysqld --no-defaults --help --verbose" to get a # Execute "mysqld --no-defaults --help --verbose" to get a
...@@ -2828,15 +2833,15 @@ sub run_testcase ($) { ...@@ -2828,15 +2833,15 @@ sub run_testcase ($) {
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
if ( $opt_start or $opt_start_dirty ) if ( $opt_start or $opt_start_dirty )
{ {
mtr_report("\nStarted", started(all_servers())); mtr_print("\nStarted", started(all_servers()));
mtr_report("Waiting for server(s) to exit..."); mtr_print("Waiting for server(s) to exit...");
my $proc= My::SafeProcess->wait_any(); my $proc= My::SafeProcess->wait_any();
if ( grep($proc eq $_, started(all_servers())) ) if ( grep($proc eq $_, started(all_servers())) )
{ {
mtr_report("Server $proc died"); mtr_print("Server $proc died");
exit(1); exit(1);
} }
mtr_report("Unknown process $proc died"); mtr_print("Unknown process $proc died");
exit(1); exit(1);
} }
...@@ -3163,7 +3168,7 @@ sub check_expected_crash_and_restart { ...@@ -3163,7 +3168,7 @@ sub check_expected_crash_and_restart {
# Remove all files and subdirectories of a directory # Remove all files and subdirectories of a directory
sub clean_dir { sub clean_dir {
my ($dir)= @_; my ($dir)= @_;
mtr_print("clean_dir: $dir"); mtr_verbose("clean_dir: $dir");
finddepth( finddepth(
{ no_chdir => 1, { no_chdir => 1,
wanted => sub { wanted => sub {
...@@ -3173,12 +3178,12 @@ sub clean_dir { ...@@ -3173,12 +3178,12 @@ sub clean_dir {
# The dir to clean # The dir to clean
return; return;
} else { } else {
mtr_print("rmdir: '$_'"); mtr_verbose("rmdir: '$_'");
rmdir($_) or mtr_warning("rmdir($_) failed: $!"); rmdir($_) or mtr_warning("rmdir($_) failed: $!");
} }
} else { } else {
# Hopefully a file # Hopefully a file
mtr_print("unlink: '$_'"); mtr_verbose("unlink: '$_'");
unlink($_) or mtr_warning("unlink($_) failed: $!"); unlink($_) or mtr_warning("unlink($_) failed: $!");
} }
} }
...@@ -3198,7 +3203,7 @@ sub clean_datadir { ...@@ -3198,7 +3203,7 @@ sub clean_datadir {
foreach my $cluster ( clusters() ) foreach my $cluster ( clusters() )
{ {
my $cluster_dir= "$opt_vardir/".$cluster->{name}; my $cluster_dir= "$opt_vardir/".$cluster->{name};
mtr_print(" - removing '$cluster_dir'"); mtr_verbose(" - removing '$cluster_dir'");
rmtree($cluster_dir); rmtree($cluster_dir);
} }
...@@ -3207,7 +3212,7 @@ sub clean_datadir { ...@@ -3207,7 +3212,7 @@ sub clean_datadir {
{ {
my $mysqld_dir= dirname($mysqld->value('datadir')); my $mysqld_dir= dirname($mysqld->value('datadir'));
if (-d $mysqld_dir ) { if (-d $mysqld_dir ) {
mtr_print(" - removing '$mysqld_dir'"); mtr_verbose(" - removing '$mysqld_dir'");
rmtree($mysqld_dir); rmtree($mysqld_dir);
} }
} }
...@@ -3512,7 +3517,7 @@ sub mysqld_start ($$) { ...@@ -3512,7 +3517,7 @@ sub mysqld_start ($$) {
sub stop_all_servers () { sub stop_all_servers () {
mtr_print("Stopping all servers..."); mtr_verbose("Stopping all servers...");
# Kill all started servers # Kill all started servers
My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill
...@@ -4091,7 +4096,7 @@ sub gdb_arguments { ...@@ -4091,7 +4096,7 @@ sub gdb_arguments {
# Write $args to gdb init file # Write $args to gdb init file
my $str= join(" ", @$$args); my $str= join(" ", @$$args);
my $gdb_init_file= "$opt_tmpdir/gdbinit.$type"; my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file # Remove the old gdbinit file
unlink($gdb_init_file); unlink($gdb_init_file);
...@@ -4155,7 +4160,7 @@ sub ddd_arguments { ...@@ -4155,7 +4160,7 @@ sub ddd_arguments {
# Write $args to ddd init file # Write $args to ddd init file
my $str= join(" ", @$$args); my $str= join(" ", @$$args);
my $gdb_init_file= "$opt_tmpdir/gdbinit.$type"; my $gdb_init_file= "$opt_vardir/tmp/gdbinit.$type";
# Remove the old gdbinit file # Remove the old gdbinit file
unlink($gdb_init_file); unlink($gdb_init_file);
......
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