File: discard_tablespace.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (132 lines) | stat: -rw-r--r-- 4,081 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
--echo #
--echo # Bug #29793800 ASSERT AFTER DISCARD TABLESPACE, RENAME TABLE AND
--echo # CREATE TABLE USING SAME NAME.
--echo #

--disable_query_log
call mtr.add_suppression("\\[Warning\\] .*MY-\\d+.* Trying to access missing tablespace .*");
--enable_query_log

LET $MYSQLD_DATADIR = `select @@datadir`;
LET $INNODB_PAGE_SIZE = `select @@innodb_page_size`;

--echo # Test Case 1:
CREATE TABLE t1(b INT)ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE t1 DISCARD TABLESPACE;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE t1 RENAME t2;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

CREATE TABLE t1(c INT)ENGINE=myisam;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

alter table t1 engine=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

drop table t1;
drop table t2;

--echo # Test Case 2:
CREATE TABLE t1(b INT)ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE t1 DISCARD TABLESPACE;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE t1 RENAME t2;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

CREATE TABLE t1(c INT)ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

drop table t1;
drop table t2;

--echo # Test Case 3:

CREATE TABLE `t1/t2` (b INT, c text) ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `t1/t2` DISCARD TABLESPACE;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `t1/t2` RENAME `t3\t4\t5`;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

drop table `t3\t4\t5`;

--echo # Test Case 4:

create database `d1/d2\d3`;
use `d1/d2\d3`;

CREATE TABLE `t1/t2\t3` (b INT, c text) ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `t1/t2\t3` DISCARD TABLESPACE;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `t1/t2\t3` RENAME `t3\t4/t5`;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

drop table `t3\t4/t5`;
drop database `d1/d2\d3`;

--echo # Test Case 5:

create database `d1/d2\d3`;
create database `d4/d5\d6`;

CREATE TABLE `d1/d2\d3`.`t1/t2\t3` (b INT, c text) ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `d1/d2\d3`.`t1/t2\t3` DISCARD TABLESPACE;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `d1/d2\d3`.`t1/t2\t3` RENAME `d4/d5\d6`.`t3\t4/t5`;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

drop table `d4/d5\d6`.`t3\t4/t5`;
drop database `d1/d2\d3`;
drop database `d4/d5\d6`;

--echo # Test Case 6:
create database `d1/d2`;
create database `d1`;

CREATE TABLE `d1/d2`.`t1/t2` (b INT, c text) ENGINE=innodb;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `d1/d2`.`t1/t2` DISCARD TABLESPACE;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

ALTER TABLE `d1/d2`.`t1/t2` RENAME `d1`.`d2/t1/t2`;
--source suite/innodb/include/show_i_s_tables.inc
--source suite/innodb/include/show_i_s_tablespaces.inc

drop table `d1`.`d2/t1/t2`;
drop database `d1/d2`;
drop database `d1`;