Debian Codegraph @

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

raw
1 #
2 # This testcase checks if tablespace removal is handled correctly
3 # during recovery. Assumption is file per table.
4 #
5 # Crash between MLOG_FILE_RENAME is written to redo and the file is removed.
6
7 --source include/not_valgrind.inc
8
9 # the DBUG_EXECUTE_IF() macro needs a debug server.
10 --source include/have_debug.inc
11
12 --disable_query_log
13 # These values can change during the test
14 LET $innodb_file_per_table_orig=`select @@innodb_file_per_table`;
15
16
17 --enable_query_log
18
19 SET GLOBAL innodb_file_per_table=ON;
20
21
22 --echo #
23 --echo # Disable page cleaners and prevent page flushing/checkpointing.
24 --echo #
25 --source ../include/log_disable_page_cleaners.inc
26
27 --echo #
28 --echo # Prepare tablespace and fill in some data.
29 --echo #
30
31 CREATE TABLE t1(a INT);
32 INSERT INTO t1 VALUES (1),(2),(3),(4);
33 INSERT INTO t1 VALUES (1),(2),(3),(4);
34 INSERT INTO t1 VALUES (1),(2),(3),(4);
35 INSERT INTO t1 VALUES (1),(2),(3),(4);
36 INSERT INTO t1 VALUES (1),(2),(3),(4);
37 INSERT INTO t1 VALUES (1),(2),(3),(4);
38 INSERT INTO t1 VALUES (1),(2),(3),(4);
39 INSERT INTO t1 VALUES (1),(2),(3),(4);
40 INSERT INTO t1 VALUES (1),(2),(3),(4);
41 INSERT INTO t1 SELECT * FROM t1;
42 INSERT INTO t1 SELECT * FROM t1;
43 INSERT INTO t1 SELECT * FROM t1;
44 INSERT INTO t1 SELECT * FROM t1;
45
46
47 --echo #
48 --echo # Spam the redolog to force the previous data to be applied.
49 --echo # We set 5MB Buffer Pool, so around that many redologs is required. One
50 --echo # spam iteration will provide 400KB of log.
51 --echo #
52 --source include/ib_log_spammer_init.inc
53 CALL log_spam(13);
54
55
56 --echo #
57 --echo # Drop tablespace now. After the crash, the previous log apply would
58 --echo # make the t1 tablespace be opened for recovery. Later, during the scan
59 --echo # of a next redo block, we would close it.
60 --echo #
61
62 --source include/expect_crash.inc
63 SET DEBUG='+d, space_delete_crash';
64 --error CR_SERVER_LOST
65 DROP TABLE t1;
66 --source include/wait_until_disconnected.inc
67 --source include/start_mysqld.inc
68
69 --echo #
70 --echo # Cleanup
71 --echo #
72
73 --source include/ib_log_spammer_cleanup.inc
74
75 -- disable_query_log
76 eval set global innodb_file_per_table=$innodb_file_per_table_orig;
77 -- enable_query_log