@@ -10,9 +10,9 @@ partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
1010select * from information_schema.partitions where table_schema="test"
1111and table_name="t1";
1212TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
13- def test t1 x1 NULL 1 NULL LIST NULL b*a NULL 1 0 0 16384 # 0 0 # # NULL NULL default ts1
14- def test t1 x2 NULL 2 NULL LIST NULL b*a NULL 3,11,5,7 0 0 16384 # 0 0 # # NULL NULL default ts2
15- def test t1 x3 NULL 3 NULL LIST NULL b*a NULL 16,8,24,27 0 0 16384 # 0 0 # # NULL NULL default ts3
13+ def test t1 x1 NULL 1 NULL LIST NULL (`b` * `a`) NULL 1 0 0 16384 # 0 0 # # NULL NULL default ts1
14+ def test t1 x2 NULL 2 NULL LIST NULL (`b` * `a`) NULL 3,11,5,7 0 0 16384 # 0 0 # # NULL NULL default ts2
15+ def test t1 x3 NULL 3 NULL LIST NULL (`b` * `a`) NULL 16,8,24,27 0 0 16384 # 0 0 # # NULL NULL default ts3
1616create table t2 (a int not null,b int not null,c int not null, primary key(a,b))
1717partition by range (a)
1818partitions 3
@@ -22,18 +22,18 @@ partition x3 values less than maxvalue tablespace ts3);
2222select * from information_schema.partitions where table_schema="test"
2323and table_name="t2";
2424TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
25- def test t2 x1 NULL 1 NULL RANGE NULL a NULL 5 0 0 16384 # 0 0 # # NULL NULL default ts1
26- def test t2 x2 NULL 2 NULL RANGE NULL a NULL 10 0 0 16384 # 0 0 # # NULL NULL default ts2
27- def test t2 x3 NULL 3 NULL RANGE NULL a NULL MAXVALUE 0 0 16384 # 0 0 # # NULL NULL default ts3
25+ def test t2 x1 NULL 1 NULL RANGE NULL `a` NULL 5 0 0 16384 # 0 0 # # NULL NULL default ts1
26+ def test t2 x2 NULL 2 NULL RANGE NULL `a` NULL 10 0 0 16384 # 0 0 # # NULL NULL default ts2
27+ def test t2 x3 NULL 3 NULL RANGE NULL `a` NULL MAXVALUE 0 0 16384 # 0 0 # # NULL NULL default ts3
2828create table t3 (f1 date)
2929partition by hash(month(f1))
3030partitions 3;
3131select * from information_schema.partitions where table_schema="test"
3232and table_name="t3";
3333TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
34- def test t3 p0 NULL 1 NULL HASH NULL month(f1 ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
35- def test t3 p1 NULL 2 NULL HASH NULL month(f1 ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
36- def test t3 p2 NULL 3 NULL HASH NULL month(f1 ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
34+ def test t3 p0 NULL 1 NULL HASH NULL month(`f1` ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
35+ def test t3 p1 NULL 2 NULL HASH NULL month(`f1` ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
36+ def test t3 p2 NULL 3 NULL HASH NULL month(`f1` ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
3737create table t4 (f1 date, f2 int)
3838partition by key(f1,f2)
3939partitions 3;
@@ -68,14 +68,14 @@ subpartition x22 tablespace tbsp2)
6868);
6969select * from information_schema.partitions where table_schema="test";
7070TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
71- def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 16384 # 0 0 # # NULL NULL default tbsp1
72- def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 16384 # 0 0 # # NULL NULL default tbsp2
73- def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 16384 # 0 0 # # NULL NULL default tbsp1
74- def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 16384 # 0 0 # # NULL NULL default tbsp2
75- def test t2 x1 x11 1 1 RANGE KEY a `a` 1 0 0 16384 # 0 0 # # NULL NULL default tbsp1
76- def test t2 x1 x12 1 2 RANGE KEY a `a` 1 0 0 16384 # 0 0 # # NULL NULL default tbsp2
77- def test t2 x2 x21 2 1 RANGE KEY a `a` 5 0 0 16384 # 0 0 # # NULL NULL default tbsp1
78- def test t2 x2 x22 2 2 RANGE KEY a `a` 5 0 0 16384 # 0 0 # # NULL NULL default tbsp2
71+ def test t1 x1 x11 1 1 RANGE HASH `a` (`a` + `b`) 1 0 0 16384 # 0 0 # # NULL NULL default tbsp1
72+ def test t1 x1 x12 1 2 RANGE HASH `a` (`a` + `b`) 1 0 0 16384 # 0 0 # # NULL NULL default tbsp2
73+ def test t1 x2 x21 2 1 RANGE HASH `a` (`a` + `b`) 5 0 0 16384 # 0 0 # # NULL NULL default tbsp1
74+ def test t1 x2 x22 2 2 RANGE HASH `a` (`a` + `b`) 5 0 0 16384 # 0 0 # # NULL NULL default tbsp2
75+ def test t2 x1 x11 1 1 RANGE KEY `a` `a` 1 0 0 16384 # 0 0 # # NULL NULL default tbsp1
76+ def test t2 x1 x12 1 2 RANGE KEY `a` `a` 1 0 0 16384 # 0 0 # # NULL NULL default tbsp2
77+ def test t2 x2 x21 2 1 RANGE KEY `a` `a` 5 0 0 16384 # 0 0 # # NULL NULL default tbsp1
78+ def test t2 x2 x22 2 2 RANGE KEY `a` `a` 5 0 0 16384 # 0 0 # # NULL NULL default tbsp2
7979drop table t1,t2;
8080create table t1 (
8181a int not null,
@@ -93,10 +93,10 @@ subpartition x22 tablespace tbsp2 nodegroup 1)
9393);
9494select * from information_schema.partitions where table_schema="test";
9595TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
96- def test t1 x1 x11 1 1 RANGE HASH a a+b 1 0 0 16384 # 0 0 # # NULL NULL 0 tbsp1
97- def test t1 x1 x12 1 2 RANGE HASH a a+b 1 0 0 16384 # 0 0 # # NULL NULL 1 tbsp2
98- def test t1 x2 x21 2 1 RANGE HASH a a+b 5 0 0 16384 # 0 0 # # NULL NULL 0 tbsp1
99- def test t1 x2 x22 2 2 RANGE HASH a a+b 5 0 0 16384 # 0 0 # # NULL NULL 1 tbsp2
96+ def test t1 x1 x11 1 1 RANGE HASH `a` (`a` + `b`) 1 0 0 16384 # 0 0 # # NULL NULL 0 tbsp1
97+ def test t1 x1 x12 1 2 RANGE HASH `a` (`a` + `b`) 1 0 0 16384 # 0 0 # # NULL NULL 1 tbsp2
98+ def test t1 x2 x21 2 1 RANGE HASH `a` (`a` + `b`) 5 0 0 16384 # 0 0 # # NULL NULL 0 tbsp1
99+ def test t1 x2 x22 2 2 RANGE HASH `a` (`a` + `b`) 5 0 0 16384 # 0 0 # # NULL NULL 1 tbsp2
100100show tables;
101101Tables_in_test
102102t1
@@ -112,9 +112,9 @@ partitions 3;
112112select * from information_schema.partitions where table_schema="test"
113113and table_name="t1";
114114TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PARTITION_NAME SUBPARTITION_NAME PARTITION_ORDINAL_POSITION SUBPARTITION_ORDINAL_POSITION PARTITION_METHOD SUBPARTITION_METHOD PARTITION_EXPRESSION SUBPARTITION_EXPRESSION PARTITION_DESCRIPTION TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE CREATE_TIME UPDATE_TIME CHECK_TIME CHECKSUM PARTITION_COMMENT NODEGROUP TABLESPACE_NAME
115- def test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1 ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
116- def test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1 ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
117- def test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1 ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
115+ def test t1 p0 NULL 1 NULL LINEAR HASH NULL month(`f1` ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
116+ def test t1 p1 NULL 2 NULL LINEAR HASH NULL month(`f1` ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
117+ def test t1 p2 NULL 3 NULL LINEAR HASH NULL month(`f1` ) NULL NULL 0 0 16384 # 0 0 # # NULL NULL default NULL
118118drop table t1;
119119create table t1 (a int)
120120PARTITION BY RANGE (a)
@@ -125,8 +125,8 @@ Table Create Table
125125t1 CREATE TABLE `t1` (
126126 `a` int(11) DEFAULT NULL
127127) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
128- /*!50100 PARTITION BY RANGE (a )
129- SUBPARTITION BY LINEAR HASH (a )
128+ /*!50100 PARTITION BY RANGE (`a` )
129+ SUBPARTITION BY LINEAR HASH (`a` )
130130(PARTITION p0 VALUES LESS THAN (10) ENGINE = InnoDB) */
131131select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
132132table_schema="test" AND table_name="t1";
@@ -143,7 +143,7 @@ Table Create Table
143143t1 CREATE TABLE `t1` (
144144 `a` int(11) DEFAULT NULL
145145) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
146- /*!50100 PARTITION BY LIST (a )
146+ /*!50100 PARTITION BY LIST (`a` )
147147(PARTITION p0 VALUES IN (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) ENGINE = InnoDB) */
148148SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
149149table_schema = "test" AND table_name = "t1";
0 commit comments