1########################################################
2# By JBM 2005-02-15 Wrapped to allow reuse of test code#
3########################################################
4-- source include/have_binlog_format_row.inc
5-- source include/master-slave.inc
6
7# Test if the slave SQL thread can be more than 16K behind the slave
8# I/O thread (> IO_SIZE)
9
10# we'll use table-level locking to delay slave SQL thread
11eval CREATE TABLE t1 (n INT);
12sync_slave_with_master;
13connection master;
14RESET MASTER;
15connection slave;
16STOP SLAVE;
17RESET SLAVE;
18
19connection master;
20let $1=5000;
21# Generate 16K of relay log
22disable_query_log;
23while ($1)
24{
25 eval INSERT INTO t1 VALUES($1);
26 dec $1;
27}
28enable_query_log;
29SELECT COUNT(*) FROM t1;
30save_master_pos;
31
32# Try to cause a large relay log lag on the slave by locking t1
33connection slave;
34LOCK TABLES t1 READ;
35START SLAVE;
36UNLOCK TABLES;
37sync_with_master;
38SELECT COUNT(*) FROM t1;
39
40connection master;
41DROP TABLE t1;
42CREATE TABLE t1 (n INT);
43INSERT INTO t1 VALUES(3456);
44sync_slave_with_master;
45SELECT n FROM t1;
46
47connection master;
48DROP TABLE t1;
49
50sync_slave_with_master;
51--source include/rpl_end.inc
52