summaryrefslogtreecommitdiff
path: root/mysql-test/t/rpl000001.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/rpl000001.test')
-rw-r--r--mysql-test/t/rpl000001.test48
1 files changed, 28 insertions, 20 deletions
diff --git a/mysql-test/t/rpl000001.test b/mysql-test/t/rpl000001.test
index 6d46124d238..fb4255f27b3 100644
--- a/mysql-test/t/rpl000001.test
+++ b/mysql-test/t/rpl000001.test
@@ -1,21 +1,34 @@
-eval_result;
source include/master-slave.inc;
-connection master;
-use test;
-drop table if exists t1,t3;
+drop table if exists t1,t2,t3;
create table t1 (word char(20) not null);
load data infile '../../std_data/words.dat' into table t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
select * from t1;
+
+#
+# Test slave with wrong password
+#
+save_master_pos;
+connection slave;
+sync_with_master;
+slave stop;
+connection master;
set password for root@"localhost" = password('foo');
+connection slave;
+slave start;
+connection master;
+# Give slave time to do at last one failed connect retry
+sleep 2;
set password for root@"localhost" = password('');
+# Give slave time to connect (will retry every second)
+sleep 2;
+
create table t3(n int);
insert into t3 values(1),(2);
save_master_pos;
connection slave;
sync_with_master;
-use test;
select * from t3;
select sum(length(word)) from t1;
connection master;
@@ -32,7 +45,6 @@ slave stop;
reset slave;
connection master;
-drop table if exists t1,t2;
create table t1(n int);
#we want the log to exceed 16K to test deal with the log that is bigger than
#IO_SIZE
@@ -45,12 +57,12 @@ while ($1)
}
enable_query_log;
-#try to cause a large relay log lag on the slave
+# Try to cause a large relay log lag on the slave
connection slave;
select get_lock("hold_slave",10);
slave start;
#hope this is long enough for I/O thread to fetch over 16K relay log data
-sleep 1;
+sleep 3;
select release_lock("hold_slave");
unlock tables;
@@ -59,24 +71,24 @@ create table t2(id int);
insert into t2 values(connection_id());
save_master_pos;
-
connection master1;
-#avoid generating result
-create temporary table t1_temp(n int);
-insert into t1_temp select get_lock('crash_lock%20C', 1) from t2;
+# Avoid generating result
+create temporary table t3(n int);
+insert into t3 select get_lock('crash_lock%20C', 1) from t2;
connection master;
send update t1 set n = n + get_lock('crash_lock%20C', 2);
connection master1;
-sleep 2;
+sleep 3;
select (@id := id) - id from t2;
kill @id;
+# We don't drop t3 as this is a temporary table
drop table t2;
connection master;
--error 1053;
reap;
connection slave;
-sync_with_master ;
+sync_with_master;
#give the slave a chance to exit
wait_for_slave_to_stop;
@@ -92,13 +104,11 @@ connection master1;
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
-use mysql;
-insert into user (Host, User, Password)
+insert into mysql.user (Host, User, Password)
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
select select_priv,user from mysql.user where user = 'blafasel2';
-update user set Select_priv = "Y" where User="blafasel2";
+update mysql.user set Select_priv = "Y" where User="blafasel2";
select select_priv,user from mysql.user where user = 'blafasel2';
-use test;
save_master_pos;
connection slave;
sync_with_master;
@@ -109,5 +119,3 @@ drop table t1;
save_master_pos;
connection slave;
sync_with_master;
-
-