From c21bc17a51f6eef6158ef80e7deeb5a280598c1d Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 20 Apr 2023 10:13:12 +1000 Subject: [PATCH] MDEV-30186: mtr: Use of uninitialized value $test_name in substitution There is an assumption that when there are are no completed tests, that means they are still running and then an attempt is made to identify these tests as stalled. The other possibility is however there are no tests that where run. Test this early and then exit quickly and no later misunderstandings need to be made. --- mysql-test/mariadb-test-run.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mysql-test/mariadb-test-run.pl b/mysql-test/mariadb-test-run.pl index 46a51d2fa58..4fc4d9f050e 100755 --- a/mysql-test/mariadb-test-run.pl +++ b/mysql-test/mariadb-test-run.pl @@ -401,6 +401,11 @@ sub main { mtr_report("Collecting tests..."); my $tests= collect_test_cases($opt_reorder, $opt_suites, \@opt_cases, \@opt_skip_test_list); + if (@$tests == 0) { + mtr_report("No tests to run..."); + exit 0; + } + mark_time_used('collect'); mysql_install_db(default_mysqld(), "$opt_vardir/install.db") unless using_extern();