From 1901d1b5daac1def7a99e43717815bf7c45a2c6c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 15 Jun 2007 17:42:03 +0200 Subject: [PATCH] Bug#18415 known problem when mysql-test-run.pl run ActiveState perl for windows - Select STDOUT as default handle after having cloned the child - Disable check for "$error eq $output" to ptoperly redirect $error mysql-test/lib/mtr_process.pl: Restore output to STDOUT after forking the child Since STDOUT is not redirected disable to check to see if $output is equal to $error so STDERR is properly opened to $error --- mysql-test/lib/mtr_process.pl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index ac2e049a67c..2b6abcf004d 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -142,6 +142,7 @@ sub spawn_impl ($$$$$$$) { if ( $pid ) { + select(STDOUT) if $::glob_win32_perl; return spawn_parent_impl($pid,$mode,$path); } else @@ -163,9 +164,6 @@ sub spawn_impl ($$$$$$$) { { # Don't redirect stdout on ActiveState perl since this is # just another thread in the same process. - # Should be fixed so that the thread that is created with fork - # executes the exe in another process and wait's for it to return. - # In the meanwhile, we get all the output from mysqld's to screen } elsif ( ! open(STDOUT,$log_file_open_mode,$output) ) { @@ -175,7 +173,7 @@ sub spawn_impl ($$$$$$$) { if ( $error ) { - if ( $output eq $error ) + if ( !$::glob_win32_perl and $output eq $error ) { if ( ! open(STDERR,">&STDOUT") ) { @@ -184,15 +182,7 @@ sub spawn_impl ($$$$$$$) { } else { - if ( $::glob_win32_perl ) - { - # Don't redirect stdout on ActiveState perl since this is - # just another thread in the same process. - # Should be fixed so that the thread that is created with fork - # executes the exe in another process and wait's for it to return. - # In the meanwhile, we get all the output from mysqld's to screen - } - elsif ( ! open(STDERR,$log_file_open_mode,$error) ) + if ( ! open(STDERR,$log_file_open_mode,$error) ) { mtr_child_error("can't redirect STDERR to \"$error\": $!"); }