Debian Codegraph @

mysql-test/suite/rpl/t/rpl_critical_errors.test

raw
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
11 disable_parsing;
12
13 source include/master-slave.inc;
14
15 connection master;
16 CREATE TABLE t1 (data LONGBLOB) ENGINE=MYISAM;
17 CREATE TABLE t2 (data LONGBLOB) ENGINE=MYISAM;
18
19 INSERT INTO t1 (data) VALUES (repeat('a',1024*1024));
20 INSERT INTO t1 SELECT * FROM t1;
21 INSERT INTO t1 SELECT * FROM t1;
22 INSERT INTO t1 SELECT * FROM t1;
23 INSERT INTO t1 SELECT * FROM t1;
24 INSERT INTO t1 SELECT * FROM t1;
25 INSERT INTO t1 SELECT * FROM t1;
26 INSERT INTO t1 SELECT * FROM t1;
27 INSERT INTO t1 SELECT * FROM t1;
28 sync_slave_with_master;
29
30 connection master;
31 send INSERT INTO t2 SELECT * FROM t1;
32
33 connection 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.
37 let $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...
51 KILL QUERY 2;
52
53 connection 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
63 SELECT COUNT(*) FROM t2;
64
65 --source include/rpl_end.inc
66 enable_parsing;