diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 4f1269cb351..70b7854c1a9 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -2129,6 +2129,16 @@ sub remove_stale_vardir () { mtr_verbose("Removing $opt_vardir/"); rmtree("$opt_vardir/"); } + + if ( $opt_mem ) + { + # A symlink from var/ to $opt_mem will be set up + # remove the $opt_mem dir to assure the symlink + # won't point at an old directory + mtr_verbose("Removing $opt_mem"); + rmtree($opt_mem); + } + } else {