#At file:///home/andrei/MySQL/BZR/FIXES/5.1-bt-bug33815-dupl_s_id-contrib/ based on revid:aelkin@stripped
3079 Andrei Elkin 2009-08-26
Bug #33815 Improve reporting with duplicate server-ids
test case is added
added:
mysql-test/suite/rpl/r/rpl_server_id_duplicate.result
mysql-test/suite/rpl/t/rpl_server_id_duplicate-master.opt
mysql-test/suite/rpl/t/rpl_server_id_duplicate-slave.opt
mysql-test/suite/rpl/t/rpl_server_id_duplicate.test
modified:
sql/sql_class.cc
support-files/build-tags
=== added file 'mysql-test/suite/rpl/r/rpl_server_id_duplicate.result'
--- a/mysql-test/suite/rpl/r/rpl_server_id_duplicate.result 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/r/rpl_server_id_duplicate.result 2009-08-26 08:42:46 +0000
@@ -0,0 +1,19 @@
+stop slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+start slave;
+RESET SLAVE;
+change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+include/start_slave.inc
+Slave_IO_Running and Slave_SQL_Running must be YES, YES : Yes, Yes
+connection slave
+stop slave;
+set @@global.server_id= 1;
+start slave;
+Slave_IO_Running must be NO: No
+# cleanup
+connection master
+stop slave;
+stop slave;
=== added file 'mysql-test/suite/rpl/t/rpl_server_id_duplicate-master.opt'
--- a/mysql-test/suite/rpl/t/rpl_server_id_duplicate-master.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_id_duplicate-master.opt 2009-08-26 08:42:46 +0000
@@ -0,0 +1 @@
+--disable-log-slave-updates --replicate-same-server-id --server_id=1
=== added file 'mysql-test/suite/rpl/t/rpl_server_id_duplicate-slave.opt'
--- a/mysql-test/suite/rpl/t/rpl_server_id_duplicate-slave.opt 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_id_duplicate-slave.opt 2009-08-26 08:42:46 +0000
@@ -0,0 +1 @@
+--disable-log-slave-updates --replicate-same-server-id --server_id=1
=== added file 'mysql-test/suite/rpl/t/rpl_server_id_duplicate.test'
--- a/mysql-test/suite/rpl/t/rpl_server_id_duplicate.test 1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/rpl/t/rpl_server_id_duplicate.test 2009-08-26 08:42:46 +0000
@@ -0,0 +1,41 @@
+#
+# motivated by Bug #33815 Improve reporting with duplicate server-ids
+#
+# Testing rejecting to establish master-slave session with yet
+# another slave server having the same to an existing slave server id.
+# Master creates self-replicating slave session, a separate slave server
+# having the master's server id tries to connect and fail.
+
+source include/master-slave.inc;
+
+connection master;
+RESET SLAVE;
+--replace_result $MASTER_MYPORT MASTER_PORT
+eval change master to master_host='127.0.0.1',master_port=$MASTER_MYPORT, master_user='root';
+source include/start_slave.inc;
+let $master_s_id=`select @@global.server_id`;
+let $io_status= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+let $sql_status= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1);
+echo Slave_IO_Running and Slave_SQL_Running must be YES, YES : $io_status, $sql_status
+
+connection slave;
+--disable_warnings
+stop slave;
+--enable_warnings
+eval set @@global.server_id= $master_s_id;
+start slave;
+
+source include/wait_for_slave_sql_to_start.inc;
+source include/wait_for_slave_io_to_stop.inc;
+let $io_status= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1);
+echo Slave_IO_Running must be NO: $io_status
+
+# cleanup
+
+connection master;
+stop slave;
+
+connection slave;
+stop slave;
+
+# End of tests
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2009-08-11 13:05:25 +0000
+++ b/sql/sql_class.cc 2009-08-26 08:42:46 +0000
@@ -2891,6 +2891,7 @@ bool Security_context::user_matches(Secu
}
+
/****************************************************************************
Handling of open and locked tables states.
=== modified file 'support-files/build-tags'
--- a/support-files/build-tags 2009-06-12 14:06:59 +0000
+++ b/support-files/build-tags 2009-08-26 08:42:46 +0000
@@ -4,7 +4,7 @@ rm -f TAGS
filter='\.cc$\|\.c$\|\.h$\|\.yy$'
list="find . -type f"
-bzr root >/dev/null 2>/dev/null && list="bzr ls --from-root -R --kind=file --versioned"
+bzr root >/dev/null 2>/dev/null && list="bzr ls --from-root --kind=file --versioned"
$list |grep $filter |while read f;
do
| Thread |
|---|
| • bzr commit into mysql-5.1 branch (aelkin:3079) Bug#33815 | Andrei Elkin | 26 Aug |