summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/r/rpl_server_id2.result10
-rw-r--r--sql/slave.cc8
2 files changed, 8 insertions, 10 deletions
diff --git a/mysql-test/r/rpl_server_id2.result b/mysql-test/r/rpl_server_id2.result
index 5f4ec9df4c4..d8d805fc0d2 100644
--- a/mysql-test/r/rpl_server_id2.result
+++ b/mysql-test/r/rpl_server_id2.result
@@ -1,17 +1,19 @@
-slave stop;
+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;
-slave start;
+start slave;
drop table if exists t1;
+Warnings:
+Note 1051 Unknown table 't1'
create table t1 (n int);
reset master;
stop slave;
change master to master_port=SLAVE_PORT;
show slave status;
-Master_Host Master_User Master_Port Connect_retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_do_db Replicate_ignore_db Last_errno Last_error Skip_counter Exec_master_log_pos Relay_log_space
-127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.001 4 No No 0 0 0 #
+Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
+ 127.0.0.1 root SLAVE_PORT 1 4 slave-relay-bin.000001 4 No No # 0 0 0 4 None 0 No NULL
start slave;
insert into t1 values (1);
select * from t1;
diff --git a/sql/slave.cc b/sql/slave.cc
index c8da53433d7..12fec28ec49 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2833,11 +2833,6 @@ static int exec_relay_log_event(THD* thd, RELAY_LOG_INFO* rli)
log files themselves.
*/
- /*
- TODO: when this is merged into 4.1, one needs to update queue_event() to
- add a similar test for replicate_same_server_id, because in 4.1 the I/O
- thread is also filtering events based on the server id.
- */
if ((ev->server_id == (uint32) ::server_id && !replicate_same_server_id) ||
(rli->slave_skip_counter && type_code != ROTATE_EVENT))
{
@@ -3716,7 +3711,8 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
direct master (an unsupported, useless setup!).
*/
- if (uint4korr(buf + SERVER_ID_OFFSET) == ::server_id)
+ if ((uint4korr(buf + SERVER_ID_OFFSET) == ::server_id) &&
+ !replicate_same_server_id)
{
/*
Do not write it to the relay log.