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
|
CREATE TABLE t1 (c INT AUTO_INCREMENT NULL UNIQUE) ENGINE=InnoDB;
ALTER TABLE t1 MODIFY c INT NULL, ALGORITHM=INSTANT;
INSERT INTO t1 SET c=1;
CREATE TABLE t2 (c INT AUTO_INCREMENT NULL UNIQUE) ENGINE=InnoDB;
ALTER TABLE t2 MODIFY c INT NULL, FORCE, ALGORITHM=INPLACE;
INSERT INTO t2 SET c=1;
CREATE TABLE t3 (c INT AUTO_INCREMENT NULL UNIQUE) ENGINE=InnoDB;
ALTER TABLE t3 MODIFY c INT NULL, ALGORITHM=INPLACE;
INSERT INTO t3 SET c=1;
CREATE TABLE t4 (c1 INT AUTO_INCREMENT NULL UNIQUE, c2 INT) ENGINE=InnoDB;
ALTER TABLE t4 MODIFY c1 INT NULL, CHANGE COLUMN c2 c3 INT, ALGORITHM=INPLACE;
INSERT INTO t4 SET c1=1;
CREATE TABLE t5 (c1 INT AUTO_INCREMENT NULL UNIQUE, c2 INT, c3 INTEGER GENERATED ALWAYS AS (c2)) ENGINE=InnoDB;
ALTER TABLE t5 MODIFY c1 INT NULL, MODIFY COLUMN c2 INT FIRST, ALGORITHM=INPLACE;
INSERT INTO t5 SET c1=1;
CREATE TABLE t6 (c INT AUTO_INCREMENT NULL UNIQUE) ENGINE=InnoDB
PARTITION BY LIST(c) (
PARTITION p1 VALUES IN (1),
PARTITION p2 VALUES IN (2)
);
ALTER TABLE t6 MODIFY c INT NULL, ALGORITHM=INSTANT;
INSERT INTO t6 SET c=1;
INSERT INTO t6 SET c=2;
CREATE TABLE t7 (c INT AUTO_INCREMENT NULL UNIQUE) ENGINE=InnoDB
PARTITION BY LIST(c) (
PARTITION p1 VALUES IN (1),
PARTITION p2 VALUES IN (2)
);
ALTER TABLE t7 MODIFY c INT NULL, ALGORITHM=INPLACE;
INSERT INTO t7 SET c=1;
INSERT INTO t7 SET c=2;
CREATE TABLE t8 (c1 INT AUTO_INCREMENT NULL UNIQUE, c2 INT) ENGINE=InnoDB
PARTITION BY LIST(c1) (
PARTITION p1 VALUES IN (1), PARTITION p2 VALUES IN (2));
ALTER TABLE t8 MODIFY c1 INT NULL, CHANGE COLUMN c2 c3 INT, ALGORITHM=INPLACE;
INSERT INTO t8 SET c1=1;
INSERT INTO t8 SET c1=2;
FLUSH TABLES t1, t2, t3, t4, t5, t6, t7, t8 FOR EXPORT;
AUTO_INCREMENT not partitioned: 0 0 0 0 0
AUTO_INCREMENT partitioned: (0, 0) (0, 0) (0, 0)
UNLOCK TABLES;
DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
|