blob: 62b7adf75f822150dd82af8b66c2064a6c45688c (
plain)
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
|
CREATE TABLE t1(i INT) ENGINE INNODB
PARTITION BY RANGE (i)
(PARTITION p1 VALUES LESS THAN (100),
PARTITION p2 VALUES LESS THAN (200),
PARTITION p3 VALUES LESS THAN (300),
PARTITION p4 VALUES LESS THAN (400));
INSERT INTO t1 VALUES (1), (101), (201), (301);
# xtrabackup backup
INSERT INTO t1 VALUES (1), (101), (201), (301);
# xtrabackup prepare
CREATE TABLE t1_placeholder (i INT) ENGINE INNODB;
ALTER TABLE t1_placeholder DISCARD TABLESPACE;
ALTER TABLE t1_placeholder IMPORT TABLESPACE;
ALTER TABLE t1 EXCHANGE PARTITION p4 WITH TABLE t1_placeholder;
ALTER TABLE t1_placeholder DISCARD TABLESPACE;
ALTER TABLE t1_placeholder IMPORT TABLESPACE;
ALTER TABLE t1 EXCHANGE PARTITION p3 WITH TABLE t1_placeholder;
ALTER TABLE t1_placeholder DISCARD TABLESPACE;
ALTER TABLE t1_placeholder IMPORT TABLESPACE;
ALTER TABLE t1 EXCHANGE PARTITION p2 WITH TABLE t1_placeholder;
ALTER TABLE t1_placeholder DISCARD TABLESPACE;
ALTER TABLE t1_placeholder IMPORT TABLESPACE;
ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t1_placeholder;
SELECT * FROM t1;
i
1
101
201
301
DROP TABLE t1;
DROP TABLE t1_placeholder;
|