1# Test for BUG#26551
2#
3
4# This test is unfortunately very fragile and very dependent on the
5# load of the computer. The test is therefore disabled normally. It is
6# entered here to demonstrate how to check that the bug is actually
7# solved.
8
9--echo Turn on parsing to run this test
10
11disable_parsing;
12
13source include/master-slave.inc;
14
15connection master;
16CREATE TABLE t1 (data LONGBLOB) ENGINE=MYISAM;
17CREATE TABLE t2 (data LONGBLOB) ENGINE=MYISAM;
18
19INSERT INTO t1 (data) VALUES (repeat('a',1024*1024));
20INSERT INTO t1 SELECT * FROM t1;
21INSERT INTO t1 SELECT * FROM t1;
22INSERT INTO t1 SELECT * FROM t1;
23INSERT INTO t1 SELECT * FROM t1;
24INSERT INTO t1 SELECT * FROM t1;
25INSERT INTO t1 SELECT * FROM t1;
26INSERT INTO t1 SELECT * FROM t1;
27INSERT INTO t1 SELECT * FROM t1;
28sync_slave_with_master;
29
30connection master;
31send INSERT INTO t2 SELECT * FROM t1;
32
33connection master1;
34
35# This sleep is picked so that the query above has started to insert
36# some rows into t2. If it hasn't the slave will not stop below.
37let $wait_condition= SELECT COUNT(*) > 1000 FROM t1;
38--source include/wait_condition.inc
39
40# SHOW PROCESSLIST;
41
42# Code for the 5.1 server to get the thread id of the thread executing
43# the query above.
44#
45#SET @id = 0;
46#SELECT id INTO @id
47#  FROM information_schema.processlist
48# WHERE info LIKE 'INSERT INTO t2%';
49
50# This is the connection that is executing the INSERT INTO t2...
51KILL QUERY 2;
52
53connection slave;
54
55# Here the slave will only stop if the query above actually started
56# inserting some rows into t2. Otherwise, it will hang forever.  ... and there
57# the error code should be 1317 (ER_QUERY_INTERRUPTED)
58--let $slave_sql_errno= 1317
59--let $show_slave_sql_error= 1
60--source include/wait_for_slave_sql_error.inc
61
62# The following should be 0
63SELECT COUNT(*) FROM t2;
64
65--source include/rpl_end.inc
66enable_parsing;
67