summaryrefslogtreecommitdiff
path: root/mysql-test/mariadb-test-run.pl
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2022-12-20 13:37:32 +0200
committerSergei Petrunia <sergey@mariadb.com>2023-02-03 14:33:32 +0300
commit43dc42334de9b240506493044a0a54333c99d8db (patch)
tree60dbc228330aa6a3123948f98487513bea698096 /mysql-test/mariadb-test-run.pl
parente4fbec1463bdf71482a2c9cd2b69b1a10b3c52ec (diff)
downloadmariadb-git-43dc42334de9b240506493044a0a54333c99d8db.tar.gz
Fixed 'undefined variable' error in mtr
This could happen if mtr_grab_file() returned empty (happened to me)
Diffstat (limited to 'mysql-test/mariadb-test-run.pl')
-rwxr-xr-xmysql-test/mariadb-test-run.pl15
1 files changed, 9 insertions, 6 deletions
diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl
index b75278e9a6d..5ab50a4f88b 100755
--- a/mysql-test/mariadb-test-run.pl
+++ b/mysql-test/mariadb-test-run.pl
@@ -516,12 +516,15 @@ sub main {
if ( not @$completed ) {
my $test_name= mtr_grab_file($path_testlog);
- $test_name =~ s/^CURRENT_TEST:\s//;
- chomp($test_name);
- my $tinfo = My::Test->new(name => $test_name);
- $tinfo->{result}= 'MTR_RES_FAILED';
- $tinfo->{comment}=' ';
- mtr_report_test($tinfo);
+ if (defined($test_name))
+ {
+ $test_name =~ s/^CURRENT_TEST:\s//;
+ chomp($test_name);
+ my $tinfo = My::Test->new(name => $test_name);
+ $tinfo->{result}= 'MTR_RES_FAILED';
+ $tinfo->{comment}=' ';
+ mtr_report_test($tinfo);
+ }
mtr_error("Test suite aborted");
}