Debian Codegraph @

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

raw
1 --echo #
2 --echo # Bug #29793800 ASSERT AFTER DISCARD TABLESPACE, RENAME TABLE AND
3 --echo # CREATE TABLE USING SAME NAME.
4 --echo #
5
6 --disable_query_log
7 call mtr.add_suppression("\\[Warning\\] .*MY-\\d+.* Trying to access missing tablespace .*");
8 --enable_query_log
9
10 LET $MYSQLD_DATADIR = `select @@datadir`;
11 LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;
12
13 --echo # Test Case 1:
14 CREATE TABLE t1(b INT)ENGINE=innodb;
15 --source suite/innodb/include/show_i_s_tables.inc
16 --source suite/innodb/include/show_i_s_tablespaces.inc
17
18 ALTER TABLE t1 DISCARD TABLESPACE;
19 --source suite/innodb/include/show_i_s_tables.inc
20 --source suite/innodb/include/show_i_s_tablespaces.inc
21
22 ALTER TABLE t1 RENAME t2;
23 --source suite/innodb/include/show_i_s_tables.inc
24 --source suite/innodb/include/show_i_s_tablespaces.inc
25
26 CREATE TABLE t1(c INT)ENGINE=myisam;
27 --source suite/innodb/include/show_i_s_tables.inc
28 --source suite/innodb/include/show_i_s_tablespaces.inc
29
30 alter table t1 engine=innodb;
31 --source suite/innodb/include/show_i_s_tables.inc
32 --source suite/innodb/include/show_i_s_tablespaces.inc
33
34 drop table t1;
35 drop table t2;
36
37 --echo # Test Case 2:
38 CREATE TABLE t1(b INT)ENGINE=innodb;
39 --source suite/innodb/include/show_i_s_tables.inc
40 --source suite/innodb/include/show_i_s_tablespaces.inc
41
42 ALTER TABLE t1 DISCARD TABLESPACE;
43 --source suite/innodb/include/show_i_s_tables.inc
44 --source suite/innodb/include/show_i_s_tablespaces.inc
45
46 ALTER TABLE t1 RENAME t2;
47 --source suite/innodb/include/show_i_s_tables.inc
48 --source suite/innodb/include/show_i_s_tablespaces.inc
49
50 CREATE TABLE t1(c INT)ENGINE=innodb;
51 --source suite/innodb/include/show_i_s_tables.inc
52 --source suite/innodb/include/show_i_s_tablespaces.inc
53
54 drop table t1;
55 drop table t2;
56
57 --echo # Test Case 3:
58
59 CREATE TABLE `t1/t2` (b INT, c text) ENGINE=innodb;
60 --source suite/innodb/include/show_i_s_tables.inc
61 --source suite/innodb/include/show_i_s_tablespaces.inc
62
63 ALTER TABLE `t1/t2` DISCARD TABLESPACE;
64 --source suite/innodb/include/show_i_s_tables.inc
65 --source suite/innodb/include/show_i_s_tablespaces.inc
66
67 ALTER TABLE `t1/t2` RENAME `t3\t4\t5`;
68 --source suite/innodb/include/show_i_s_tables.inc
69 --source suite/innodb/include/show_i_s_tablespaces.inc
70
71 drop table `t3\t4\t5`;
72
73 --echo # Test Case 4:
74
75 create database `d1/d2\d3`;
76 use `d1/d2\d3`;
77
78 CREATE TABLE `t1/t2\t3` (b INT, c text) ENGINE=innodb;
79 --source suite/innodb/include/show_i_s_tables.inc
80 --source suite/innodb/include/show_i_s_tablespaces.inc
81
82 ALTER TABLE `t1/t2\t3` DISCARD TABLESPACE;
83 --source suite/innodb/include/show_i_s_tables.inc
84 --source suite/innodb/include/show_i_s_tablespaces.inc
85
86 ALTER TABLE `t1/t2\t3` RENAME `t3\t4/t5`;
87 --source suite/innodb/include/show_i_s_tables.inc
88 --source suite/innodb/include/show_i_s_tablespaces.inc
89
90 drop table `t3\t4/t5`;
91 drop database `d1/d2\d3`;
92
93 --echo # Test Case 5:
94
95 create database `d1/d2\d3`;
96 create database `d4/d5\d6`;
97
98 CREATE TABLE `d1/d2\d3`.`t1/t2\t3` (b INT, c text) ENGINE=innodb;
99 --source suite/innodb/include/show_i_s_tables.inc
100 --source suite/innodb/include/show_i_s_tablespaces.inc
101
102 ALTER TABLE `d1/d2\d3`.`t1/t2\t3` DISCARD TABLESPACE;
103 --source suite/innodb/include/show_i_s_tables.inc
104 --source suite/innodb/include/show_i_s_tablespaces.inc
105
106 ALTER TABLE `d1/d2\d3`.`t1/t2\t3` RENAME `d4/d5\d6`.`t3\t4/t5`;
107 --source suite/innodb/include/show_i_s_tables.inc
108 --source suite/innodb/include/show_i_s_tablespaces.inc
109
110 drop table `d4/d5\d6`.`t3\t4/t5`;
111 drop database `d1/d2\d3`;
112 drop database `d4/d5\d6`;
113
114 --echo # Test Case 6:
115 create database `d1/d2`;
116 create database `d1`;
117
118 CREATE TABLE `d1/d2`.`t1/t2` (b INT, c text) ENGINE=innodb;
119 --source suite/innodb/include/show_i_s_tables.inc
120 --source suite/innodb/include/show_i_s_tablespaces.inc
121
122 ALTER TABLE `d1/d2`.`t1/t2` DISCARD TABLESPACE;
123 --source suite/innodb/include/show_i_s_tables.inc
124 --source suite/innodb/include/show_i_s_tablespaces.inc
125
126 ALTER TABLE `d1/d2`.`t1/t2` RENAME `d1`.`d2/t1/t2`;
127 --source suite/innodb/include/show_i_s_tables.inc
128 --source suite/innodb/include/show_i_s_tablespaces.inc
129
130 drop table `d1`.`d2/t1/t2`;
131 drop database `d1/d2`;
132 drop database `d1`;