Commit 801cea4d authored by unknown's avatar unknown

rpl_slave_status.test

Added waiting start/stop slave via primitives.


mysql-test/suite/rpl/r/rpl_slave_status.result:
  updated result
mysql-test/suite/rpl/t/rpl_slave_status.test:
  updated test case
parent d049600f
...@@ -4,21 +4,21 @@ reset master; ...@@ -4,21 +4,21 @@ reset master;
reset slave; reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9; drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave; start slave;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
stop slave; STOP SLAVE;
change master to master_user='rpl',master_password='rpl'; CHANGE MASTER TO master_user='rpl',master_password='rpl';
start slave; START SLAVE;
drop table if exists t1; DROP TABLE IF EXISTS t1;
create table t1 (n int); CREATE TABLE t1 (n int);
insert into t1 values (1); INSERT INTO t1 VALUES (1);
select * from t1; SELECT * FROM t1;
n n
1 1
delete from mysql.user where user='rpl'; DELETE FROM mysql.user WHERE user='rpl';
flush privileges; FLUSH PRIVILEGES;
stop slave; STOP SLAVE;
start slave; START SLAVE;
show slave status; SHOW SLAVE STATUS;
Slave_IO_State # Slave_IO_State #
Master_Host 127.0.0.1 Master_Host 127.0.0.1
Master_User rpl Master_User rpl
...@@ -57,6 +57,6 @@ Last_IO_Errno # ...@@ -57,6 +57,6 @@ Last_IO_Errno #
Last_IO_Error # Last_IO_Error #
Last_SQL_Errno 0 Last_SQL_Errno 0
Last_SQL_Error Last_SQL_Error
drop table t1; DROP TABLE t1;
delete from mysql.user where user='rpl'; DELETE FROM mysql.user WHERE user='rpl';
drop table t1; DROP TABLE t1;
--source include/master-slave.inc
############################################################################ ############################################################################
# Test case for BUG#10780 # Test case for BUG#10780
# #
# REQUIREMENT # REQUIREMENT
# A slave without replication privileges should have Slave_IO_Running = No # A slave without replication privileges should have Slave_IO_Running = No
############################################################################
--source include/master-slave.inc
# 1. Create new replication user # 1. Create new replication user
connection master; --connection master
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl'; GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
connection slave; --connection slave
stop slave; STOP SLAVE;
change master to master_user='rpl',master_password='rpl'; --source include/wait_for_slave_to_stop.inc
start slave; CHANGE MASTER TO master_user='rpl',master_password='rpl';
START SLAVE;
--source include/wait_for_slave_to_start.inc
# 2. Do replication as new user # 2. Do replication as new user
connection master; --connection master
--disable_warnings --disable_warnings
drop table if exists t1; DROP TABLE IF EXISTS t1;
--enable_warnings --enable_warnings
create table t1 (n int); CREATE TABLE t1 (n int);
insert into t1 values (1); INSERT INTO t1 VALUES (1);
save_master_pos; --sync_slave_with_master
connection slave; SELECT * FROM t1;
sync_with_master;
select * from t1;
# 3. Delete new replication user # 3. Delete new replication user
connection master; --connection master
delete from mysql.user where user='rpl'; DELETE FROM mysql.user WHERE user='rpl';
flush privileges; FLUSH PRIVILEGES;
connection slave; --connection slave
# 4. Restart slave without privileges # 4. Restart slave without privileges
# (slave.err will contain access denied error for this START SLAVE command) # (slave.err will contain access denied error for this START SLAVE command)
stop slave; STOP SLAVE;
start slave; --source include/wait_for_slave_to_stop.inc
START SLAVE;
--let $slave_param= Slave_SQL_Running
--let $slave_param_value= Yes
--source include/wait_for_slave_param.inc
# 5. Make sure Slave_IO_Running = No # 5. Make sure Slave_IO_Running = No
--replace_result $MASTER_MYPORT MASTER_MYPORT --replace_result $MASTER_MYPORT MASTER_MYPORT
...@@ -44,16 +48,16 @@ start slave; ...@@ -44,16 +48,16 @@ start slave;
# "Connecting to master" or "Waiting for master update" # "Connecting to master" or "Waiting for master update"
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 # --replace_column 1 # 7 # 8 # 9 # 22 # 23 # 35 # 36 #
--vertical_results --vertical_results
show slave status; SHOW SLAVE STATUS;
# Cleanup (Note that slave IO thread is not running) # Cleanup (Note that slave IO thread is not running)
connection slave; --connection slave
drop table t1; DROP TABLE t1;
delete from mysql.user where user='rpl'; DELETE FROM mysql.user WHERE user='rpl';
# cleanup: slave io thread has been stopped "irrecoverably" # cleanup: slave io thread has been stopped "irrecoverably"
# so we clean up mess manually # so we clean up mess manually
connection master; --connection master
drop table t1; DROP TABLE t1;
# end of 4.1 tests # End of 4.1 tests
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment