summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-08-01 17:08:38 -0700
committerunknown <jimw@mysql.com>2005-08-01 17:08:38 -0700
commit8fc1e27fb7604b93358a15f26a0c849faa21a1ca (patch)
treec024aa889db980a0023e67986522da1c5a3d0aad
parentc33f7f9f9064d95a73778c0e962e20a267bccaad (diff)
parent275150580bdc867dbcc0c58d23d152f94b2bb4f7 (diff)
downloadmariadb-git-8fc1e27fb7604b93358a15f26a0c849faa21a1ca.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean sql/slave.cc: Auto merged sql/slave.h: Auto merged
-rw-r--r--mysql-test/r/rpl_slave_status.result54
-rw-r--r--mysql-test/t/rpl_slave_status.test29
-rw-r--r--sql/slave.cc3
3 files changed, 85 insertions, 1 deletions
diff --git a/mysql-test/r/rpl_slave_status.result b/mysql-test/r/rpl_slave_status.result
new file mode 100644
index 00000000000..5e9b6ab31ad
--- /dev/null
+++ b/mysql-test/r/rpl_slave_status.result
@@ -0,0 +1,54 @@
+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;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+stop slave;
+change master to master_user='rpl',master_password='rpl';
+start slave;
+drop table if exists t1;
+create table t1 (n int);
+insert into t1 values (1);
+select * from t1;
+n
+1
+delete from mysql.user where user='rpl';
+flush privileges;
+stop slave;
+start slave;
+show slave status;
+Slave_IO_State Connecting to master
+Master_Host 127.0.0.1
+Master_User rpl
+Master_Port MASTER_MYPORT
+Connect_Retry 1
+Master_Log_File master-bin.000001
+Read_Master_Log_Pos 357
+Relay_Log_File slave-relay-bin.000001
+Relay_Log_Pos 401
+Relay_Master_Log_File master-bin.000001
+Slave_IO_Running No
+Slave_SQL_Running Yes
+Replicate_Do_DB
+Replicate_Ignore_DB
+Replicate_Do_Table
+Replicate_Ignore_Table
+Replicate_Wild_Do_Table
+Replicate_Wild_Ignore_Table
+Last_Errno 0
+Last_Error
+Skip_Counter 0
+Exec_Master_Log_Pos 357
+Relay_Log_Space 401
+Until_Condition None
+Until_Log_File
+Until_Log_Pos 0
+Master_SSL_Allowed No
+Master_SSL_CA_File
+Master_SSL_CA_Path
+Master_SSL_Cert
+Master_SSL_Cipher
+Master_SSL_Key
+Seconds_Behind_Master NULL
diff --git a/mysql-test/t/rpl_slave_status.test b/mysql-test/t/rpl_slave_status.test
new file mode 100644
index 00000000000..4e0d7dae35c
--- /dev/null
+++ b/mysql-test/t/rpl_slave_status.test
@@ -0,0 +1,29 @@
+# Test case for BUG #10780
+source include/master-slave.inc
+connection master;
+grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl';
+connection slave;
+stop slave;
+change master to master_user='rpl',master_password='rpl';
+start slave;
+connection master;
+--disable_warnings
+drop table if exists t1;
+--enable_warning
+create table t1 (n int);
+insert into t1 values (1);
+save_master_pos;
+connection slave;
+sync_with_master;
+select * from t1;
+connection master;
+delete from mysql.user where user='rpl';
+flush privileges;
+connection slave;
+stop slave;
+start slave;
+--replace_result $MASTER_MYPORT MASTER_MYPORT
+--vertical_results
+show slave status;
+
+# end of 4.1 tests
diff --git a/sql/slave.cc b/sql/slave.cc
index eed70b01cd2..c09753d805b 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -2396,7 +2396,8 @@ bool show_master_info(THD* thd, MASTER_INFO* mi)
&my_charset_bin);
protocol->store((ulonglong) mi->rli.group_relay_log_pos);
protocol->store(mi->rli.group_master_log_name, &my_charset_bin);
- protocol->store(mi->slave_running ? "Yes":"No", &my_charset_bin);
+ protocol->store(mi->slave_running == MYSQL_SLAVE_RUN_CONNECT
+ ? "Yes":"No", &my_charset_bin);
protocol->store(mi->rli.slave_running ? "Yes":"No", &my_charset_bin);
protocol->store(&replicate_do_db);
protocol->store(&replicate_ignore_db);