diff options
author | unknown <msvensson@neptunus.(none)> | 2007-02-16 15:19:38 +0100 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2007-02-16 15:19:38 +0100 |
commit | 0a97f7bad39c00c268b94e25d3877e019ef06f99 (patch) | |
tree | fc724091b55b15d153b7c8e6b6c198501b0f89e9 /mysql-test | |
parent | d07c3efc49569e4d672bae00df8a23d83b33d3d2 (diff) | |
download | mariadb-git-0a97f7bad39c00c268b94e25d3877e019ef06f99.tar.gz |
Workaround for problem where cygwin's bash/sh randomly fails with error 128 which
mainly occurs on win2003 64bit.
- Execute "exec" commands directly with cmd.exe and replace "--exec echo ..." with "--exec .\echo.exe ..."
client/mysqltest.c:
Workaround the problem with "echo" in windows not behaving like "echo" in Unix.
- Replace "--exec echo ..." with "--exec <path to mysqltest>\echo.exe" thus forcing
use of our own echo implementation which baheves like on Unix.
- The above change makes it possible to remove the need to execute all --exec's
inside cygwin. Add ifdefs to only use use cygwin's bash conditionally
mysql-test/lib/mtr_misc.pl:
Add function for converting to the OS's native format
mysql-test/mysql-test-run.pl:
Convert path to executables to "windows native" (c:\<path>\) instead of "mixed"(c:/<path>) mode
necessary for pipes and redirects to work properly in cmd.exe
client/echo.c:
New BitKeeper file ``client/echo.c''
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/lib/mtr_misc.pl | 11 | ||||
-rwxr-xr-x | mysql-test/mysql-test-run.pl | 34 |
2 files changed, 32 insertions, 13 deletions
diff --git a/mysql-test/lib/mtr_misc.pl b/mysql-test/lib/mtr_misc.pl index c016f3dc34f..880368be170 100644 --- a/mysql-test/lib/mtr_misc.pl +++ b/mysql-test/lib/mtr_misc.pl @@ -8,6 +8,7 @@ use strict; sub mtr_full_hostname (); sub mtr_short_hostname (); +sub mtr_native_path($); sub mtr_init_args ($); sub mtr_add_arg ($$@); sub mtr_path_exists(@); @@ -49,6 +50,16 @@ sub mtr_short_hostname () { return $hostname; } +# Convert path to OS native format +sub mtr_native_path($) +{ + my $path= shift; + $path=~ s/\//\\/g + if ($::glob_win32); + return $path; +} + + # FIXME move to own lib sub mtr_init_args ($) { diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index f53b470aaf4..fc0ad54c095 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -347,6 +347,7 @@ sub stop_all_servers (); sub run_mysqltest ($); sub usage ($); + ###################################################################### # # Main program @@ -1518,7 +1519,8 @@ sub executable_setup () { sub generate_cmdline_mysqldump ($) { my($mysqld) = @_; return - "$exe_mysqldump --no-defaults -uroot " . + mtr_native_path($exe_mysqldump) . + " --no-defaults -uroot " . "--port=$mysqld->{'port'} " . "--socket=$mysqld->{'path_sock'} --password="; } @@ -1721,9 +1723,10 @@ sub environment_setup () { # Setup env so childs can execute mysqlcheck # ---------------------------------------------------- my $cmdline_mysqlcheck= - "$exe_mysqlcheck --no-defaults -uroot " . - "--port=$master->[0]->{'port'} " . - "--socket=$master->[0]->{'path_sock'} --password="; + mtr_native_path($exe_mysqlcheck) . + " --no-defaults -uroot " . + "--port=$master->[0]->{'port'} " . + "--socket=$master->[0]->{'path_sock'} --password="; if ( $opt_debug ) { @@ -1755,7 +1758,8 @@ sub environment_setup () { if ( $exe_mysqlslap ) { my $cmdline_mysqlslap= - "$exe_mysqlslap -uroot " . + mtr_native_path($exe_mysqlslap) . + " -uroot " . "--port=$master->[0]->{'port'} " . "--socket=$master->[0]->{'path_sock'} --password= " . "--lock-directory=$opt_tmpdir"; @@ -1772,7 +1776,8 @@ sub environment_setup () { # Setup env so childs can execute mysqlimport # ---------------------------------------------------- my $cmdline_mysqlimport= - "$exe_mysqlimport -uroot " . + mtr_native_path($exe_mysqlimport) . + " -uroot " . "--port=$master->[0]->{'port'} " . "--socket=$master->[0]->{'path_sock'} --password="; @@ -1788,7 +1793,8 @@ sub environment_setup () { # Setup env so childs can execute mysqlshow # ---------------------------------------------------- my $cmdline_mysqlshow= - "$exe_mysqlshow -uroot " . + mtr_native_path($exe_mysqlshow) . + " -uroot " . "--port=$master->[0]->{'port'} " . "--socket=$master->[0]->{'path_sock'} --password="; @@ -1803,7 +1809,7 @@ sub environment_setup () { # Setup env so childs can execute mysqlbinlog # ---------------------------------------------------- my $cmdline_mysqlbinlog= - "$exe_mysqlbinlog" . + mtr_native_path($exe_mysqlbinlog) . " --no-defaults --local-load=$opt_tmpdir"; if ( $mysql_version_id >= 50000 ) { @@ -1821,7 +1827,8 @@ sub environment_setup () { # Setup env so childs can execute mysql # ---------------------------------------------------- my $cmdline_mysql= - "$exe_mysql --no-defaults --host=localhost --user=root --password= " . + mtr_native_path($exe_mysql) . + " --no-defaults --host=localhost --user=root --password= " . "--port=$master->[0]->{'port'} " . "--socket=$master->[0]->{'path_sock'} ". "--character-sets-dir=$path_charsetsdir"; @@ -1850,17 +1857,17 @@ sub environment_setup () { # ---------------------------------------------------- # Setup env so childs can execute my_print_defaults # ---------------------------------------------------- - $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= $exe_my_print_defaults; + $ENV{'MYSQL_MY_PRINT_DEFAULTS'}= mtr_native_path($exe_my_print_defaults); # ---------------------------------------------------- # Setup env so childs can execute mysqladmin # ---------------------------------------------------- - $ENV{'MYSQLADMIN'}= $exe_mysqladmin; + $ENV{'MYSQLADMIN'}= mtr_native_path($exe_mysqladmin); # ---------------------------------------------------- # Setup env so childs can execute perror # ---------------------------------------------------- - $ENV{'MY_PERROR'}= $exe_perror; + $ENV{'MY_PERROR'}= mtr_native_path($exe_perror); # ---------------------------------------------------- # Add the path where mysqld will find udf_example.so @@ -4516,7 +4523,8 @@ sub run_mysqltest ($) { # ---------------------------------------------------------------------- # export MYSQL_TEST variable containing <path>/mysqltest <args> # ---------------------------------------------------------------------- - $ENV{'MYSQL_TEST'}= "$exe_mysqltest " . join(" ", @$args); + $ENV{'MYSQL_TEST'}= + mtr_native_path($exe_mysqltest) . " " . join(" ", @$args); # ---------------------------------------------------------------------- # Add arguments that should not go into the MYSQL_TEST env var |