1
# Requires binlog_format=statement format since query involving
2
# get_lock() is logged in row format if binlog_format=mixed or row.
4
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
6
# Load some data into t1
7
create table t1 (word char(20) not null);
8
load data infile '../../std_data/words.dat' into table t1;
9
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
10
eval load data local infile '$MYSQL_TEST_DIR/std_data/words.dat' into table t1;
11
select * from t1 limit 10;
14
# Test slave with wrong password
16
sync_slave_with_master;
19
set password for root@"localhost" = password('foo');
24
# Give slave time to do at last one failed connect retry
25
# This one must be short so that the slave will not stop retrying
27
set password for root@"localhost" = password('');
28
# Give slave time to connect (will retry every second)
31
create table t3(n int);
32
insert into t3 values(1),(2);
33
sync_slave_with_master;
35
select sum(length(word)) from t1;
38
sync_slave_with_master;
40
# Test if the slave SQL thread can be more than 16K behind the slave
41
# I/O thread (> IO_SIZE)
44
# we'll use table-level locking to delay slave SQL thread
45
eval create table t1 (n int) engine=$engine_type;
46
sync_slave_with_master;
55
# Generate 16K of relay log
59
eval insert into t1 values($1);
64
# Try to cause a large relay log lag on the slave by locking t1
68
#hope this is long enough for I/O thread to fetch over 16K relay log data
72
#test handling of aborted connection in the middle of update
75
create table t2(id int);
76
insert into t2 values(connection_id());
79
# Avoid generating result
80
create temporary table t3(n int);
82
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
86
send update t1 set n = n + get_lock('crash_lock%20C', 2);
89
select (@id := id) - id from t2;
91
# We don't drop t3 as this is a temporary table
94
# The get_lock function causes warning for unsafe statement.
100
# The SQL slave thread should now have stopped because the query was killed on
101
# the master (so it has a non-zero error code in the binlog).
102
--source include/wait_for_slave_sql_to_stop.inc
104
# The following test can't be done because the result of Pos will differ
105
# on different computers
106
# --replace_result $MASTER_MYPORT MASTER_PORT
109
set global sql_slave_skip_counter=1;
111
select count(*) from t1;
114
create table t1 (n int);
115
insert into t1 values(3456);
116
insert into mysql.user (Host, User, Password)
117
VALUES ("10.10.10.%", "blafasel2", password("blafasel2"));
118
select select_priv,user from mysql.user where user = _binary'blafasel2';
119
update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
120
select select_priv,user from mysql.user where user = _binary'blafasel2';
121
sync_slave_with_master;
123
select select_priv,user from mysql.user where user = _binary'blafasel2';
126
delete from mysql.user where user="blafasel2";
127
sync_slave_with_master;