Commit 3f808996 authored by unknown's avatar unknown

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
parent bc22f79f
...@@ -123,6 +123,17 @@ sub spawn_impl ($$$$$$$) { ...@@ -123,6 +123,17 @@ sub spawn_impl ($$$$$$$) {
$SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't $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 ( $output )
{ {
if ( ! open(STDOUT,">",$output) ) if ( ! open(STDOUT,">",$output) )
...@@ -130,6 +141,7 @@ sub spawn_impl ($$$$$$$) { ...@@ -130,6 +141,7 @@ sub spawn_impl ($$$$$$$) {
mtr_error("can't redirect STDOUT to \"$output\": $!"); mtr_error("can't redirect STDOUT to \"$output\": $!");
} }
} }
if ( $error ) if ( $error )
{ {
if ( $output eq $error ) if ( $output eq $error )
...@@ -147,6 +159,7 @@ sub spawn_impl ($$$$$$$) { ...@@ -147,6 +159,7 @@ sub spawn_impl ($$$$$$$) {
} }
} }
} }
if ( $input ) if ( $input )
{ {
if ( ! open(STDIN,"<",$input) ) if ( ! open(STDIN,"<",$input) )
...@@ -154,7 +167,11 @@ sub spawn_impl ($$$$$$$) { ...@@ -154,7 +167,11 @@ sub spawn_impl ($$$$$$$) {
mtr_error("can't redirect STDIN to \"$input\": $!"); 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 ($) { ...@@ -569,7 +586,7 @@ sub mtr_stop_mysqld_servers ($) {
sub mtr_mysqladmin_shutdown () { sub mtr_mysqladmin_shutdown () {
my $spec= shift; my $spec= shift;
my @mysql_admin_pids; my %mysql_admin_pids;
my @to_kill_specs; my @to_kill_specs;
foreach my $srv ( @$spec ) foreach my $srv ( @$spec )
...@@ -611,13 +628,19 @@ sub mtr_mysqladmin_shutdown () { ...@@ -611,13 +628,19 @@ sub mtr_mysqladmin_shutdown () {
# We don't wait for termination of mysqladmin # We don't wait for termination of mysqladmin
my $pid= mtr_spawn($::exe_mysqladmin, $args, my $pid= mtr_spawn($::exe_mysqladmin, $args,
"", $::path_manager_log, $::path_manager_log, ""); "", $::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 # We wait blocking, we wait for the last one anyway
foreach my $pid (@mysql_admin_pids) while (keys %mysql_admin_pids)
{
foreach my $pid (keys %mysql_admin_pids)
{ {
waitpid($pid,0); # FIXME no need to check -1 or 0? if ( waitpid($pid,0) > 0 )
{
delete $mysql_admin_pids{$pid};
}
}
} }
# If we trusted "mysqladmin --shutdown_timeout= ..." we could just # If we trusted "mysqladmin --shutdown_timeout= ..." we could just
......
...@@ -1261,6 +1261,7 @@ sub install_db ($$) { ...@@ -1261,6 +1261,7 @@ sub install_db ($$) {
mtr_add_arg($args, "--no-defaults"); mtr_add_arg($args, "--no-defaults");
mtr_add_arg($args, "--bootstrap"); mtr_add_arg($args, "--bootstrap");
mtr_add_arg($args, "--console");
mtr_add_arg($args, "--skip-grant-tables"); mtr_add_arg($args, "--skip-grant-tables");
mtr_add_arg($args, "--basedir=%s", $path_my_basedir); mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
mtr_add_arg($args, "--datadir=%s", $data_dir); mtr_add_arg($args, "--datadir=%s", $data_dir);
...@@ -1604,6 +1605,7 @@ sub mysqld_arguments ($$$$$) { ...@@ -1604,6 +1605,7 @@ sub mysqld_arguments ($$$$$) {
mtr_add_arg($args, "%s--no-defaults", $prefix); mtr_add_arg($args, "%s--no-defaults", $prefix);
} }
mtr_add_arg($args, "%s--console", $prefix);
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir); mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir); mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
mtr_add_arg($args, "%s--core", $prefix); mtr_add_arg($args, "%s--core", $prefix);
......
...@@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka'); ...@@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka');
INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (7,1,'Bife');
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
q item id x q item id x
aaaaaaaaa dsaass de sushi 1 1.92378664 aaaaaaaaa dsaass de sushi 1 1.923787
aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000
aaaaaaaaa dsaass de Feijoada 3 0.00000000 aaaaaaaaa dsaass de Feijoada 3 0.000000
aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000
ssde df s fsda sad er um copo de Vodka 5 0.00000000 ssde df s fsda sad er um copo de Vodka 5 0.000000
ssde df s fsda sad er um chocolate Snickers 6 0.00000000 ssde df s fsda sad er um chocolate Snickers 6 0.000000
aaaaaaaaa dsaass de Bife 7 0.00000000 aaaaaaaaa dsaass de Bife 7 0.000000
aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
q item id x q item id x
...@@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0 ...@@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0
ssde df s fsda sad er um chocolate Snickers 6 0 ssde df s fsda sad er um chocolate Snickers 6 0
aaaaaaaaa dsaass de Bife 7 0 aaaaaaaaa dsaass de Bife 7 0
aaaaaaaaa dsaass de Pizza de Salmao 8 0 aaaaaaaaa dsaass de Pizza de Salmao 8 0
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
q item id x q item id x
aaaaaaaaa dsaass de sushi 1 1.92378664 aaaaaaaaa dsaass de sushi 1 1.923787
aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000 aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000
aaaaaaaaa dsaass de Feijoada 3 0.00000000 aaaaaaaaa dsaass de Feijoada 3 0.000000
aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000 aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000
ssde df s fsda sad er um copo de Vodka 5 0.00000000 ssde df s fsda sad er um copo de Vodka 5 0.000000
ssde df s fsda sad er um chocolate Snickers 6 0.00000000 ssde df s fsda sad er um chocolate Snickers 6 0.000000
aaaaaaaaa dsaass de Bife 7 0.00000000 aaaaaaaaa dsaass de Bife 7 0.000000
aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000 aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
q item id x q item id x
......
...@@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers'); ...@@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
INSERT INTO t2 VALUES (7,1,'Bife'); INSERT INTO t2 VALUES (7,1,'Bife');
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao'); INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8) SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id; as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE) SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
......
...@@ -599,6 +599,7 @@ drop table t2; ...@@ -599,6 +599,7 @@ drop table t2;
prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ; prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
create table t5 (a int) ; create table t5 (a int) ;
# rename must fail, t7 does not exist # rename must fail, t7 does not exist
--replace_result \\ /
--error 1017 --error 1017
execute stmt1 ; execute stmt1 ;
create table t7 (a int) ; create table t7 (a int) ;
......
...@@ -6,7 +6,7 @@ connection master; ...@@ -6,7 +6,7 @@ connection master;
drop database if exists mysqltest; drop database if exists mysqltest;
sync_slave_with_master; sync_slave_with_master;
# can't read dir # can't read dir
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" --replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
--error 12 --error 12
show tables from mysqltest; show tables from mysqltest;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment