| 1 |
set sql_mode=ansi_quotes; |
| 2 |
create table t1 ("select" int) partition by range ("select") (partition "select" values less than maxvalue); |
| 3 |
create table t2 (f1 int) partition by range (f1) (partition p1 values less than maxvalue); |
| 4 |
show create table t1; |
| 5 |
Table Create Table |
| 6 |
t1 CREATE TABLE "t1" ( |
| 7 |
"select" int(11) DEFAULT NULL |
| 8 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 9 |
PARTITION BY RANGE ("select") |
| 10 |
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 11 |
show create table t2; |
| 12 |
Table Create Table |
| 13 |
t2 CREATE TABLE "t2" ( |
| 14 |
"f1" int(11) DEFAULT NULL |
| 15 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 16 |
PARTITION BY RANGE ("f1") |
| 17 |
(PARTITION "p1" VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 18 |
set sql_quote_show_create=0; |
| 19 |
show create table t1; |
| 20 |
Table Create Table |
| 21 |
t1 CREATE TABLE t1 ( |
| 22 |
"select" int(11) DEFAULT NULL |
| 23 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 24 |
PARTITION BY RANGE ("select") |
| 25 |
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 26 |
show create table t2; |
| 27 |
Table Create Table |
| 28 |
t2 CREATE TABLE t2 ( |
| 29 |
f1 int(11) DEFAULT NULL |
| 30 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 31 |
PARTITION BY RANGE (f1) |
| 32 |
(PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 33 |
set sql_mode=default; |
| 34 |
show create table t1; |
| 35 |
Table Create Table |
| 36 |
t1 CREATE TABLE t1 ( |
| 37 |
`select` int(11) DEFAULT NULL |
| 38 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 39 |
PARTITION BY RANGE (`select`) |
| 40 |
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 41 |
show create table t2; |
| 42 |
Table Create Table |
| 43 |
t2 CREATE TABLE t2 ( |
| 44 |
f1 int(11) DEFAULT NULL |
| 45 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 46 |
PARTITION BY RANGE (f1) |
| 47 |
(PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 48 |
set sql_quote_show_create=1; |
| 49 |
show create table t1; |
| 50 |
Table Create Table |
| 51 |
t1 CREATE TABLE `t1` ( |
| 52 |
`select` int(11) DEFAULT NULL |
| 53 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 54 |
PARTITION BY RANGE (`select`) |
| 55 |
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 56 |
show create table t2; |
| 57 |
Table Create Table |
| 58 |
t2 CREATE TABLE `t2` ( |
| 59 |
`f1` int(11) DEFAULT NULL |
| 60 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 61 |
PARTITION BY RANGE (`f1`) |
| 62 |
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 63 |
flush tables; |
| 64 |
show create table t1; |
| 65 |
Table Create Table |
| 66 |
t1 CREATE TABLE `t1` ( |
| 67 |
`select` int(11) DEFAULT NULL |
| 68 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 69 |
PARTITION BY RANGE (`select`) |
| 70 |
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 71 |
show create table t2; |
| 72 |
Table Create Table |
| 73 |
t2 CREATE TABLE `t2` ( |
| 74 |
`f1` int(11) DEFAULT NULL |
| 75 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 76 |
PARTITION BY RANGE (`f1`) |
| 77 |
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 78 |
set sql_mode=ansi_quotes; |
| 79 |
show create table t1; |
| 80 |
Table Create Table |
| 81 |
t1 CREATE TABLE "t1" ( |
| 82 |
"select" int(11) DEFAULT NULL |
| 83 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 84 |
PARTITION BY RANGE ("select") |
| 85 |
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 86 |
show create table t2; |
| 87 |
Table Create Table |
| 88 |
t2 CREATE TABLE "t2" ( |
| 89 |
"f1" int(11) DEFAULT NULL |
| 90 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 91 |
PARTITION BY RANGE ("f1") |
| 92 |
(PARTITION "p1" VALUES LESS THAN MAXVALUE ENGINE = MyISAM) |
| 93 |
drop table t1, t2; |
| 94 |
set sql_mode=default; |
| 95 |
create table t_partition (f1 int) partition by hash(f1) partitions 2; |
| 96 |
select * from t_partition as tbl; |
| 97 |
f1 |
| 98 |
show create table t_partition; |
| 99 |
Table Create Table |
| 100 |
t_partition CREATE TABLE `t_partition` ( |
| 101 |
`f1` int(11) DEFAULT NULL |
| 102 |
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 103 |
PARTITION BY HASH (`f1`) |
| 104 |
PARTITIONS 2 |
| 105 |
drop table t_partition; |
| 106 |
create table t1 (a int) partition by range(a) (partition p0 values less than (5)); |
| 107 |
set sql_mode='ansi_quotes'; |
| 108 |
alter table t1 add partition (partition p1 values less than (10)); |
| 109 |
set sql_mode= default; |
| 110 |
show table status; |
| 111 |
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary |
| 112 |
t1 MyISAM 10 Fixed 0 0 0 0 2048 0 NULL X X NULL utf8mb4_uca1400_ai_ci NULL partitioned 0 N |
| 113 |
drop table t1; |