Skip to content

Commit 75ebab7

Browse files
author
kent@mysql.com
committed
Windows compatibility changes of the 'rpl_delete_all',
'ps_1general' and 'fulltext_cache' test cases.
1 parent 75b0b94 commit 75ebab7

File tree

6 files changed

+52
-26
lines changed

6 files changed

+52
-26
lines changed

mysql-test/lib/mtr_process.pl

+28-5
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,25 @@ ($$$$$$$)
123123

124124
$SIG{INT}= 'DEFAULT'; # Parent do some stuff, we don't
125125

126+
if ( $::glob_cygwin_shell and $mode eq 'test' )
127+
{
128+
# Programs started from mysqltest under Cygwin, are to
129+
# execute them within Cygwin. Else simple things in test
130+
# files like
131+
# --system "echo 1 > file"
132+
# will fail.
133+
# FIXME not working :-(
134+
# $ENV{'COMSPEC'}= "$::glob_cygwin_shell -c";
135+
}
136+
126137
if ( $output )
127138
{
128139
if ( ! open(STDOUT,">",$output) )
129140
{
130141
mtr_error("can't redirect STDOUT to \"$output\": $!");
131142
}
132143
}
144+
133145
if ( $error )
134146
{
135147
if ( $output eq $error )
@@ -147,14 +159,19 @@ ($$$$$$$)
147159
}
148160
}
149161
}
162+
150163
if ( $input )
151164
{
152165
if ( ! open(STDIN,"<",$input) )
153166
{
154167
mtr_error("can't redirect STDIN to \"$input\": $!");
155168
}
156169
}
157-
exec($path,@$arg_list_t);
170+
171+
if ( ! exec($path,@$arg_list_t) )
172+
{
173+
mtr_error("failed to execute \"$path\": $!");
174+
}
158175
}
159176
}
160177
}
@@ -569,7 +586,7 @@ ($)
569586
sub mtr_mysqladmin_shutdown () {
570587
my $spec= shift;
571588

572-
my @mysql_admin_pids;
589+
my %mysql_admin_pids;
573590
my @to_kill_specs;
574591

575592
foreach my $srv ( @$spec )
@@ -611,13 +628,19 @@ ()
611628
# We don't wait for termination of mysqladmin
612629
my $pid= mtr_spawn($::exe_mysqladmin, $args,
613630
"", $::path_manager_log, $::path_manager_log, "");
614-
push(@mysql_admin_pids, $pid);
631+
$mysql_admin_pids{$pid}= 1;
615632
}
616633

617634
# We wait blocking, we wait for the last one anyway
618-
foreach my $pid (@mysql_admin_pids)
635+
while (keys %mysql_admin_pids)
619636
{
620-
waitpid($pid,0); # FIXME no need to check -1 or 0?
637+
foreach my $pid (keys %mysql_admin_pids)
638+
{
639+
if ( waitpid($pid,0) > 0 )
640+
{
641+
delete $mysql_admin_pids{$pid};
642+
}
643+
}
621644
}
622645

623646
# If we trusted "mysqladmin --shutdown_timeout= ..." we could just

mysql-test/mysql-test-run.pl

+2
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ ($$)
12611261

12621262
mtr_add_arg($args, "--no-defaults");
12631263
mtr_add_arg($args, "--bootstrap");
1264+
mtr_add_arg($args, "--console");
12641265
mtr_add_arg($args, "--skip-grant-tables");
12651266
mtr_add_arg($args, "--basedir=%s", $path_my_basedir);
12661267
mtr_add_arg($args, "--datadir=%s", $data_dir);
@@ -1604,6 +1605,7 @@ ($$$$$)
16041605
mtr_add_arg($args, "%s--no-defaults", $prefix);
16051606
}
16061607

1608+
mtr_add_arg($args, "%s--console", $prefix);
16071609
mtr_add_arg($args, "%s--basedir=%s", $prefix, $path_my_basedir);
16081610
mtr_add_arg($args, "%s--character-sets-dir=%s", $prefix, $path_charsetsdir);
16091611
mtr_add_arg($args, "%s--core", $prefix);

mysql-test/r/fulltext_cache.result

