From 588efe1216f60bb2c491a7077f0162d9a1abff45 Mon Sep 17 00:00:00 2001 From: Magnus Svensson Date: Mon, 15 Sep 2008 17:05:14 +0200 Subject: [PATCH] WL#4189 Create a tempdir if tmpdir path becomes too long --- mysql-test/mysql-test-run.pl | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index ce4f9bda6c2..cd1007e24dc 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -1024,7 +1024,20 @@ sub command_line_setup { # -------------------------------------------------------------------------- # Set the "tmp" directory # -------------------------------------------------------------------------- - $opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir; + if ( ! $opt_tmpdir ) + { + $opt_tmpdir= "$opt_vardir/tmp" unless $opt_tmpdir; + + if (check_socket_path_length("$opt_tmpdir/testsocket.sock")) + { + mtr_report("Too long tmpdir path '$opt_tmpdir'", + " creating a shorter one..."); + + # Create temporary directory in standard location for temporary files + $opt_tmpdir= tempdir( TMPDIR => 1, CLEANUP => 1 ); + mtr_report(" - using tmpdir: '$opt_tmpdir'\n"); + } + } $opt_tmpdir =~ s,/+$,,; # Remove ending slash if any # --------------------------------------------------------------------------