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
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
8
# Load some data into t1
9
create table t1 (word char(20) not null);
10
load data infile '../../std_data/words.dat' into table t1;
11
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
12
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
13
select * from t1 limit 10;
16
# Test slave with wrong password
18
sync_slave_with_master;
21
set password for root@"localhost" = password('foo');
26
# Give slave time to do at last one failed connect retry
27
# This one must be short so that the slave will not stop retrying
29
set password for root@"localhost" = password('');
30
# Give slave time to connect (will retry every second)
33
create table t3(n int);
34
insert into t3 values(1),(2);
35
sync_slave_with_master;
37
select sum(length(word)) from t1;
40
sync_slave_with_master;
42
# Test if the slave SQL thread can be more than 16K behind the slave
43
# I/O thread (> IO_SIZE)
46
# we'll use table-level locking to delay slave SQL thread
47
eval create table t1 (n int) engine=$engine_type;
48
sync_slave_with_master;
57
# Generate 16K of relay log
61
eval insert into t1 values($1);
66
# Try to cause a large relay log lag on the slave by locking t1
70
#hope this is long enough for I/O thread to fetch over 16K relay log data
74
#test handling of aborted connection in the middle of update
77
create table t2(id int);
78
insert into t2 values(connection_id());
81
# Avoid generating result
82
create temporary table t3(n int);
84
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
88
send update t1 set n = n + get_lock('crash_lock%20C', 2);
91
select (@id := id) - id from t2;
93
# We don't drop t3 as this is a temporary table
96
# The get_lock function causes warning for unsafe statement.
102
# The SQL slave thread should now have stopped because the query was killed on
103
# the master (so it has a non-zero error code in the binlog).
104
--source include/wait_for_slave_sql_to_stop.inc
106
# The following test can't be done because the result of Pos will differ
107
# on different computers
108
# --replace_result $MASTER_MYPORT MASTER_PORT
111
set global sql_slave_skip_counter=1;
113
select count(*) from t1;
116
create table t1 (n int);
117
insert into t1 values(3456);
118
insert into mysql.user (Host, User, Password)
119
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
120
select select_priv,user from mysql.user where user = _binary'blafasel2';
121
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
122
select select_priv,user from mysql.user where user = _binary'blafasel2';
123
sync_slave_with_master;
125
select select_priv,user from mysql.user where user = _binary'blafasel2';
128
delete from mysql.user where user="blafasel2";
129
sync_slave_with_master;