Debian Codegraph @

mysql-test/suite/innodb/t/innodb_bug38231.test

raw
1 --source include/have_innodb.inc
2 #
3 # Bug#38231 Innodb crash in lock_reset_all_on_table() on TRUNCATE + LOCK / UNLOCK
4 # http://bugs.mysql.com/38231
5 #
6
7 # skip this test in embedded mode because "TRUNCATE TABLE bug38231_1"
8 # hangs in that mode waiting for "lock_wait_timeout" although it is
9 # preceded by --send
10 -- source include/not_embedded.inc
11
12 SET default_storage_engine=InnoDB;
13
14 # we care only that the following SQL commands do not crash the server
15 -- disable_query_log
16 -- disable_result_log
17
18 CREATE TABLE bug38231_1 (a INT);
19
20 -- connect (lock_gain,localhost,root,,)
21 -- connect (lock_wait1,localhost,root,,)
22 -- connect (lock_wait2,localhost,root,,)
23 -- connect (truncate_wait,localhost,root,,)
24
25 -- connection lock_gain
26 SET autocommit=0;
27 LOCK TABLE bug38231_1 WRITE;
28
29 -- connection lock_wait1
30 SET autocommit=0;
31 -- send
32 LOCK TABLE bug38231_1 WRITE;
33
34 -- connection lock_wait2
35 SET autocommit=0;
36 -- send
37 LOCK TABLE bug38231_1 WRITE;
38
39 -- connection truncate_wait
40 -- send
41 TRUNCATE TABLE bug38231_1;
42
43 -- connection lock_gain
44 # this crashes the server if the bug is present
45 UNLOCK TABLES;
46
47 # clean up
48
49 # do not clean up - we do not know which of the three has been released
50 # so the --reap command may hang because the command that is being executed
51 # in that connection is still running/waiting
52 #-- connection lock_wait1
53 #-- reap
54 #UNLOCK TABLES;
55 #
56 #-- connection lock_wait2
57 #-- reap
58 #UNLOCK TABLES;
59 #
60 #-- connection truncate_wait
61 #-- reap
62
63 -- connection default
64
65 -- dirty_close lock_gain
66 -- dirty_close lock_wait1
67 -- dirty_close lock_wait2
68 -- dirty_close truncate_wait
69
70 DROP TABLE bug38231_1;
71
72 -- enable_query_log
73 -- enable_result_log
74
75 -- let $count_sessions= 1
76 -- source include/wait_until_count_sessions.inc