Debian Codegraph @

mysql-test/suite/innodb/t/partition-16k.test

raw
1 # TODO : Enable following once shared tablespaces are allowed in Partitioned
2 # Tables (wl#12034).
3 # --echo #
4 # --echo # Removing partitioning would not change the table level tablespace
5 # --echo #
6
7 # CREATE TABLE t1 (col1 INT)
8 # ENGINE = InnoDB PARTITION BY KEY(col1) PARTITIONS 3;
9 # ALTER TABLE t1 ROW_FORMAT = COMPRESSED TABLESPACE innodb_system;
10 # --error ER_ILLEGAL_HA_CREATE_OPTION
11 # ALTER TABLE t1 REMOVE PARTITIONING;
12 # DROP TABLE t1;
13
14
15 --echo # Check if non-strict mode can work when there is implicit row format change
16
17 CREATE TABLE t1 (a INT, b INT, key(a)) ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=2 PARTITION BY RANGE (a % 7) (PARTITION p1 VALUES LESS THAN(1), PARTITION p2 VALUES LESS THAN (2), PARTITION p3 VALUES LESS THAN (5), PARTITION p4 VALUES LESS THAN(MAXVALUE));
18
19 SHOW CREATE TABLE t1;
20
21 SET @orig_innodb_file_per_table= @@innodb_file_per_table;
22 SET GLOBAL innodb_file_per_table = 0;
23 SET @save_innodb_strict_mode=@@session.innodb_strict_mode;
24 SET SESSION innodb_strict_mode = 0;
25
26 ALTER TABLE t1 REORGANIZE PARTITION p1, p2 INTO (PARTITION p1 VALUES LESS THAN(2));
27
28 SHOW CREATE TABLE t1;
29
30 DROP TABLE t1;
31
32 SET GLOBAL innodb_file_per_table = @orig_innodb_file_per_table;
33 SET SESSION innodb_strict_mode=@save_innodb_strict_mode;
34
35
36 --echo #
37 --echo # This checks after ALTER TABLE ... COPY which changes the row format,
38 --echo # it should still work
39 --echo #
40
41 SET @orig_innodb_file_per_table= @@innodb_file_per_table;
42 SET @save_innodb_strict_mode=@@session.innodb_strict_mode;
43
44 CREATE TABLE t1 (a INT NOT NULL, c VARCHAR(186), INDEX(c(99))) ENGINE = InnoDB ROW_FORMAT = COMPRESSED KEY_BLOCK_SIZE = 16 PARTITION BY LINEAR KEY(c) PARTITIONS 3;
45
46 SET GLOBAL innodb_file_per_table = 0;
47 SET SESSION innodb_strict_mode = 0;
48
49 ALTER TABLE t1 PARTITION BY LINEAR KEY(c) PARTITIONS 3;
50
51 SET GLOBAL innodb_file_per_table = @orig_innodb_file_per_table;
52 SET SESSION innodb_strict_mode=@save_innodb_strict_mode;
53
54 --source include/restart_mysqld.inc
55
56 SHOW CREATE TABLE t1;
57 SELECT * FROM t1;
58
59 DROP TABLE t1;
60