summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2005-02-17 02:59:39 +0100
committerunknown <kent@mysql.com>2005-02-17 02:59:39 +0100
commit3f808996794b5ed83f646fd08946a5499bbb665c (patch)
treefb244a988170034eb7d7b6625ac8117dc299b90f /mysql-test/lib
parentbc22f79f12e74d8c8e9460f2b237c1310c6350ee (diff)
downloadmariadb-git-3f808996794b5ed83f646fd08946a5499bbb665c.tar.gz
Windows compatibility changes of the 'rpl_delete_all',
'ps_1general' and 'fulltext_cache' test cases. mysql-test/r/fulltext_cache.result: To pass on Windows, round to less digits mysql-test/t/fulltext_cache.test: To pass on Windows, round to less digits mysql-test/t/ps_1general.test: To pass on Windows, change \\ to / in result mysql-test/t/rpl_delete_all.test: To pass on Windows, change \\ to / in result mysql-test/mysql-test-run.pl: Pass mysqld --console to catch output on Windows mysql-test/lib/mtr_process.pl: Check error from exec() to avoid becoming a fork() bomb
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_process.pl33
1 files changed, 28 insertions, 5 deletions
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index e1461a9730c..8aefc235d72 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -123,6 +123,17 @@ sub spawn_impl ($$$$$$$) {
$SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't
+ if ( $::glob_cygwin_shell and $mode eq 'test' )
+ {
+ # Programs started from mysqltest under Cygwin, are to
+ # execute them within Cygwin. Else simple things in test
+ # files like
+ # --system "echo 1 > file"
+ # will fail.
+ # FIXME not working :-(
+# $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c";
+ }
+
if ( $output )
{
if ( ! open(STDOUT,">",$output) )
@@ -130,6 +141,7 @@ sub spawn_impl ($$$$$$$) {
mtr_error("can't redirect STDOUT to \"$output\": $!");
}
}
+
if ( $error )
{
if ( $output eq $error )
@@ -147,6 +159,7 @@ sub spawn_impl ($$$$$$$) {
}
}
}
+
if ( $input )
{
if ( ! open(STDIN,"<",$input) )
@@ -154,7 +167,11 @@ sub spawn_impl ($$$$$$$) {
mtr_error("can't redirect STDIN to \"$input\": $!");
}
}
- exec($path,@$arg_list_t);
+
+ if ( ! exec($path,@$arg_list_t) )
+ {
+ mtr_error("failed to execute \"$path\": $!");
+ }
}
}
}
@@ -569,7 +586,7 @@ sub mtr_stop_mysqld_servers ($) {
sub mtr_mysqladmin_shutdown () {
my $spec= shift;
- my @mysql_admin_pids;
+ my %mysql_admin_pids;
my @to_kill_specs;
foreach my $srv ( @$spec )
@@ -611,13 +628,19 @@ sub mtr_mysqladmin_shutdown () {
# We don't wait for termination of mysqladmin
my $pid= mtr_spawn($::exe_mysqladmin, $args,
"", $::path_manager_log, $::path_manager_log, "");
- push(@mysql_admin_pids, $pid);
+ $mysql_admin_pids{$pid}= 1;
}
# We wait blocking, we wait for the last one anyway
- foreach my $pid (@mysql_admin_pids)
+ while (keys %mysql_admin_pids)
{
- waitpid($pid,0); # FIXME no need to check -1 or 0?
+ foreach my $pid (keys %mysql_admin_pids)
+ {
+ if ( waitpid($pid,0) > 0 )
+ {
+ delete $mysql_admin_pids{$pid};
+ }
+ }
}
# If we trusted "mysqladmin --shutdown_timeout= ..." we could just