From df7b349f328bbf43258d28defb7fa05a602d7932 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Wed, 30 Apr 2008 15:52:50 +0200 Subject: [PATCH 1/3] Remove hack for mtr.pl in MySQL 4.1 --- mysql-test/mysql-test-run.pl | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0988905b44f..07362c65921 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -573,21 +573,6 @@ sub command_line_setup { { $opt_vardir= $default_vardir; } - elsif ( $mysql_version_id < 50000 and - $opt_vardir ne $default_vardir) - { - # Version 4.1 and --vardir was specified - # Only supported as a symlink from var/ - # by setting up $opt_mem that symlink will be created - if ( ! IS_WINDOWS ) - { - # Only platforms that have native symlinks can use the vardir trick - $opt_mem= $opt_vardir; - mtr_report("Using 4.1 vardir trick"); - } - - $opt_vardir= $default_vardir; - } $path_vardir_trace= $opt_vardir; # Chop off any "c:", DBUG likes a unix path ex: c:/src/... => /src/... From 3e18c89fdb4c2d51eaf245c4569ede1debe842de Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.mysql.com" <> Date: Thu, 1 May 2008 09:34:25 +0200 Subject: [PATCH 2/3] Use the deignated tmpdir if it exists --- mysql-test/mysql-test-run.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 07362c65921..6d1e9a82926 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -773,7 +773,13 @@ sub set_mtr_build_thread_ports($) { sub collect_mysqld_features { 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 @@ -3566,7 +3572,7 @@ sub gdb_arguments { # Write $args to gdb init file 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 unlink($gdb_init_file); @@ -3630,7 +3636,7 @@ sub ddd_arguments { # Write $args to ddd init file 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 unlink($gdb_init_file); From 447916b9e6e29cb2c97be4280c98e12b242d0136 Mon Sep 17 00:00:00 2001 From: "msvensson@pilot.(none)" <> Date: Fri, 9 May 2008 11:50:36 +0200 Subject: [PATCH 3/3] Make printout of $name nicer Remove debug printouts --- mysql-test/lib/mtr_report.pm | 19 +++++++++++-------- mysql-test/mysql-test-run.pl | 21 ++++++++++----------- 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 1a8a5e3e0ec..b5c868cb20a 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -52,6 +52,9 @@ sub report_option { #print $name, " setting $opt to ", (defined $value? $value : "undef") ,"\n"; } +sub _name { + return $name ? $name." " : undef; +} sub _mtr_report_test_name ($) { my $tinfo= shift; @@ -63,7 +66,7 @@ sub _mtr_report_test_name ($) { $tname.= " '$tinfo->{combination}'" if defined $tinfo->{combination}; - print $name, _timestamp(); + print _name(), _timestamp(); printf "%-40s ", $tname; } @@ -388,7 +391,7 @@ sub _timestamp { # Always print message to screen sub mtr_print (@) { - print $name, join(" ", @_), "\n"; + print _name(), join(" ", @_), "\n"; } @@ -396,21 +399,21 @@ sub mtr_print (@) { sub mtr_report (@) { if (defined $verbose) { - print $name, join(" ", @_), "\n"; + print _name(), join(" ", @_), "\n"; } } # Print warning to screen sub mtr_warning (@) { - print STDERR $name, _timestamp(), + print STDERR _name(), _timestamp(), "mysql-test-run: WARNING: ", join(" ", @_), "\n"; } # Print error to screen and then exit sub mtr_error (@) { - print STDERR $name, _timestamp(), + print STDERR _name(), _timestamp(), "mysql-test-run: *** ERROR: ", join(" ", @_), "\n"; exit(1); } @@ -419,7 +422,7 @@ sub mtr_error (@) { sub mtr_debug (@) { if ( $verbose > 2 ) { - print STDERR $name, + print STDERR _name(), _timestamp(), "####: ", join(" ", @_), "\n"; } } @@ -428,7 +431,7 @@ sub mtr_debug (@) { sub mtr_verbose (@) { if ( $verbose ) { - print STDERR $name, _timestamp(), + print STDERR _name(), _timestamp(), "> ",join(" ", @_),"\n"; } } @@ -439,7 +442,7 @@ sub mtr_verbose_restart (@) { my $proc= $server->{proc}; if ( $verbose_restart ) { - print STDERR $name,_timestamp(), + print STDERR _name(),_timestamp(), "> Restart $proc - ",join(" ", @args),"\n"; } } diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index d3febb6a5c1..adf207d6473 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -220,7 +220,6 @@ sub main { if ( not defined $opt_parallel ) { # Try to find a suitable value for number of workers my $sys_info= My::SysInfo->new(); - $sys_info->print_info(); $opt_parallel= $sys_info->num_cpus(); for my $limit (2000, 1500, 1000, 500){ @@ -2828,15 +2827,15 @@ sub run_testcase ($) { # ---------------------------------------------------------------------- if ( $opt_start or $opt_start_dirty ) { - mtr_report("\nStarted", started(all_servers())); - mtr_report("Waiting for server(s) to exit..."); + mtr_print("\nStarted", started(all_servers())); + mtr_print("Waiting for server(s) to exit..."); my $proc= My::SafeProcess->wait_any(); if ( grep($proc eq $_, started(all_servers())) ) { - mtr_report("Server $proc died"); + mtr_print("Server $proc died"); exit(1); } - mtr_report("Unknown process $proc died"); + mtr_print("Unknown process $proc died"); exit(1); } @@ -3163,7 +3162,7 @@ sub check_expected_crash_and_restart { # Remove all files and subdirectories of a directory sub clean_dir { my ($dir)= @_; - mtr_print("clean_dir: $dir"); + mtr_verbose("clean_dir: $dir"); finddepth( { no_chdir => 1, wanted => sub { @@ -3173,12 +3172,12 @@ sub clean_dir { # The dir to clean return; } else { - mtr_print("rmdir: '$_'"); + mtr_verbose("rmdir: '$_'"); rmdir($_) or mtr_warning("rmdir($_) failed: $!"); } } else { # Hopefully a file - mtr_print("unlink: '$_'"); + mtr_verbose("unlink: '$_'"); unlink($_) or mtr_warning("unlink($_) failed: $!"); } } @@ -3198,7 +3197,7 @@ sub clean_datadir { foreach my $cluster ( clusters() ) { my $cluster_dir= "$opt_vardir/".$cluster->{name}; - mtr_print(" - removing '$cluster_dir'"); + mtr_verbose(" - removing '$cluster_dir'"); rmtree($cluster_dir); } @@ -3207,7 +3206,7 @@ sub clean_datadir { { my $mysqld_dir= dirname($mysqld->value('datadir')); if (-d $mysqld_dir ) { - mtr_print(" - removing '$mysqld_dir'"); + mtr_verbose(" - removing '$mysqld_dir'"); rmtree($mysqld_dir); } } @@ -3512,7 +3511,7 @@ sub mysqld_start ($$) { sub stop_all_servers () { - mtr_print("Stopping all servers..."); + mtr_verbose("Stopping all servers..."); # Kill all started servers My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill