#At file:///home/sven/bzr/b49978-cleanup_rpl_tests/5.1-bugteam/ based on revid:sven.sandberg@stripped
3520 Sven Sandberg 2010-10-06
BUG#49978: Replication tests don't clean up replication state at the end
Post-commit fix.
1. rpl_change_topology.inc relied on mtr's old-style semantics for
evaluating a string in boolean context (where '0 1' would evaluate
to false). mtr has changed semantics and now evaluates '0 1' to true.
2. rpl_circular_for_4_hosts.inc contained a race condition. server_4
was not sync'ed. This could cause sql_slave_skip_counter to have the
value 1 when the test ended.
modified:
mysql-test/include/rpl_change_topology.inc
mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
=== modified file 'mysql-test/include/rpl_change_topology.inc'
--- a/mysql-test/include/rpl_change_topology.inc 2010-09-27 10:48:35 +0000
+++ b/mysql-test/include/rpl_change_topology.inc 2010-10-06 11:50:49 +0000
@@ -144,7 +144,7 @@ while ($_rpl_topology)
{
# Get 's1->s2' from 's1->s2->s3->...' or from 's1->s2,s3->s4,...'
--let $_rpl_master_slave= `SELECT SUBSTRING_INDEX(SUBSTRING_INDEX('$_rpl_topology', ',', 1), '->', 2)`
- # Modyfy $_rpl_topology as follows:
+ # Modify $_rpl_topology as follows:
# - If it starts with 's1->s2,', remove 's1->s2,'
# - If it starts with 's1->s2->', remove 's1->'
# - If it is equal to 's1->s2', remove 's1->s2'
@@ -229,10 +229,7 @@ if (!$rpl_skip_change_master)
}
if (!$_rpl_master)
{
- # If $_rpl_master=0, then if($_rpl_change_topology_tmp) is false.
- # If $_rpl_master=' ', then if($_rpl_change_topology_tmp) is true.
- --let $_rpl_change_topology_tmp= $_rpl_master 1
- if ($_rpl_change_topology_tmp)
+ if (`SELECT '$_rpl_master' = ''`)
{
--let $rpl_connection_name= server_$_rpl_server
--source include/rpl_connection.inc
=== modified file 'mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test'
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test 2010-09-27 10:48:35 +0000
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test 2010-10-06 11:50:49 +0000
@@ -75,6 +75,7 @@ SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
source include/start_slave.inc;
--connection server_3
INSERT INTO t1 VALUES(6,'C',2);
+--sync_slave_with_master server_4
--connection server_2
INSERT INTO t1(b,c) VALUES('B',2);
Attachment: [text/bzr-bundle] bzr/sven.sandberg@oracle.com-20101006115049-514lbc5eh31npb8q.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (sven.sandberg:3520) Bug#49978 | Sven Sandberg | 6 Oct |