blob: d4526289504160ff43714854476a6eb72428309f (
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
set sql_mode=ansi_quotes;
create table t1 ("select" int) partition by range ("select") (partition "select" values less than maxvalue);
create table t2 (f1 int) partition by range (f1) (partition p1 values less than maxvalue);
show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"select" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE ("select")
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE "t2" (
"f1" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE ("f1")
(PARTITION "p1" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
set sql_quote_show_create=0;
show create table t1;
Table Create Table
t1 CREATE TABLE t1 (
"select" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE ("select")
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE t2 (
f1 int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (f1)
(PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
set sql_mode=default;
show create table t1;
Table Create Table
t1 CREATE TABLE t1 (
`select` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`select`)
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE t2 (
f1 int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (f1)
(PARTITION p1 VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
set sql_quote_show_create=1;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`select` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`select`)
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`f1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`f1`)
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
flush tables;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`select` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`select`)
(PARTITION `select` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`f1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE (`f1`)
(PARTITION `p1` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
set sql_mode=ansi_quotes;
show create table t1;
Table Create Table
t1 CREATE TABLE "t1" (
"select" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE ("select")
(PARTITION "select" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
show create table t2;
Table Create Table
t2 CREATE TABLE "t2" (
"f1" int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY RANGE ("f1")
(PARTITION "p1" VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
drop table t1, t2;
set sql_mode=default;
create table t_partition (f1 int) partition by hash(f1) partitions 2;
select * from t_partition as tbl;
f1
show create table t_partition;
Table Create Table
t_partition CREATE TABLE `t_partition` (
`f1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
PARTITION BY HASH (`f1`)
PARTITIONS 2
drop table t_partition;
create table t1 (a int) partition by range(a) (partition p0 values less than (5));
set sql_mode='ansi_quotes';
alter table t1 add partition (partition p1 values less than (10));
set sql_mode= default;
show table status;
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
t1 MyISAM 10 Fixed 0 0 0 0 2048 0 NULL X X NULL latin1_swedish_ci NULL partitioned 0 N
drop table t1;
|