From b3273629e2752d0753c8228449953dd2390ee477 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Nov 2006 23:06:06 +0100 Subject: [PATCH 1/2] Move the check that $opt_vardir could be created and was writable to the function where we know how to creat the vardir Remove unused variable --- mysql-test/mysql-test-run.pl | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index c1b0c44a00c..0859b02167c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1883,7 +1883,6 @@ sub kill_running_servers () { } } - # # Remove var and any directories in var/ created by previous # tests @@ -1935,7 +1934,6 @@ sub remove_stale_vardir () { mtr_error("The destination for symlink $opt_vardir does not exist") if ! -d readlink($opt_vardir); - my $dir= shift; foreach my $bin ( glob("$opt_vardir/*") ) { mtr_verbose("Removing bin $bin"); @@ -1997,6 +1995,19 @@ sub setup_vardir() { } } + if ( ! -d $opt_vardir ) + { + mtr_verbose("Creating $opt_vardir"); + mkpath($opt_vardir); + } + + # Ensure a proper error message if vardir couldn't be created + unless ( -d $opt_vardir and -w $opt_vardir ) + { + mtr_error("Writable 'var' directory is needed, use the " . + "'--vardir=' option"); + } + mkpath("$opt_vardir/log"); mkpath("$opt_vardir/run"); mkpath("$opt_vardir/tmp"); From 7bc069d16452c1d2b22a41b5eab1ee0d72fc73d3 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 29 Nov 2006 22:49:02 +0100 Subject: [PATCH 2/2] After 5.1.6 just turn on logging, it will be sent to tables by default --- mysql-test/mysql-test-run.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 0859b02167c..0b630c1f722 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -3474,6 +3474,11 @@ sub mysqld_arguments ($$$$$) { # Force mysqld to use log files up until 5.1.6 mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); } + else + { + # Turn on logging, will be sent to tables + mtr_add_arg($args, "%s--log=", $prefix); + } } if ( $type eq 'slave' ) @@ -3557,6 +3562,11 @@ sub mysqld_arguments ($$$$$) { # Force mysqld to use log files up until 5.1.6 mtr_add_arg($args, "%s--log=%s", $prefix, $master->[0]->{'path_mylog'}); } + else + { + # Turn on logging, will be sent to tables + mtr_add_arg($args, "%s--log=", $prefix); + } } # end slave