Skip to content

Commit 43dc423

Browse files
montywispetrunia
authored andcommitted
Fixed 'undefined variable' error in mtr
This could happen if mtr_grab_file() returned empty (happened to me)
1 parent e4fbec1 commit 43dc423

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

mysql-test/mariadb-test-run.pl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,12 +516,15 @@ sub main {
516516

517517
if ( not @$completed ) {
518518
my $test_name= mtr_grab_file($path_testlog);
519-
$test_name =~ s/^CURRENT_TEST:\s//;
520-
chomp($test_name);
521-
my $tinfo = My::Test->new(name => $test_name);
522-
$tinfo->{result}= 'MTR_RES_FAILED';
523-
$tinfo->{comment}=' ';
524-
mtr_report_test($tinfo);
519+
if (defined($test_name))
520+
{
521+
$test_name =~ s/^CURRENT_TEST:\s//;
522+
chomp($test_name);
523+
my $tinfo = My::Test->new(name => $test_name);
524+
$tinfo->{result}= 'MTR_RES_FAILED';
525+
$tinfo->{comment}=' ';
526+
mtr_report_test($tinfo);
527+
}
525528
mtr_error("Test suite aborted");
526529
}
527530

0 commit comments

Comments
 (0)