1
let $engine_type=myisam;
1
# Requires binlog_format=statement format since query involving
2
# get_lock() is logged in row format if binlog_format=mixed or row.
3
-- source include/have_binlog_format_statement.inc
4
-- source include/master-slave.inc
6
--let $engine_type= myisam
7
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
9
# Load some data into t1
10
create table t1 (word char(20) not null);
11
load data infile '../../std_data/words.dat' into table t1;
12
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
13
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
14
select * from t1 limit 10;
17
# Test slave with wrong password
19
sync_slave_with_master;
22
set password for root@"localhost" = password('foo');
27
# Give slave time to do at last one failed connect retry
28
# This one must be short so that the slave will not stop retrying
30
set password for root@"localhost" = password('');
31
# Give slave time to connect (will retry every second)
34
create table t3(n int);
35
insert into t3 values(1),(2);
36
sync_slave_with_master;
38
select sum(length(word)) from t1;
41
sync_slave_with_master;
43
# Test if the slave SQL thread can be more than 16K behind the slave
44
# I/O thread (> IO_SIZE)
47
# we'll use table-level locking to delay slave SQL thread
48
eval create table t1 (n int) engine=$engine_type;
49
sync_slave_with_master;
58
# Generate 16K of relay log
62
eval insert into t1 values($1);
67
# Try to cause a large relay log lag on the slave by locking t1
71
#hope this is long enough for I/O thread to fetch over 16K relay log data
75
#test handling of aborted connection in the middle of update
78
create table t2(id int);
79
insert into t2 values(connection_id());
82
# Avoid generating result
83
create temporary table t3(n int);
85
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
89
send update t1 set n = n + get_lock('crash_lock%20C', 2);
92
select (@id := id) - id from t2;
94
# We don't drop t3 as this is a temporary table
97
# The get_lock function causes warning for unsafe statement.
103
# The SQL slave thread should now have stopped because the query was killed on
104
# the master (so it has a non-zero error code in the binlog).
105
# 1053 = ER_SERVER_SHUTDOWN
106
--let $slave_sql_errno= 1053
107
--source include/wait_for_slave_sql_error_and_skip.inc
109
select count(*) from t1;
112
create table t1 (n int);
113
insert into t1 values(3456);
114
insert into mysql.user (Host, User, Password)
115
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
116
select select_priv,user from mysql.user where user = _binary'blafasel2';
117
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
118
select select_priv,user from mysql.user where user = _binary'blafasel2';
119
sync_slave_with_master;
121
select select_priv,user from mysql.user where user = _binary'blafasel2';
124
delete from mysql.user where user="blafasel2";
125
sync_slave_with_master;
128
--source include/rpl_end.inc