From e789cdaa9d091ae92a074ec3e846ca7477c28a6a Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Nov 2006 22:16:31 +0100 Subject: [PATCH 1/3] Bug#24335 mysql-test-run.pl fails with ActiveState Perl on Windows - Avoid use of mtr_run when executing "mysqld --verbose --help" to find version and supported features mysql-test/mysql-test-run.pl: Don't use mtr_run when executing "mysqld --verbose --help" to find version and supported features. --- mysql-test/mysql-test-run.pl | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 3aabf9ab742..c1b0c44a00c 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1216,26 +1216,15 @@ sub datadir_list_setup () { sub collect_mysqld_features () { - # - # Execute "mysqld --no-defaults --help --verbose", that will - # print out version and a list of all features and settings - # my $found_variable_list_start= 0; - my $spec_file= "$glob_mysql_test_dir/mysqld.spec.$$"; - if ( mtr_run($exe_mysqld, - ["--no-defaults", - "--verbose", - "--help"], - "", "$spec_file", "$spec_file", "") != 0 ) - { - mtr_error("Failed to get version and list of features from %s", - $exe_mysqld); - } - my $F= IO::File->new($spec_file) or - mtr_error("can't open file \"$spec_file\": $!"); + # + # Execute "mysqld --no-defaults --help --verbose" to get a + # of all features and settings + # + my $list= `$exe_mysqld --no-defaults --verbose --help`; - while ( my $line= <$F> ) + foreach my $line (split('\n', $list)) { # First look for version if ( !$mysql_version_id ) @@ -1288,7 +1277,7 @@ sub collect_mysqld_features () { } } } - unlink($spec_file); + mtr_error("Could not find version of MySQL") unless $mysql_version_id; mtr_error("Could not find variabes list") unless $found_variable_list_start; From b3273629e2752d0753c8228449953dd2390ee477 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Nov 2006 23:06:06 +0100 Subject: [PATCH 2/3] 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 3cd30397a1392a29aa910431f0c26e351de1fde3 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 28 Nov 2006 23:09:17 +0100 Subject: [PATCH 3/3] Remove the moved check a second time. mysql-test/mysql-test-run.pl: Remove the moved check --- mysql-test/mysql-test-run.pl | 7 ------- 1 file changed, 7 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 963aae85a59..80a444acb27 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -813,13 +813,6 @@ sub command_line_setup () { $opt_vardir= "$glob_mysql_test_dir/$opt_vardir"; } - # Ensure a proper error message - mkpath("$opt_vardir"); - unless ( -d $opt_vardir and -w $opt_vardir ) - { - mtr_error("Writable 'var' directory is needed, use the '--vardir' option"); - } - # -------------------------------------------------------------------------- # Set tmpdir # --------------------------------------------------------------------------