summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/mysqltest.cc13
-rwxr-xr-xmysql-test/mysql-test-run.pl8
2 files changed, 20 insertions, 1 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 89ba739a9ef..7d335b7d47a 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -3853,7 +3853,18 @@ void do_perl(struct st_command *command)
if (!error)
my_delete(temp_file_path, MYF(0));
- handle_command_error(command, WEXITSTATUS(error));
+ /* Check for error code that indicates perl could not be started */
+ int exstat= WEXITSTATUS(error);
+#ifdef __WIN__
+ if (exstat == 1)
+ /* Text must begin 'perl not found' as mtr looks for it */
+ abort_not_supported_test("perl not found in path or did not start");
+#else
+ if (exstat == 127)
+ abort_not_supported_test("perl not found in path");
+#endif
+ else
+ handle_command_error(command, exstat);
}
dynstr_free(&ds_delimiter);
DBUG_VOID_RETURN;
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index f0c7a02348a..b83c32d3815 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -2107,6 +2107,11 @@ sub environment_setup {
# to detect that valgrind is being used from test cases
$ENV{'VALGRIND_TEST'}= $opt_valgrind;
+ # Add dir of this perl to aid mysqltest in finding perl
+ my $perldir= dirname($^X);
+ my $pathsep= ":";
+ $pathsep= ";" if IS_WINDOWS && ! IS_CYGWIN;
+ $ENV{'PATH'}= "$ENV{'PATH'}".$pathsep.$perldir;
}
@@ -3583,6 +3588,9 @@ sub run_testcase ($) {
# Try to get reason from test log file
find_testcase_skipped_reason($tinfo);
mtr_report_test_skipped($tinfo);
+ # Restart if skipped due to missing perl, it may have had side effects
+ stop_all_servers($opt_shutdown_timeout)
+ if ($tinfo->{'comment'} =~ /^perl not found/);
}
elsif ( $res == 65 )
{