Debian Codegraph @

mysql-test/suite/innodb/include/atomic_truncate_table_crash_temp.inc

raw
1 #
2 # WL#6501: make truncate table atomic
3 #
4
5 --source include/have_debug.inc
6 --source include/big_test.inc
7
8 # Valgrind would complain about memory leaks when we crash on purpose.
9 --source include/not_valgrind.inc
10 # Avoid CrashReporter popup on Mac
11 --source include/not_crashrep.inc
12
13 # suppress expected warnings
14 call mtr.add_suppression("does not exist in the InnoDB internal");
15
16 ################################################################################
17 #
18 # Will test following scenarios:
19 # 1. Hit crash point on completing drop of all indexes before creation of index
20 # is commenced.
21 # 2. Hit crash point after data is updated to system-table and in-memory dict.
22 #
23 ################################################################################
24
25 #-----------------------------------------------------------------------------
26 #
27 # create test-bed
28 #
29 let $per_table = `select @@innodb_file_per_table`;
30
31 eval set global innodb_file_per_table = on;
32 let $WL6501_TMP_DIR = `select @@tmpdir`;
33 let $WL6501_DATA_DIR = `select @@datadir`;
34 let SEARCH_FILE = $MYSQLTEST_VARDIR/log/my_restart.err;
35
36 #-----------------------------------------------------------------------------
37 #
38 # 1. Hit crash point on completing drop of all indexes before creation of index
39 # is commenced.
40 #
41 --echo "1. Hit crash point on completing drop of all indexes before creation"
42 --echo " of index is commenced."
43 eval set global innodb_file_per_table = $wl6501_file_per_table;
44 set innodb_strict_mode=off;
45 --disable_warnings
46 eval create $wl6501_temp table t (
47 i int, f float, c char,
48 primary key pk(i), unique findex(f), index ck(c))
49 engine = innodb row_format = $wl6501_row_fmt
50 key_block_size = $wl6501_kbs;
51 --enable_warnings
52 insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
53 select * from t;
54 check table t;
55 #
56 set session debug = "+d,ib_trunc_crash_drop_reinit_done_create_to_start";
57 --source include/expect_crash.inc
58 --error 2013
59 truncate table t;
60 #
61 --source include/start_mysqld.inc
62 check table t;
63
64 #-----------------------------------------------------------------------------
65 #
66 # 2. Hit crash point after data is updated to system-table and in-memory dict.
67 #
68 --echo "2. Hit crash point after data is updated to system-table and"
69 --echo " in-memory dict."
70 eval set global innodb_file_per_table = $wl6501_file_per_table;
71 set innodb_strict_mode=off;
72 --disable_warnings
73 eval create $wl6501_temp table t (
74 i int, f float, c char,
75 primary key pk(i), unique findex(f), index ck(c))
76 engine = innodb row_format = $wl6501_row_fmt
77 key_block_size = $wl6501_kbs;
78 --enable_warnings
79 insert into t values (1, 1.1, 'a'), (2, 2.2, 'b'), (3, 3.3, 'c');
80 select * from t;
81 check table t;
82 #
83 set session debug = "+d,ib_trunc_crash_on_updating_dict_sys_info";
84 --source include/expect_crash.inc
85 --error 2013
86 truncate table t;
87 #
88 --source include/start_mysqld.inc
89 check table t;
90
91 #-----------------------------------------------------------------------------
92 #
93 # remove test-bed
94 #
95 eval set global innodb_file_per_table = $per_table;