1
-- source include/have_partition.inc
3
drop table if exists t1;
6
create table t1 (col1 datetime)
7
partition by range(datediff(col1,col1))
8
(partition p0 values less than (10), partition p1 values less than (30));
11
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
12
create table t1 (col1 int)
13
partition by range(greatest(col1,10))
14
(partition p0 values less than (2), partition p1 values less than (6));
16
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
17
create table t1 (col1 int)
18
partition by range(isnull(col1))
19
(partition p0 values less than (2), partition p1 values less than (6));
21
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
22
create table t1 (col1 int)
23
partition by range(least(col1,12))
24
(partition p0 values less than (2), partition p1 values less than (6));
26
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
27
create table t1 (col1 int)
28
partition by range(case when col1>0 then 10 else 20 end)
29
(partition p0 values less than (2), partition p1 values less than (6));
31
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
32
create table t1 (col1 int)
33
partition by range(ifnull(col1,5))
34
(partition p0 values less than (2), partition p1 values less than (6));
36
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
37
create table t1 (col1 int)
38
partition by range(nullif(col1,5))
39
(partition p0 values less than (2), partition p1 values less than (6));
41
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
42
create table t1 (col1 int)
43
partition by range(bit_length(col1))
44
(partition p0 values less than (2), partition p1 values less than (6));
46
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
47
create table t1 (col1 char(5))
48
partition by range(bit_length(col1))
49
(partition p0 values less than (2), partition p1 values less than (6));
51
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
52
create table t1 (col1 int)
53
partition by range(char_length(col1))
54
(partition p0 values less than (2), partition p1 values less than (6));
56
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
57
create table t1 (col1 char(5))
58
partition by range(char_length(col1))
59
(partition p0 values less than (2), partition p1 values less than (6));
61
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
62
create table t1 (col1 char(5))
63
partition by range(character_length(col1))
64
(partition p0 values less than (2), partition p1 values less than (6));
66
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
67
create table t1 (col1 int)
68
partition by range(find_in_set(col1,1))
69
(partition p0 values less than (2), partition p1 values less than (6));
71
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
72
create table t1 (col1 char(5))
73
partition by range(find_in_set(col1,'1'))
74
(partition p0 values less than (2), partition p1 values less than (6));
76
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
77
create table t1 (col1 int)
78
partition by range(instr(col1,3))
79
(partition p0 values less than (2), partition p1 values less than (6));
81
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
82
create table t1 (col1 char(5))
83
partition by range(instr(col1,'3'))
84
(partition p0 values less than (2), partition p1 values less than (6));
86
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
87
create table t1 (col1 char(5))
88
partition by range(length(col1))
89
(partition p0 values less than (2), partition p1 values less than (6));
91
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
92
create table t1 (col1 char(5))
93
partition by range(locate(1,col1))
94
(partition p0 values less than (2), partition p1 values less than (6));
96
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
97
create table t1 (col1 int)
98
partition by range(locate(1,col1))
99
(partition p0 values less than (2), partition p1 values less than (6));
101
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
102
create table t1 (col1 char(5))
103
partition by range(octet_length(col1))
104
(partition p0 values less than (2), partition p1 values less than (6));
106
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
107
create table t1 (col1 char(5))
108
partition by range(position(1 in col1))
109
(partition p0 values less than (2), partition p1 values less than (6));
111
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
112
create table t1 (col1 int)
113
partition by range(position(1 in col1))
114
(partition p0 values less than (2), partition p1 values less than (6));
116
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
117
create table t1 (col1 char(5))
118
partition by range(strcmp(col1,2))
119
(partition p0 values less than (2), partition p1 values less than (6));
121
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
122
create table t1 (col1 int)
123
partition by range(strcmp(col1,2))
124
(partition p0 values less than (2), partition p1 values less than (6));
126
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
127
create table t1 (col1 int)
128
partition by range(crc32(col1))
129
(partition p0 values less than (2), partition p1 values less than (6));
131
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
132
create table t1 (col1 int)
133
partition by range(round(col1))
134
(partition p0 values less than (2), partition p1 values less than (6));
136
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
137
create table t1 (col1 int)
138
partition by range(sign(col1))
139
(partition p0 values less than (2), partition p1 values less than (6));
141
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
142
create table t1 (col1 datetime)
143
partition by range(period_add(col1,5))
144
(partition p0 values less than (10), partition p1 values less than (30));
146
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
147
create table t1 (col1 datetime, col2 datetime)
148
partition by range(period_diff(col1,col2))
149
(partition p0 values less than (10), partition p1 values less than (30));
151
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
152
create table t1 (col1 int, col2 int)
153
partition by range(period_diff(col1,col2))
154
(partition p0 values less than (10), partition p1 values less than (30));
156
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
157
create table t1 (col1 datetime)
158
partition by range(timestampdiff(day,5,col1))
159
(partition p0 values less than (10), partition p1 values less than (30));
161
-- error ER_WRONG_EXPR_IN_PARTITION_FUNC_ERROR
162
create table t1 (col1 date)
163
partition by range(unix_timestamp(col1))
164
(partition p0 values less than (10), partition p1 values less than (30));
166
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
167
create table t1 (col1 datetime)
168
partition by range(week(col1))
169
(partition p0 values less than (10), partition p1 values less than (30));
171
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
172
create table t1 (col1 varchar(25))
173
partition by range(cast(col1 as signed))
174
(partition p0 values less than (10), partition p1 values less than (30));
176
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
177
create table t1 (col1 varchar(25))
178
partition by range(convert(col1,unsigned))
179
(partition p0 values less than (10), partition p1 values less than (30));
181
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
182
create table t1 (col1 int)
183
partition by range(col1 | 20)
184
(partition p0 values less than (10), partition p1 values less than (30));
186
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
187
create table t1 (col1 int)
188
partition by range(col1 & 20)
189
(partition p0 values less than (10), partition p1 values less than (30));
191
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
192
create table t1 (col1 int)
193
partition by range(col1 ^ 20)
194
(partition p0 values less than (10), partition p1 values less than (30));
196
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
197
create table t1 (col1 int)
198
partition by range(col1 << 20)
199
(partition p0 values less than (10), partition p1 values less than (30));
201
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
202
create table t1 (col1 int)
203
partition by range(col1 >> 20)
204
(partition p0 values less than (10), partition p1 values less than (30));
206
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
207
create table t1 (col1 int)
208
partition by range(~col1)
209
(partition p0 values less than (10), partition p1 values less than (30));
211
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
212
create table t1 (col1 int)
213
partition by range(bit_count(col1))
214
(partition p0 values less than (10), partition p1 values less than (30));
216
-- error ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
217
create table t1 (col1 int)
218
partition by range(inet_aton(col1))
219
(partition p0 values less than (10), partition p1 values less than (30));