+18-18
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ INSERT INTO t2 VALUES (5,2,'um copo de Vodka');
2121
INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
2222
INSERT INTO t2 VALUES (7,1,'Bife');
2323
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
24-
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8)
24+
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
2525
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
2626
q item id x
27-
aaaaaaaaa dsaass de sushi 1 1.92378664
28-
aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000
29-
aaaaaaaaa dsaass de Feijoada 3 0.00000000
30-
aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000
31-
ssde df s fsda sad er um copo de Vodka 5 0.00000000
32-
ssde df s fsda sad er um chocolate Snickers 6 0.00000000
33-
aaaaaaaaa dsaass de Bife 7 0.00000000
34-
aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000
27+
aaaaaaaaa dsaass de sushi 1 1.923787
28+
aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000
29+
aaaaaaaaa dsaass de Feijoada 3 0.000000
30+
aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000
31+
ssde df s fsda sad er um copo de Vodka 5 0.000000
32+
ssde df s fsda sad er um chocolate Snickers 6 0.000000
33+
aaaaaaaaa dsaass de Bife 7 0.000000
34+
aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000
3535
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
3636
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
3737
q item id x
@@ -43,17 +43,17 @@ ssde df s fsda sad er um copo de Vodka 5 0
4343
ssde df s fsda sad er um chocolate Snickers 6 0
4444
aaaaaaaaa dsaass de Bife 7 0
4545
aaaaaaaaa dsaass de Pizza de Salmao 8 0
46-
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8)
46+
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
4747
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
4848
q item id x
49-
aaaaaaaaa dsaass de sushi 1 1.92378664
50-
aaaaaaaaa dsaass de Bolo de Chocolate 2 0.00000000
51-
aaaaaaaaa dsaass de Feijoada 3 0.00000000
52-
aaaaaaaaa dsaass de Mousse de Chocolate 4 0.00000000
53-
ssde df s fsda sad er um copo de Vodka 5 0.00000000
54-
ssde df s fsda sad er um chocolate Snickers 6 0.00000000
55-
aaaaaaaaa dsaass de Bife 7 0.00000000
56-
aaaaaaaaa dsaass de Pizza de Salmao 8 0.00000000
49+
aaaaaaaaa dsaass de sushi 1 1.923787
50+
aaaaaaaaa dsaass de Bolo de Chocolate 2 0.000000
51+
aaaaaaaaa dsaass de Feijoada 3 0.000000
52+
aaaaaaaaa dsaass de Mousse de Chocolate 4 0.000000
53+
ssde df s fsda sad er um copo de Vodka 5 0.000000
54+
ssde df s fsda sad er um chocolate Snickers 6 0.000000
55+
aaaaaaaaa dsaass de Bife 7 0.000000
56+
aaaaaaaaa dsaass de Pizza de Salmao 8 0.000000
5757
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
5858
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
5959
q item id x

mysql-test/t/fulltext_cache.test

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ INSERT INTO t2 VALUES (6,2,'um chocolate Snickers');
2929
INSERT INTO t2 VALUES (7,1,'Bife');
3030
INSERT INTO t2 VALUES (8,1,'Pizza de Salmao');
3131

32-
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8)
32+
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
3333
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
3434

3535
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)
3636
as x FROM t1, t2 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
3737

38-
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),8)
38+
SELECT t1.q, t2.item, t2.id, round(MATCH t2.item AGAINST ('sushi'),6)
3939
as x FROM t2, t1 WHERE (t2.id2 = t1.id) ORDER BY x DESC,t2.id;
4040

4141
SELECT t1.q, t2.item, t2.id, MATCH t2.item AGAINST ('sushi' IN BOOLEAN MODE)

mysql-test/t/ps_1general.test

+1
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ drop table t2;
599599
prepare stmt1 from ' rename table t5 to t6, t7 to t8 ' ;
600600
create table t5 (a int) ;
601601
# rename must fail, t7 does not exist
602+
--replace_result \\ /
602603
--error 1017
603604
execute stmt1 ;
604605
create table t7 (a int) ;

mysql-test/t/rpl_delete_all.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ connection master;
66
drop database if exists mysqltest;
77
sync_slave_with_master;
88
# can't read dir
9-
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X"
9+
--replace_result "Errcode: 1" "Errcode: X" "Errcode: 2" "Errcode: X" \\ /
1010
--error 12
1111
show tables from mysqltest;
1212

0 commit comments

Comments
 (0)