mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / r / partition_error.result
blobe5ac1371a9b7954afa134896e8673345228e7631
1 drop table if exists t1;
3 # Bug#57924: crash when creating partitioned table with
4 #            multiple columns in the partition key
6 CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
7 PARTITION BY KEY(a, b, a);
8 ERROR HY000: Field in list of fields for partition function not found in table
9 CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
10 PARTITION BY KEY(A, b);
11 DROP TABLE t1;
12 CREATE TABLE t1 (a INT, b INT, PRIMARY KEY (a,b))
13 PARTITION BY KEY(a, b, A);
14 ERROR HY000: Field in list of fields for partition function not found in table
16 # Bug#54483: valgrind errors when making warnings for multiline inserts
17 #            into partition
19 CREATE TABLE t1 (a VARBINARY(10))
20 PARTITION BY RANGE (DAYOFWEEK(a))
21 (PARTITION a1 VALUES LESS THAN (60));
22 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
23 CREATE TABLE t1 (a CHAR(10))
24 PARTITION BY RANGE (DAYOFWEEK(a))
25 (PARTITION a1 VALUES LESS THAN (60));
26 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
27 CREATE TABLE t1 (a VARCHAR(10))
28 PARTITION BY RANGE (DAYOFWEEK(a))
29 (PARTITION a1 VALUES LESS THAN (60));
30 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
31 CREATE TABLE t1 (a TIMESTAMP)
32 PARTITION BY RANGE (DAYOFWEEK(a))
33 (PARTITION a1 VALUES LESS THAN (60));
34 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
35 CREATE TABLE t1 (a DATE)
36 PARTITION BY RANGE (DAYOFWEEK(a))
37 (PARTITION a1 VALUES LESS THAN (60));
38 INSERT INTO t1 VALUES ('test'),('a'),('5');
39 Warnings:
40 Warning 1265    Data truncated for column 'a' at row 1
41 Warning 1265    Data truncated for column 'a' at row 2
42 Warning 1265    Data truncated for column 'a' at row 3
43 SHOW WARNINGS;
44 Level   Code    Message
45 Warning 1265    Data truncated for column 'a' at row 1
46 Warning 1265    Data truncated for column 'a' at row 2
47 Warning 1265    Data truncated for column 'a' at row 3
48 DROP TABLE t1;
49 CREATE TABLE t1 (a DATETIME)
50 PARTITION BY RANGE (DAYOFWEEK(a))
51 (PARTITION a1 VALUES LESS THAN (60));
52 INSERT INTO t1 VALUES ('test'),('a'),('5');
53 Warnings:
54 Warning 1264    Out of range value for column 'a' at row 1
55 Warning 1264    Out of range value for column 'a' at row 2
56 Warning 1264    Out of range value for column 'a' at row 3
57 SHOW WARNINGS;
58 Level   Code    Message
59 Warning 1264    Out of range value for column 'a' at row 1
60 Warning 1264    Out of range value for column 'a' at row 2
61 Warning 1264    Out of range value for column 'a' at row 3
62 DROP TABLE t1;
63 CREATE TABLE t1 (a TIME)
64 PARTITION BY RANGE (DAYOFWEEK(a))
65 (PARTITION a1 VALUES LESS THAN (60));
66 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
67 SHOW WARNINGS;
68 Level   Code    Message
69 Error   1486    Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
70 CREATE TABLE t1 (a TIME)
71 PARTITION BY HASH (TO_DAYS(a));
72 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
73 CREATE TABLE t1 (a DATE)
74 PARTITION BY HASH (TO_DAYS(a));
75 DROP TABLE t1;
76 CREATE TABLE t1 (a DATETIME)
77 PARTITION BY HASH (TO_DAYS(a));
78 DROP TABLE t1;
79 CREATE TABLE t1 (a VARCHAR(10))
80 PARTITION BY HASH (TO_DAYS(a));
81 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
82 CREATE TABLE t1 (a INT)
83 PARTITION BY HASH (TO_DAYS(a));
84 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
85 CREATE TABLE t1 (a TIME)
86 PARTITION BY HASH (DAYOFMONTH(a));
87 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
88 CREATE TABLE t1 (a DATE)
89 PARTITION BY HASH (DAYOFMONTH(a));
90 DROP TABLE t1;
91 CREATE TABLE t1 (a DATETIME)
92 PARTITION BY HASH (DAYOFMONTH(a));
93 DROP TABLE t1;
94 CREATE TABLE t1 (a VARCHAR(10))
95 PARTITION BY HASH (DAYOFMONTH(a));
96 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
97 CREATE TABLE t1 (a INT)
98 PARTITION BY HASH (DAYOFMONTH(a));
99 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
100 CREATE TABLE t1 (a TIME)
101 PARTITION BY HASH (MONTH(a));
102 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
103 CREATE TABLE t1 (a DATE)
104 PARTITION BY HASH (MONTH(a));
105 DROP TABLE t1;
106 CREATE TABLE t1 (a DATETIME)
107 PARTITION BY HASH (MONTH(a));
108 DROP TABLE t1;
109 CREATE TABLE t1 (a VARCHAR(10))
110 PARTITION BY HASH (MONTH(a));
111 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
112 CREATE TABLE t1 (a INT)
113 PARTITION BY HASH (MONTH(a));
114 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
115 CREATE TABLE t1 (a TIME)
116 PARTITION BY HASH (DAYOFYEAR(a));
117 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
118 CREATE TABLE t1 (a DATE)
119 PARTITION BY HASH (DAYOFYEAR(a));
120 DROP TABLE t1;
121 CREATE TABLE t1 (a DATETIME)
122 PARTITION BY HASH (DAYOFYEAR(a));
123 DROP TABLE t1;
124 CREATE TABLE t1 (a VARCHAR(10))
125 PARTITION BY HASH (DAYOFYEAR(a));
126 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
127 CREATE TABLE t1 (a INT)
128 PARTITION BY HASH (DAYOFYEAR(a));
129 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
130 CREATE TABLE t1 (a TIME)
131 PARTITION BY HASH (HOUR(a));
132 DROP TABLE t1;
133 CREATE TABLE t1 (a DATE)
134 PARTITION BY HASH (HOUR(a));
135 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
136 CREATE TABLE t1 (a DATETIME)
137 PARTITION BY HASH (HOUR(a));
138 DROP TABLE t1;
139 CREATE TABLE t1 (a VARCHAR(10))
140 PARTITION BY HASH (HOUR(a));
141 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
142 CREATE TABLE t1 (a INT)
143 PARTITION BY HASH (HOUR(a));
144 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
145 CREATE TABLE t1 (a TIME)
146 PARTITION BY HASH (MINUTE(a));
147 DROP TABLE t1;
148 CREATE TABLE t1 (a DATE)
149 PARTITION BY HASH (MINUTE(a));
150 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
151 CREATE TABLE t1 (a DATETIME)
152 PARTITION BY HASH (MINUTE(a));
153 DROP TABLE t1;
154 CREATE TABLE t1 (a VARCHAR(10))
155 PARTITION BY HASH (MINUTE(a));
156 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
157 CREATE TABLE t1 (a INT)
158 PARTITION BY HASH (MINUTE(a));
159 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
160 CREATE TABLE t1 (a TIME)
161 PARTITION BY HASH (QUARTER(a));
162 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
163 CREATE TABLE t1 (a DATE)
164 PARTITION BY HASH (QUARTER(a));
165 DROP TABLE t1;
166 CREATE TABLE t1 (a DATETIME)
167 PARTITION BY HASH (QUARTER(a));
168 DROP TABLE t1;
169 CREATE TABLE t1 (a VARCHAR(10))
170 PARTITION BY HASH (QUARTER(a));
171 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
172 CREATE TABLE t1 (a INT)
173 PARTITION BY HASH (QUARTER(a));
174 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
175 CREATE TABLE t1 (a TIME)
176 PARTITION BY HASH (SECOND(a));
177 DROP TABLE t1;
178 CREATE TABLE t1 (a DATE)
179 PARTITION BY HASH (SECOND(a));
180 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
181 CREATE TABLE t1 (a DATETIME)
182 PARTITION BY HASH (SECOND(a));
183 DROP TABLE t1;
184 CREATE TABLE t1 (a VARCHAR(10))
185 PARTITION BY HASH (SECOND(a));
186 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
187 CREATE TABLE t1 (a INT)
188 PARTITION BY HASH (SECOND(a));
189 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
190 CREATE TABLE t1 (a TIME)
191 PARTITION BY HASH (YEARWEEK(a));
192 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
193 CREATE TABLE t1 (a DATE)
194 PARTITION BY HASH (YEARWEEK(a));
195 DROP TABLE t1;
196 CREATE TABLE t1 (a DATETIME)
197 PARTITION BY HASH (YEARWEEK(a));
198 DROP TABLE t1;
199 CREATE TABLE t1 (a VARCHAR(10))
200 PARTITION BY HASH (YEARWEEK(a));
201 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
202 CREATE TABLE t1 (a INT)
203 PARTITION BY HASH (YEARWEEK(a));
204 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
205 CREATE TABLE t1 (a TIME)
206 PARTITION BY HASH (WEEKDAY(a));
207 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
208 CREATE TABLE t1 (a DATE)
209 PARTITION BY HASH (WEEKDAY(a));
210 DROP TABLE t1;
211 CREATE TABLE t1 (a DATETIME)
212 PARTITION BY HASH (WEEKDAY(a));
213 DROP TABLE t1;
214 CREATE TABLE t1 (a VARCHAR(10))
215 PARTITION BY HASH (WEEKDAY(a));
216 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
217 CREATE TABLE t1 (a INT)
218 PARTITION BY HASH (WEEKDAY(a));
219 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
220 # TO_SECONDS() is added in 5.5.
221 CREATE TABLE t1 (a TIME)
222 PARTITION BY HASH (TO_SECONDS(a));
223 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
224 CREATE TABLE t1 (a TIME)
225 PARTITION BY HASH (TIME_TO_SEC(a));
226 DROP TABLE t1;
227 CREATE TABLE t1 (a DATE)
228 PARTITION BY HASH (TIME_TO_SEC(a));
229 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
230 CREATE TABLE t1 (a DATETIME)
231 PARTITION BY HASH (TIME_TO_SEC(a));
232 DROP TABLE t1;
233 CREATE TABLE t1 (a VARCHAR(10))
234 PARTITION BY HASH (TIME_TO_SEC(a));
235 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
236 CREATE TABLE t1 (a INT)
237 PARTITION BY HASH (TIME_TO_SEC(a));
238 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
239 CREATE TABLE t1 (a TIME)
240 PARTITION BY HASH (FROM_DAYS(a));
241 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
242 CREATE TABLE t1 (a DATE)
243 PARTITION BY HASH (FROM_DAYS(a));
244 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
245 CREATE TABLE t1 (a DATETIME)
246 PARTITION BY HASH (FROM_DAYS(a));
247 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
248 CREATE TABLE t1 (a VARCHAR(10))
249 PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
250 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
251 CREATE TABLE t1 (a VARCHAR(10))
252 PARTITION BY HASH (FROM_DAYS(a));
253 ERROR HY000: The PARTITION function returns the wrong type
254 CREATE TABLE t1 (a INT)
255 PARTITION BY HASH (TO_DAYS(FROM_DAYS(a)));
256 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
257 CREATE TABLE t1 (a INT)
258 PARTITION BY HASH (FROM_DAYS(a));
259 ERROR HY000: The PARTITION function returns the wrong type
260 CREATE TABLE t1 (a TIME)
261 PARTITION BY HASH (MICROSECOND(a));
262 DROP TABLE t1;
263 CREATE TABLE t1 (a DATE)
264 PARTITION BY HASH (MICROSECOND(a));
265 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
266 CREATE TABLE t1 (a DATETIME)
267 PARTITION BY HASH (MICROSECOND(a));
268 DROP TABLE t1;
269 CREATE TABLE t1 (a VARCHAR(10))
270 PARTITION BY HASH (MICROSECOND(a));
271 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
272 CREATE TABLE t1 (a INT)
273 PARTITION BY HASH (MICROSECOND(a));
274 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
275 # Bug#57071
276 CREATE TABLE t1
277 (`date` date,
278 `extracted_week` int,
279 `yearweek` int,
280 `week` int,
281 `default_week_format` int)
282 PARTITION BY LIST (EXTRACT(WEEK FROM date) % 3)
283 (PARTITION p0 VALUES IN (0),
284 PARTITION p1 VALUES IN (1),
285 PARTITION p2 VALUES IN (2));
286 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
287 CREATE TABLE t1
288 (`date` date,
289 `extracted_week` int,
290 `yearweek` int,
291 `week` int,
292 `default_week_format` int);
293 SET @old_default_week_format := @@default_week_format;
294 SET default_week_format = 0;
295 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
296 SET default_week_format = 1;
297 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
298 SET default_week_format = 2;
299 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
300 SET default_week_format = 3;
301 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
302 SET default_week_format = 4;
303 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
304 SET default_week_format = 5;
305 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
306 SET default_week_format = 6;
307 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
308 SET default_week_format = 7;
309 INSERT INTO t1 VALUES ('2000-01-01', EXTRACT(WEEK FROM '2000-01-01'), YEARWEEK('2000-01-01'), WEEK('2000-01-01'), @@default_week_format);
310 SELECT * FROM t1;
311 date    extracted_week  yearweek        week    default_week_format
312 2000-01-01      0       199952  0       0
313 2000-01-01      0       199952  0       1
314 2000-01-01      52      199952  52      2
315 2000-01-01      52      199952  52      3
316 2000-01-01      0       199952  0       4
317 2000-01-01      0       199952  0       5
318 2000-01-01      52      199952  52      6
319 2000-01-01      52      199952  52      7
320 SET default_week_format = @old_default_week_format;
321 DROP TABLE t1;
322 CREATE TABLE t1 (a TIME)
323 PARTITION BY HASH (EXTRACT(YEAR FROM a));
324 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
325 CREATE TABLE t1 (a DATE)
326 PARTITION BY HASH (EXTRACT(YEAR FROM a));
327 DROP TABLE t1;
328 CREATE TABLE t1 (a DATETIME)
329 PARTITION BY HASH (EXTRACT(YEAR FROM a));
330 DROP TABLE t1;
331 CREATE TABLE t1 (a VARCHAR(10))
332 PARTITION BY HASH (EXTRACT(YEAR FROM a));
333 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
334 CREATE TABLE t1 (a INT)
335 PARTITION BY HASH (EXTRACT(YEAR FROM a));
336 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
337 CREATE TABLE t1 (a TIME)
338 PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
339 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
340 CREATE TABLE t1 (a DATE)
341 PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
342 DROP TABLE t1;
343 CREATE TABLE t1 (a DATETIME)
344 PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
345 DROP TABLE t1;
346 CREATE TABLE t1 (a VARCHAR(10))
347 PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
348 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
349 CREATE TABLE t1 (a INT)
350 PARTITION BY HASH (EXTRACT(YEAR_MONTH FROM a));
351 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
352 CREATE TABLE t1 (a TIME)
353 PARTITION BY HASH (EXTRACT(QUARTER FROM a));
354 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
355 CREATE TABLE t1 (a DATE)
356 PARTITION BY HASH (EXTRACT(QUARTER FROM a));
357 DROP TABLE t1;
358 CREATE TABLE t1 (a DATETIME)
359 PARTITION BY HASH (EXTRACT(QUARTER FROM a));
360 DROP TABLE t1;
361 CREATE TABLE t1 (a VARCHAR(10))
362 PARTITION BY HASH (EXTRACT(QUARTER FROM a));
363 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
364 CREATE TABLE t1 (a INT)
365 PARTITION BY HASH (EXTRACT(QUARTER FROM a));
366 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
367 CREATE TABLE t1 (a TIME)
368 PARTITION BY HASH (EXTRACT(MONTH FROM a));
369 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
370 CREATE TABLE t1 (a DATE)
371 PARTITION BY HASH (EXTRACT(MONTH FROM a));
372 DROP TABLE t1;
373 CREATE TABLE t1 (a DATETIME)
374 PARTITION BY HASH (EXTRACT(MONTH FROM a));
375 DROP TABLE t1;
376 CREATE TABLE t1 (a VARCHAR(10))
377 PARTITION BY HASH (EXTRACT(MONTH FROM a));
378 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
379 CREATE TABLE t1 (a INT)
380 PARTITION BY HASH (EXTRACT(MONTH FROM a));
381 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
382 # EXTRACT(WEEK...) is disallowed, see bug#57071.
383 CREATE TABLE t1 (a TIME)
384 PARTITION BY HASH (EXTRACT(WEEK FROM a));
385 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
386 CREATE TABLE t1 (a DATE)
387 PARTITION BY HASH (EXTRACT(WEEK FROM a));
388 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
389 CREATE TABLE t1 (a DATETIME)
390 PARTITION BY HASH (EXTRACT(WEEK FROM a));
391 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
392 CREATE TABLE t1 (a VARCHAR(10))
393 PARTITION BY HASH (EXTRACT(WEEK FROM a));
394 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
395 CREATE TABLE t1 (a INT)
396 PARTITION BY HASH (EXTRACT(WEEK FROM a));
397 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
398 CREATE TABLE t1 (a TIME)
399 PARTITION BY HASH (EXTRACT(DAY FROM a));
400 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
401 CREATE TABLE t1 (a DATE)
402 PARTITION BY HASH (EXTRACT(DAY FROM a));
403 DROP TABLE t1;
404 CREATE TABLE t1 (a DATETIME)
405 PARTITION BY HASH (EXTRACT(DAY FROM a));
406 DROP TABLE t1;
407 CREATE TABLE t1 (a VARCHAR(10))
408 PARTITION BY HASH (EXTRACT(DAY FROM a));
409 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
410 CREATE TABLE t1 (a INT)
411 PARTITION BY HASH (EXTRACT(DAY FROM a));
412 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
413 CREATE TABLE t1 (a TIME)
414 PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
415 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
416 CREATE TABLE t1 (a DATE)
417 PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
418 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
419 CREATE TABLE t1 (a DATETIME)
420 PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
421 DROP TABLE t1;
422 CREATE TABLE t1 (a VARCHAR(10))
423 PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
424 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
425 CREATE TABLE t1 (a INT)
426 PARTITION BY HASH (EXTRACT(DAY_HOUR FROM a));
427 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
428 CREATE TABLE t1 (a TIME)
429 PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
430 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
431 CREATE TABLE t1 (a DATE)
432 PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
433 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
434 CREATE TABLE t1 (a DATETIME)
435 PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
436 DROP TABLE t1;
437 CREATE TABLE t1 (a VARCHAR(10))
438 PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
439 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
440 CREATE TABLE t1 (a INT)
441 PARTITION BY HASH (EXTRACT(DAY_MINUTE FROM a));
442 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
443 CREATE TABLE t1 (a TIME)
444 PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
445 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
446 CREATE TABLE t1 (a DATE)
447 PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
448 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
449 CREATE TABLE t1 (a DATETIME)
450 PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
451 DROP TABLE t1;
452 CREATE TABLE t1 (a VARCHAR(10))
453 PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
454 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
455 CREATE TABLE t1 (a INT)
456 PARTITION BY HASH (EXTRACT(DAY_SECOND FROM a));
457 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
458 CREATE TABLE t1 (a TIME)
459 PARTITION BY HASH (EXTRACT(HOUR FROM a));
460 DROP TABLE t1;
461 CREATE TABLE t1 (a DATE)
462 PARTITION BY HASH (EXTRACT(HOUR FROM a));
463 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
464 CREATE TABLE t1 (a DATETIME)
465 PARTITION BY HASH (EXTRACT(HOUR FROM a));
466 DROP TABLE t1;
467 CREATE TABLE t1 (a VARCHAR(10))
468 PARTITION BY HASH (EXTRACT(HOUR FROM a));
469 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
470 CREATE TABLE t1 (a INT)
471 PARTITION BY HASH (EXTRACT(HOUR FROM a));
472 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
473 CREATE TABLE t1 (a TIME)
474 PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
475 DROP TABLE t1;
476 CREATE TABLE t1 (a DATE)
477 PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
478 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
479 CREATE TABLE t1 (a DATETIME)
480 PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
481 DROP TABLE t1;
482 CREATE TABLE t1 (a VARCHAR(10))
483 PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
484 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
485 CREATE TABLE t1 (a INT)
486 PARTITION BY HASH (EXTRACT(HOUR_MINUTE FROM a));
487 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
488 CREATE TABLE t1 (a TIME)
489 PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
490 DROP TABLE t1;
491 CREATE TABLE t1 (a DATE)
492 PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
493 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
494 CREATE TABLE t1 (a DATETIME)
495 PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
496 DROP TABLE t1;
497 CREATE TABLE t1 (a VARCHAR(10))
498 PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
499 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
500 CREATE TABLE t1 (a INT)
501 PARTITION BY HASH (EXTRACT(HOUR_SECOND FROM a));
502 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
503 CREATE TABLE t1 (a TIME)
504 PARTITION BY HASH (EXTRACT(MINUTE FROM a));
505 DROP TABLE t1;
506 CREATE TABLE t1 (a DATE)
507 PARTITION BY HASH (EXTRACT(MINUTE FROM a));
508 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
509 CREATE TABLE t1 (a DATETIME)
510 PARTITION BY HASH (EXTRACT(MINUTE FROM a));
511 DROP TABLE t1;
512 CREATE TABLE t1 (a VARCHAR(10))
513 PARTITION BY HASH (EXTRACT(MINUTE FROM a));
514 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
515 CREATE TABLE t1 (a INT)
516 PARTITION BY HASH (EXTRACT(MINUTE FROM a));
517 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
518 CREATE TABLE t1 (a TIME)
519 PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
520 DROP TABLE t1;
521 CREATE TABLE t1 (a DATE)
522 PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
523 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
524 CREATE TABLE t1 (a DATETIME)
525 PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
526 DROP TABLE t1;
527 CREATE TABLE t1 (a VARCHAR(10))
528 PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
529 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
530 CREATE TABLE t1 (a INT)
531 PARTITION BY HASH (EXTRACT(MINUTE_SECOND FROM a));
532 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
533 CREATE TABLE t1 (a TIME)
534 PARTITION BY HASH (EXTRACT(SECOND FROM a));
535 DROP TABLE t1;
536 CREATE TABLE t1 (a DATE)
537 PARTITION BY HASH (EXTRACT(SECOND FROM a));
538 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
539 CREATE TABLE t1 (a DATETIME)
540 PARTITION BY HASH (EXTRACT(SECOND FROM a));
541 DROP TABLE t1;
542 CREATE TABLE t1 (a VARCHAR(10))
543 PARTITION BY HASH (EXTRACT(SECOND FROM a));
544 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
545 CREATE TABLE t1 (a INT)
546 PARTITION BY HASH (EXTRACT(SECOND FROM a));
547 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
548 CREATE TABLE t1 (a TIME)
549 PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
550 DROP TABLE t1;
551 CREATE TABLE t1 (a DATE)
552 PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
553 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
554 CREATE TABLE t1 (a DATETIME)
555 PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
556 DROP TABLE t1;
557 CREATE TABLE t1 (a VARCHAR(10))
558 PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
559 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
560 CREATE TABLE t1 (a INT)
561 PARTITION BY HASH (EXTRACT(MICROSECOND FROM a));
562 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
563 CREATE TABLE t1 (a TIME)
564 PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
565 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
566 CREATE TABLE t1 (a DATE)
567 PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
568 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
569 CREATE TABLE t1 (a DATETIME)
570 PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
571 DROP TABLE t1;
572 CREATE TABLE t1 (a VARCHAR(10))
573 PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
574 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
575 CREATE TABLE t1 (a INT)
576 PARTITION BY HASH (EXTRACT(DAY_MICROSECOND FROM a));
577 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
578 CREATE TABLE t1 (a TIME)
579 PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
580 DROP TABLE t1;
581 CREATE TABLE t1 (a DATE)
582 PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
583 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
584 CREATE TABLE t1 (a DATETIME)
585 PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
586 DROP TABLE t1;
587 CREATE TABLE t1 (a VARCHAR(10))
588 PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
589 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
590 CREATE TABLE t1 (a INT)
591 PARTITION BY HASH (EXTRACT(HOUR_MICROSECOND FROM a));
592 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
593 CREATE TABLE t1 (a TIME)
594 PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
595 DROP TABLE t1;
596 CREATE TABLE t1 (a DATE)
597 PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
598 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
599 CREATE TABLE t1 (a DATETIME)
600 PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
601 DROP TABLE t1;
602 CREATE TABLE t1 (a VARCHAR(10))
603 PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
604 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
605 CREATE TABLE t1 (a INT)
606 PARTITION BY HASH (EXTRACT(MINUTE_MICROSECOND FROM a));
607 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
608 CREATE TABLE t1 (a TIME)
609 PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
610 DROP TABLE t1;
611 CREATE TABLE t1 (a DATE)
612 PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
613 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
614 CREATE TABLE t1 (a DATETIME)
615 PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
616 DROP TABLE t1;
617 CREATE TABLE t1 (a VARCHAR(10))
618 PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
619 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
620 CREATE TABLE t1 (a INT)
621 PARTITION BY HASH (EXTRACT(SECOND_MICROSECOND FROM a));
622 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
623 CREATE TABLE t1 (a TIME, b DATE)
624 PARTITION BY HASH (DATEDIFF(a, b));
625 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
626 CREATE TABLE t1 (a DATE, b DATETIME)
627 PARTITION BY HASH (DATEDIFF(a, b));
628 DROP TABLE t1;
629 CREATE TABLE t1 (a DATETIME, b DATE)
630 PARTITION BY HASH (DATEDIFF(a, b));
631 DROP TABLE t1;
632 CREATE TABLE t1 (a DATE, b VARCHAR(10))
633 PARTITION BY HASH (DATEDIFF(a, b));
634 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
635 CREATE TABLE t1 (a INT, b DATETIME)
636 PARTITION BY HASH (DATEDIFF(a, b));
637 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
638 CREATE TABLE t1 (a TIME)
639 PARTITION BY HASH (TIME_TO_SEC(a));
640 DROP TABLE t1;
641 CREATE TABLE t1 (a DATE)
642 PARTITION BY HASH (TIME_TO_SEC(a));
643 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
644 CREATE TABLE t1 (a DATETIME)
645 PARTITION BY HASH (TIME_TO_SEC(a));
646 DROP TABLE t1;
647 CREATE TABLE t1 (a VARCHAR(10))
648 PARTITION BY HASH (TIME_TO_SEC(a));
649 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
650 CREATE TABLE t1 (a INT)
651 PARTITION BY HASH (TIME_TO_SEC(a));
652 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
654 # Bug#49161: Out of memory; restart server and try again (needed 2 bytes)
656 CREATE TABLE t1 (a INT) PARTITION BY HASH (a);
657 FLUSH TABLES;
658 CHECK TABLE t1;
659 Table   Op      Msg_type        Msg_text
660 test.t1 check   Error   Failed to read from the .par file
661 test.t1 check   Error   Incorrect information in file: './test/t1.frm'
662 test.t1 check   error   Corrupt
663 SELECT * FROM t1;
664 ERROR HY000: Failed to read from the .par file
665 # Note that we will remove the frm file when we detect that 
666 # .par file has been deleted.
667 DROP TABLE t1;
668 ERROR 42S02: Unknown table 't1'
670 # Bug#49477: Assertion `0' failed in ha_partition.cc:5530
671 # with temporary table and partitions
673 CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
674 CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
675 ERROR HY000: Cannot create temporary table with partitions
676 DROP TABLE t1;
678 # Bug#50392: insert_id is not reset for partitioned tables
679 #            auto_increment on duplicate entry
680 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
681 SET INSERT_ID= 13;
682 INSERT INTO t1 VALUES (NULL);
683 SET INSERT_ID= 12;
684 INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
685 ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
686 SHOW CREATE TABLE t1;
687 Table   Create Table
688 t1      CREATE TABLE `t1` (
689   `a` int(11) NOT NULL AUTO_INCREMENT,
690   PRIMARY KEY (`a`)
691 ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
692 INSERT INTO t1 VALUES (NULL);
693 SELECT * FROM t1;
698 DROP TABLE t1;
699 CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY) PARTITION BY KEY(a);
700 SET INSERT_ID= 13;
701 INSERT INTO t1 VALUES (NULL);
702 SET INSERT_ID= 12;
703 INSERT INTO t1 VALUES (NULL), (NULL), (NULL);
704 ERROR 23000: Duplicate entry '13' for key 'PRIMARY'
705 SHOW CREATE TABLE t1;
706 Table   Create Table
707 t1      CREATE TABLE `t1` (
708   `a` int(11) NOT NULL AUTO_INCREMENT,
709   PRIMARY KEY (`a`)
710 ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=latin1
711 /*!50100 PARTITION BY KEY (a) */
712 INSERT INTO t1 VALUES (NULL);
713 SELECT * FROM t1;
718 DROP TABLE t1;
719 CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a));
720 INSERT INTO t1 VALUES (1),(1);
721 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
722 DROP TABLE t1;
723 CREATE TABLE t1 (a INTEGER NOT NULL, PRIMARY KEY (a))
724 PARTITION BY KEY (a) PARTITIONS 2;
725 INSERT INTO t1 VALUES (1),(1);
726 ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
727 DROP TABLE t1;
728 CREATE TABLE t1 (a INT)
729 PARTITION BY HASH (a)
730 ( PARTITION p0 ENGINE=MyISAM,
731 PARTITION p1);
732 ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
733 CREATE TABLE t1 (a INT)
734 PARTITION BY LIST (a)
735 SUBPARTITION BY HASH (a)
736 ( PARTITION p0 VALUES IN (0)
737 ( SUBPARTITION s0, SUBPARTITION s1 ENGINE=MyISAM, SUBPARTITION s2),
738 PARTITION p1 VALUES IN (1)
739 ( SUBPARTITION s3 ENGINE=MyISAM, SUBPARTITION s4, SUBPARTITION s5 ENGINE=MyISAM));
740 ERROR HY000: The mix of handlers in the partitions is not allowed in this version of MySQL
741 CREATE TABLE t1 (
742 a int
744 PARTITION BY RANGE (a)
746 PARTITION p0 VALUES LESS THAN (1),
747 PARTITION p1 VALU ES LESS THAN (2)
749 ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
750 partition by list (a)
751 partitions 3
752 (partition x1 values in (1,2,9,4) tablespace ts1,
753 partition x2 values in (3, 11, 5, 7) tablespace ts2,
754 partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
755 ERROR 42000: Partitioning can not be used stand-alone in query near 'partition by list (a)
756 partitions 3
757 (partition x1 values in (1,2,9,4) tablespace ' at line 1
758 CREATE TABLE t1 (
759 a int not null,
760 b int not null,
761 c int not null,
762 primary key(a,b))
763 partition by list (a)
764 partitions 2;
765 ERROR HY000: For LIST partitions each partition must be defined
766 CREATE TABLE t1 (
767 a int not null,
768 b int not null,
769 c int not null,
770 primary key(a,b))
771 partition by list (sin(a))
772 partitions 3
773 (partition x1 values in (1,2,9,4) tablespace ts1,
774 partition x2 values in (3, 11, 5, 7) tablespace ts2,
775 partition x3 values in (16, 8, 5+19, 70-43) tablespace ts3);
776 ERROR HY000: This partition function is not allowed
777 CREATE TABLE t1 (
778 a int not null,
779 b int not null,
780 c int not null,
781 primary key(a,b))
782 partition by key (a+2)
783 partitions 3
784 (partition x1 tablespace ts1,
785 partition x2 tablespace ts2,
786 partition x3 tablespace ts3);
787 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+2)
788 partitions 3
789 (partition x1 tablespace ts1,
790 partition x2 tablespace ts2,
791 part' at line 6
792 CREATE TABLE t1 (
793 a int not null,
794 b int not null,
795 c int not null,
796 primary key(a,b))
797 partition by key (a)
798 partitions 3
799 (partition tablespace ts1,
800 partition x2 tablespace ts2,
801 partition x3 tablespace ts3);
802 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ts1,
803 partition x2 tablespace ts2,
804 partition x3 tablespace ts3)' at line 8
805 CREATE TABLE t1 (
806 a int not null,
807 b int not null,
808 c int not null,
809 primary key(a,b))
810 partition by key (a,d)
811 partitions 3
812 (partition x1 tablespace ts1,
813 partition x2 tablespace ts2,
814 partition x3 tablespace ts3);
815 ERROR HY000: Field in list of fields for partition function not found in table
816 select load_file('$MYSQLD_DATADIR/test/t1.par');
817 load_file('$MYSQLD_DATADIR/test/t1.par')
818 NULL
819 CREATE TABLE t1 (
820 a int not null,
821 b int not null,
822 c int not null,
823 primary key(a,b))
824 partition by hash (a + d)
825 partitions 3
826 (partition x1 tablespace ts1,
827 partition x2 tablespace ts2,
828 partition x3 tablespace ts3);
829 ERROR 42S22: Unknown column 'd' in 'partition function'
830 CREATE TABLE t1 (
831 a int not null,
832 b int not null,
833 c int not null,
834 primary key(a,b))
835 partition by hash (sin(a))
836 partitions 3
837 (partition x1 tablespace ts1,
838 partition x2 tablespace ts2,
839 partition x3 tablespace ts3);
840 ERROR HY000: This partition function is not allowed
841 CREATE TABLE t1 (
842 a int not null,
843 b int not null,
844 c int not null,
845 primary key(a,b))
846 partition by key (a)
847 partitions 3
848 (partition x1, partition x2);
849 ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
850 CREATE TABLE t1 (
851 a int not null,
852 b int not null,
853 c int not null,
854 primary key(a,b))
855 partition by hash (rand(a))
856 partitions 2
857 (partition x1, partition x2);
858 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
859 partitions 2
860 (partition x1, partition x2)' at line 6
861 CREATE TABLE t1 (
862 a int not null,
863 b int not null,
864 c int not null,
865 primary key(a,b))
866 partition by range (rand(a))
867 partitions 2
868 (partition x1 values less than (0), partition x2 values less than (2));
869 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
870 partitions 2
871 (partition x1 values less than (0), partition x2 values less than' at line 6
872 CREATE TABLE t1 (
873 a int not null,
874 b int not null,
875 c int not null,
876 primary key(a,b))
877 partition by list (rand(a))
878 partitions 2
879 (partition x1 values in (1), partition x2 values in (2));
880 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')
881 partitions 2
882 (partition x1 values in (1), partition x2 values in (2))' at line 6
883 CREATE TABLE t1 (
884 a int not null,
885 b int not null,
886 c int not null,
887 primary key(a,b))
888 partition by hash (a)
889 partitions 2
890 (partition x1 values less than (4),
891 partition x2 values less than (5));
892 ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
893 select load_file('$MYSQLD_DATADIR/test/t1.par');
894 load_file('$MYSQLD_DATADIR/test/t1.par')
895 NULL
896 CREATE TABLE t1 (
897 a int not null,
898 b int not null,
899 c int not null,
900 primary key(a,b))
901 partition by hash (a)
902 partitions 2
903 (partition x1 values in (4),
904 partition x2 values in (5));
905 ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
906 select load_file('$MYSQLD_DATADIR/test/t1.par');
907 load_file('$MYSQLD_DATADIR/test/t1.par')
908 NULL
909 CREATE TABLE t1 (
910 a int not null,
911 b int not null,
912 c int not null,
913 primary key(a,b))
914 partition by hash (a)
915 partitions 2
916 (partition x1 values in (4,6),
917 partition x2 values in (5,7));
918 ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
919 select load_file('$MYSQLD_DATADIR/test/t1.par');
920 load_file('$MYSQLD_DATADIR/test/t1.par')
921 NULL
922 CREATE TABLE t1 (
923 a int not null,
924 b int not null,
925 c int not null,
926 primary key (a,b))
927 partition by key (a)
928 subpartition by key (b);
929 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
930 select load_file('$MYSQLD_DATADIR/test/t1.par');
931 load_file('$MYSQLD_DATADIR/test/t1.par')
932 NULL
933 CREATE TABLE t1 (
934 a int not null,
935 b int not null,
936 c int not null,
937 primary key (a,b))
938 partition by key (a)
939 subpartition by key (a, b);
940 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
941 select load_file('$MYSQLD_DATADIR/test/t1.par');
942 load_file('$MYSQLD_DATADIR/test/t1.par')
943 NULL
944 CREATE TABLE t1 (
945 a int not null,
946 b int not null,
947 c int not null,
948 primary key (a,b))
949 partition by key (a)
950 subpartition by hash (a+b);
951 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
952 select load_file('$MYSQLD_DATADIR/test/t1.par');
953 load_file('$MYSQLD_DATADIR/test/t1.par')
954 NULL
955 CREATE TABLE t1 (
956 a int not null,
957 b int not null,
958 c int not null,
959 primary key (a,b))
960 partition by key (a)
961 subpartition by key (b);
962 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
963 select load_file('$MYSQLD_DATADIR/test/t1.par');
964 load_file('$MYSQLD_DATADIR/test/t1.par')
965 NULL
966 CREATE TABLE t1 (
967 a int not null,
968 b int not null,
969 c int not null,
970 primary key (a,b))
971 partition by key (a)
972 subpartition by key (a, b);
973 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
974 select load_file('$MYSQLD_DATADIR/test/t1.par');
975 load_file('$MYSQLD_DATADIR/test/t1.par')
976 NULL
977 CREATE TABLE t1 (
978 a int not null,
979 b int not null,
980 c int not null,
981 primary key (a,b))
982 partition by key (a)
983 subpartition by hash (a+b);
984 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
985 select load_file('$MYSQLD_DATADIR/test/t1.par');
986 load_file('$MYSQLD_DATADIR/test/t1.par')
987 NULL
988 CREATE TABLE t1 (
989 a int not null,
990 b int not null,
991 c int not null,
992 primary key (a,b))
993 partition by key (a)
994 subpartition by hash (rand(a+b));
995 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 7
996 CREATE TABLE t1 (
997 a int not null,
998 b int not null,
999 c int not null,
1000 primary key (a,b))
1001 partition by key (a)
1002 subpartition by hash (sin(a+b))
1003 (partition x1 (subpartition x11, subpartition x12),
1004 partition x2 (subpartition x21, subpartition x22));
1005 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
1006 select load_file('$MYSQLD_DATADIR/test/t1.par');
1007 load_file('$MYSQLD_DATADIR/test/t1.par')
1008 NULL
1009 CREATE TABLE t1 (
1010 a int not null,
1011 b int not null,
1012 c int not null,
1013 primary key (a,b))
1014 partition by range (a)
1015 subpartition by key (a+b)
1016 (partition x1 values less than (1) (subpartition x11, subpartition x12),
1017 partition x2 values less than (2) (subpartition x21, subpartition x22));
1018 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '+b)
1019 (partition x1 values less than (1) (subpartition x11, subpartition x12),
1020 par' at line 7
1021 CREATE TABLE t1 (
1022 a int not null,
1023 b int not null,
1024 c int not null,
1025 primary key (a,b))
1026 partition by range (a)
1027 subpartition by key (a,d)
1028 (partition x1 values less than (1) (subpartition x11, subpartition x12),
1029 partition x2 values less than (2) (subpartition x21, subpartition x22));
1030 ERROR HY000: Field in list of fields for partition function not found in table
1031 select load_file('$MYSQLD_DATADIR/test/t1.par');
1032 load_file('$MYSQLD_DATADIR/test/t1.par')
1033 NULL
1034 CREATE TABLE t1 (
1035 a int not null,
1036 b int not null,
1037 c int not null,
1038 primary key (a,b))
1039 partition by key (a)
1040 subpartition by hash (3+4);
1041 ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
1042 CREATE TABLE t1 (
1043 a int not null,
1044 b int not null,
1045 c int not null,
1046 primary key (a,b))
1047 partition by range (a)
1048 subpartition by hash (a+d)
1049 (partition x1 values less than (1) (subpartition x11, subpartition x12),
1050 partition x2 values less than (2) (subpartition x21, subpartition x22));
1051 ERROR 42S22: Unknown column 'd' in 'partition function'
1052 CREATE TABLE t1 (
1053 a int not null,
1054 b int not null,
1055 c int not null,
1056 primary key(a,b))
1057 partition by range (a);
1058 ERROR HY000: For RANGE partitions each partition must be defined
1059 select load_file('$MYSQLD_DATADIR/test/t1.par');
1060 load_file('$MYSQLD_DATADIR/test/t1.par')
1061 NULL
1062 CREATE TABLE t1 (
1063 a int not null,
1064 b int not null,
1065 c int not null,
1066 primary key(a,b))
1067 partition by range (a+d)
1068 partitions 2
1069 (partition x1 values less than (4) tablespace ts1,
1070 partition x2 values less than (8) tablespace ts2);
1071 ERROR 42S22: Unknown column 'd' in 'partition function'
1072 CREATE TABLE t1 (
1073 a int not null,
1074 b int not null,
1075 c int not null,
1076 primary key(a,b))
1077 partition by range (a)
1078 partitions 2
1079 (partition x1 values less than (4.0) tablespace ts1,
1080 partition x2 values less than (8) tablespace ts2);
1081 ERROR 42000: VALUES value must be of same type as partition function near ') tablespace ts1,
1082 partition x2 values less than (8) tablespace ts2)' at line 8
1083 CREATE TABLE t1 (
1084 a int not null,
1085 b int not null,
1086 c int not null,
1087 primary key(a,b))
1088 partition by range (3+4)
1089 partitions 2
1090 (partition x1 values less than (4) tablespace ts1,
1091 partition x2 values less than (8) tablespace ts2);
1092 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1093 CREATE TABLE t1 ( 
1094 a int not null,
1095 b int not null,
1096 c int not null,
1097 primary key(a,b))
1098 partition by range (a)
1099 partitions 2
1100 (partition x1 values less than (4),
1101 partition x2);
1102 ERROR HY000: Syntax error: RANGE PARTITIONING requires definition of VALUES LESS THAN for each partition
1103 CREATE TABLE t1 (
1104 a int not null,
1105 b int not null,
1106 c int not null,
1107 primary key(a,b))
1108 partition by range (a)
1109 partitions 2
1110 (partition x1 values in (4),
1111 partition x2);
1112 ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
1113 CREATE TABLE t1 (
1114 a int not null,
1115 b int not null,
1116 c int not null,
1117 primary key(a,b))
1118 partition by range (a)
1119 partitions 2
1120 (partition x1 values in (4),
1121 partition x2 values less than (5));
1122 ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
1123 CREATE TABLE t1 (
1124 a int not null,
1125 b int not null,
1126 c int not null,
1127 primary key(a,b))
1128 partition by list (a)
1129 partitions 2
1130 (partition x1 values less than 4,
1131 partition x2 values less than (5));
1132 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
1133 partition x2 values less than (5))' at line 8
1134 CREATE TABLE t1 (
1135 a int not null,
1136 b int not null,
1137 c int not null,
1138 primary key(a,b))
1139 partition by range (a)
1140 partitions 2
1141 (partition x1 values less than maxvalue,
1142 partition x2 values less than (5));
1143 ERROR 42000: MAXVALUE can only be used in last partition definition near '))' at line 9
1144 CREATE TABLE t1 (
1145 a int not null,
1146 b int not null,
1147 c int not null,
1148 primary key(a,b))
1149 partition by range (a)
1150 partitions 2
1151 (partition x1 values less than maxvalue,
1152 partition x2 values less than maxvalue);
1153 ERROR 42000: MAXVALUE can only be used in last partition definition near 'maxvalue)' at line 9
1154 CREATE TABLE t1 (
1155 a int not null,
1156 b int not null,
1157 c int not null,
1158 primary key(a,b))
1159 partition by range (a)
1160 partitions 2
1161 (partition x1 values less than (4),
1162 partition x2 values less than (3));
1163 ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
1164 CREATE TABLE t1 (
1165 a int not null,
1166 b int not null,
1167 c int not null,
1168 primary key(a,b))
1169 partition by range (sin(a))
1170 partitions 2
1171 (partition x1 values less than (4),
1172 partition x2 values less than (5));
1173 ERROR HY000: This partition function is not allowed
1174 CREATE TABLE t1 (
1175 a int not null,
1176 b int not null,
1177 c int not null,
1178 primary key (a,b))
1179 partition by list (a)
1180 subpartition by hash (a+b)
1181 subpartitions 3
1182 ( partition x1 values in (1,2,4)
1183 ( subpartition x11 nodegroup 0,
1184 subpartition x12 nodegroup 1),
1185 partition x2 values in (3,5,6)
1186 ( subpartition x21 nodegroup 0,
1187 subpartition x22 nodegroup 1)
1189 ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
1190 partition x2 values in (3,5,6)
1191 ( subpartition x21 nodegroup 0,
1192 subpartition x' at line 11
1193 CREATE TABLE t1 (
1194 a int not null,
1195 b int not null,
1196 c int not null,
1197 primary key (a,b))
1198 partition by list (a)
1199 subpartition by hash (a+b)
1200 ( partition x1 values in (1)
1201 ( subpartition x11 nodegroup 0,
1202 subpartition xextra,
1203 subpartition x12 nodegroup 1),
1204 partition x2 values in (2)
1205 ( subpartition x21 nodegroup 0,
1206 subpartition x22 nodegroup 1)
1208 ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')
1209 )' at line 14
1210 CREATE TABLE t1 (
1211 a int not null,
1212 b int not null,
1213 c int not null,
1214 primary key (a,b))
1215 partition by key (a) 
1216 subpartition by list (a+b)
1217 ( partition x1
1218 ( subpartition x11 engine myisam,
1219 subpartition x12 engine myisam),
1220 partition x2 
1221 ( subpartition x21 engine myisam,
1222 subpartition x22 engine myisam)
1224 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'list (a+b)
1225 ( partition x1
1226 ( subpartition x11 engine myisam,
1227 subpartition x12 eng' at line 7
1228 CREATE TABLE t1 (
1229 a int not null,
1230 b int not null,
1231 c int not null,
1232 primary key (a,b))
1233 partition by key (a)
1234 subpartition by list (a+b)
1235 ( partition x1
1236 ( subpartition x11 engine myisam values in (0),
1237 subpartition x12 engine myisam values in (1)),
1238 partition x2
1239 ( subpartition x21 engine myisam values in (0),
1240 subpartition x22 engine myisam values in (1))
1242 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'list (a+b)
1243 ( partition x1
1244 ( subpartition x11 engine myisam values in (0),
1245 subpar' at line 7
1246 CREATE TABLE t1 (
1247 a int not null,
1248 b int not null,
1249 c int not null,
1250 primary key(a,b))
1251 partition by list (a);
1252 ERROR HY000: For LIST partitions each partition must be defined
1253 CREATE TABLE t1 (
1254 a int not null,
1255 b int not null,
1256 c int not null,
1257 primary key(a,b))
1258 partition by list (3+4)
1259 partitions 2 
1260 (partition x1 values in (4) tablespace ts1,
1261 partition x2 values in (8) tablespace ts2);
1262 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1263 CREATE TABLE t1 (
1264 a int not null,
1265 b int not null,
1266 c int not null,
1267 primary key(a,b))
1268 partition by list (a+d)
1269 partitions 2
1270 (partition x1 values in (4) tablespace ts1,
1271 partition x2 values in (8) tablespace ts2);
1272 ERROR 42S22: Unknown column 'd' in 'partition function'
1273 CREATE TABLE t1 (
1274 a int not null,
1275 b int not null,
1276 c int not null,
1277 primary key(a,b))
1278 partition by list (a)
1279 partitions 2
1280 (partition x1 values in (4),
1281 partition x2);
1282 ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
1283 CREATE TABLE t1 (
1284 a int not null,
1285 b int not null,
1286 c int not null,
1287 primary key(a,b))
1288 partition by list (a)
1289 partitions 2
1290 (partition x1 values in (4),
1291 partition x2 values less than (5));
1292 ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
1293 CREATE TABLE t1 (
1294 a int not null,
1295 b int not null,
1296 c int not null,
1297 primary key(a,b))
1298 partition by list (a)
1299 partitions 2
1300 (partition x1 values in (4,6),
1301 partition x2);
1302 ERROR HY000: Syntax error: LIST PARTITIONING requires definition of VALUES IN for each partition
1303 CREATE TABLE t1 (
1304 a int not null,
1305 b int not null,
1306 c int not null,
1307 primary key(a,b))
1308 partition by list (a)
1309 partitions 2
1310 (partition x1 values in (4, 12+9),
1311 partition x2 values in (3, 21));
1312 ERROR HY000: Multiple definition of same constant in list partitioning
1313 CREATE TABLE t1 (
1314 a int not null,
1315 b int not null,
1316 c int not null,
1317 primary key(a,b))
1318 partition by list (a)
1319 partitions 2
1320 (partition x1 values in (4.0, 12+8),
1321 partition x2 values in (3, 21));
1322 ERROR 42000: VALUES value must be of same type as partition function near ' 12+8),
1323 partition x2 values in (3, 21))' at line 8
1324 CREATE TABLE t1 (
1325 a int not null,
1326 b int not null,
1327 c int not null,
1328 primary key(a,b))
1329 partition by list (a)
1330 partitions 2
1331 (partition x1 values in 4,
1332 partition x2 values in (5));
1333 ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '4,
1334 partition x2 values in (5))' at line 8
1335 CREATE TABLE t1 (a int)
1336 PARTITION BY RANGE (a)
1337 (PARTITION p0 VALUES LESS THAN (x1));
1338 ERROR 42S22: Unknown column 'x1' in 'partition function'
1339 CREATE TABLE t1(a int)
1340 PARTITION BY RANGE (a) (PARTITION p1 VALUES LESS THAN(5));
1341 insert into t1 values (10);
1342 ERROR HY000: Table has no partition for value 10
1343 drop table t1;
1344 create table t1 (a bigint unsigned)
1345 partition by range (a)
1346 (partition p0 values less than (-1));
1347 ERROR HY000: Partition constant is out of partition function domain
1348 create table t1 (v varchar(12))
1349 partition by range (ascii(v))
1350 (partition p0 values less than (10));
1351 ERROR HY000: This partition function is not allowed
1352 create table t1 (a int)
1353 partition by hash (rand(a));
1354 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
1355 create table t1 (a int)
1356 partition by hash(CURTIME() + a);
1357 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
1358 create table t1 (a int)
1359 partition by hash (NOW()+a);
1360 ERROR 42000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ')' at line 2
1361 create table t1 (a int)
1362 partition by hash (extract(hour from convert_tz(a, '+00:00', '+00:00')));
1363 ERROR HY000: This partition function is not allowed
1364 create table t1 (a int)
1365 partition by range (a + (select count(*) from t1))
1366 (partition p1 values less than (1));
1367 ERROR HY000: This partition function is not allowed
1368 create table t1 (a char(10))
1369 partition by hash (extractvalue(a,'a'));
1370 ERROR HY000: This partition function is not allowed
1372 # Bug #42849: innodb crash with varying time_zone on partitioned
1373 #             timestamp primary key
1375 CREATE TABLE old (a TIMESTAMP NOT NULL PRIMARY KEY)
1376 PARTITION BY RANGE (UNIX_TIMESTAMP(a)) (
1377 PARTITION p VALUES LESS THAN (1219089600),
1378 PARTITION pmax VALUES LESS THAN MAXVALUE);
1379 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1380 PARTITION BY RANGE (a) (
1381 PARTITION p VALUES LESS THAN (20080819),
1382 PARTITION pmax VALUES LESS THAN MAXVALUE);
1383 ERROR HY000: The PARTITION function returns the wrong type
1384 ALTER TABLE old
1385 PARTITION BY RANGE (a) (
1386 PARTITION p VALUES LESS THAN (20080819),
1387 PARTITION pmax VALUES LESS THAN MAXVALUE);
1388 ERROR HY000: The PARTITION function returns the wrong type
1389 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1390 PARTITION BY RANGE (a+0) (
1391 PARTITION p VALUES LESS THAN (20080819),
1392 PARTITION pmax VALUES LESS THAN MAXVALUE);
1393 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1394 ALTER TABLE old
1395 PARTITION BY RANGE (a+0) (
1396 PARTITION p VALUES LESS THAN (20080819),
1397 PARTITION pmax VALUES LESS THAN MAXVALUE);
1398 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1399 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1400 PARTITION BY RANGE (a % 2) (
1401 PARTITION p VALUES LESS THAN (20080819),
1402 PARTITION pmax VALUES LESS THAN MAXVALUE);
1403 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1404 ALTER TABLE old
1405 PARTITION BY RANGE (a % 2) (
1406 PARTITION p VALUES LESS THAN (20080819),
1407 PARTITION pmax VALUES LESS THAN MAXVALUE);
1408 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1409 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1410 PARTITION BY RANGE (ABS(a)) (
1411 PARTITION p VALUES LESS THAN (20080819),
1412 PARTITION pmax VALUES LESS THAN MAXVALUE);
1413 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1414 ALTER TABLE old
1415 PARTITION BY RANGE (ABS(a)) (
1416 PARTITION p VALUES LESS THAN (20080819),
1417 PARTITION pmax VALUES LESS THAN MAXVALUE);
1418 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1419 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1420 PARTITION BY RANGE (CEILING(a)) (
1421 PARTITION p VALUES LESS THAN (20080819),
1422 PARTITION pmax VALUES LESS THAN MAXVALUE);
1423 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1424 ALTER TABLE old
1425 PARTITION BY RANGE (CEILING(a)) (
1426 PARTITION p VALUES LESS THAN (20080819),
1427 PARTITION pmax VALUES LESS THAN MAXVALUE);
1428 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1429 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1430 PARTITION BY RANGE (FLOOR(a)) (
1431 PARTITION p VALUES LESS THAN (20080819),
1432 PARTITION pmax VALUES LESS THAN MAXVALUE);
1433 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1434 ALTER TABLE old
1435 PARTITION BY RANGE (FLOOR(a)) (
1436 PARTITION p VALUES LESS THAN (20080819),
1437 PARTITION pmax VALUES LESS THAN MAXVALUE);
1438 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1439 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1440 PARTITION BY RANGE (TO_DAYS(a)) (
1441 PARTITION p VALUES LESS THAN (733638),
1442 PARTITION pmax VALUES LESS THAN MAXVALUE);
1443 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1444 ALTER TABLE old
1445 PARTITION BY RANGE (TO_DAYS(a)) (
1446 PARTITION p VALUES LESS THAN (733638),
1447 PARTITION pmax VALUES LESS THAN MAXVALUE);
1448 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1449 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1450 PARTITION BY RANGE (DAYOFYEAR(a)) (
1451 PARTITION p VALUES LESS THAN (231),
1452 PARTITION pmax VALUES LESS THAN MAXVALUE);
1453 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1454 ALTER TABLE old
1455 PARTITION BY RANGE (DAYOFYEAR(a)) (
1456 PARTITION p VALUES LESS THAN (231),
1457 PARTITION pmax VALUES LESS THAN MAXVALUE);
1458 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1459 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1460 PARTITION BY RANGE (DAYOFMONTH(a)) (
1461 PARTITION p VALUES LESS THAN (19),
1462 PARTITION pmax VALUES LESS THAN MAXVALUE);
1463 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1464 ALTER TABLE old
1465 PARTITION BY RANGE (DAYOFMONTH(a)) (
1466 PARTITION p VALUES LESS THAN (19),
1467 PARTITION pmax VALUES LESS THAN MAXVALUE);
1468 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1469 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1470 PARTITION BY RANGE (DAYOFWEEK(a)) (
1471 PARTITION p VALUES LESS THAN (3),
1472 PARTITION pmax VALUES LESS THAN MAXVALUE);
1473 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1474 ALTER TABLE old
1475 PARTITION BY RANGE (DAYOFWEEK(a)) (
1476 PARTITION p VALUES LESS THAN (3),
1477 PARTITION pmax VALUES LESS THAN MAXVALUE);
1478 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1479 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1480 PARTITION BY RANGE (MONTH(a)) (
1481 PARTITION p VALUES LESS THAN (8),
1482 PARTITION pmax VALUES LESS THAN MAXVALUE);
1483 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1484 ALTER TABLE old
1485 PARTITION BY RANGE (MONTH(a)) (
1486 PARTITION p VALUES LESS THAN (8),
1487 PARTITION pmax VALUES LESS THAN MAXVALUE);
1488 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1489 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1490 PARTITION BY RANGE (HOUR(a)) (
1491 PARTITION p VALUES LESS THAN (17),
1492 PARTITION pmax VALUES LESS THAN MAXVALUE);
1493 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1494 ALTER TABLE old
1495 PARTITION BY RANGE (HOUR(a)) (
1496 PARTITION p VALUES LESS THAN (17),
1497 PARTITION pmax VALUES LESS THAN MAXVALUE);
1498 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1499 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1500 PARTITION BY RANGE (MINUTE(a)) (
1501 PARTITION p VALUES LESS THAN (55),
1502 PARTITION pmax VALUES LESS THAN MAXVALUE);
1503 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1504 ALTER TABLE old
1505 PARTITION BY RANGE (MINUTE(a)) (
1506 PARTITION p VALUES LESS THAN (55),
1507 PARTITION pmax VALUES LESS THAN MAXVALUE);
1508 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1509 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1510 PARTITION BY RANGE (QUARTER(a)) (
1511 PARTITION p VALUES LESS THAN (3),
1512 PARTITION pmax VALUES LESS THAN MAXVALUE);
1513 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1514 ALTER TABLE old
1515 PARTITION BY RANGE (QUARTER(a)) (
1516 PARTITION p VALUES LESS THAN (3),
1517 PARTITION pmax VALUES LESS THAN MAXVALUE);
1518 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1519 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1520 PARTITION BY RANGE (SECOND(a)) (
1521 PARTITION p VALUES LESS THAN (7),
1522 PARTITION pmax VALUES LESS THAN MAXVALUE);
1523 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1524 ALTER TABLE old
1525 PARTITION BY RANGE (SECOND(a)) (
1526 PARTITION p VALUES LESS THAN (7),
1527 PARTITION pmax VALUES LESS THAN MAXVALUE);
1528 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1529 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1530 PARTITION BY RANGE (YEARWEEK(a)) (
1531 PARTITION p VALUES LESS THAN (200833),
1532 PARTITION pmax VALUES LESS THAN MAXVALUE);
1533 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1534 ALTER TABLE old
1535 PARTITION BY RANGE (YEARWEEK(a)) (
1536 PARTITION p VALUES LESS THAN (200833),
1537 PARTITION pmax VALUES LESS THAN MAXVALUE);
1538 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1539 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1540 PARTITION BY RANGE (YEAR(a)) (
1541 PARTITION p VALUES LESS THAN (2008),
1542 PARTITION pmax VALUES LESS THAN MAXVALUE);
1543 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1544 ALTER TABLE old
1545 PARTITION BY RANGE (YEAR(a)) (
1546 PARTITION p VALUES LESS THAN (2008),
1547 PARTITION pmax VALUES LESS THAN MAXVALUE);
1548 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1549 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1550 PARTITION BY RANGE (WEEKDAY(a)) (
1551 PARTITION p VALUES LESS THAN (3),
1552 PARTITION pmax VALUES LESS THAN MAXVALUE);
1553 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1554 ALTER TABLE old
1555 PARTITION BY RANGE (WEEKDAY(a)) (
1556 PARTITION p VALUES LESS THAN (3),
1557 PARTITION pmax VALUES LESS THAN MAXVALUE);
1558 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1559 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1560 PARTITION BY RANGE (TIME_TO_SEC(a)) (
1561 PARTITION p VALUES LESS THAN (64507),
1562 PARTITION pmax VALUES LESS THAN MAXVALUE);
1563 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1564 ALTER TABLE old
1565 PARTITION BY RANGE (TIME_TO_SEC(a)) (
1566 PARTITION p VALUES LESS THAN (64507),
1567 PARTITION pmax VALUES LESS THAN MAXVALUE);
1568 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1569 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1570 PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
1571 PARTITION p VALUES LESS THAN (18),
1572 PARTITION pmax VALUES LESS THAN MAXVALUE);
1573 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1574 ALTER TABLE old
1575 PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
1576 PARTITION p VALUES LESS THAN (18),
1577 PARTITION pmax VALUES LESS THAN MAXVALUE);
1578 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1579 CREATE TABLE new (a TIMESTAMP NOT NULL, b TIMESTAMP NOT NULL, PRIMARY KEY(a,b))
1580 PARTITION BY RANGE (DATEDIFF(a, a)) (
1581 PARTITION p VALUES LESS THAN (18),
1582 PARTITION pmax VALUES LESS THAN MAXVALUE);
1583 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1584 ALTER TABLE old
1585 PARTITION BY RANGE (DATEDIFF(a, a)) (
1586 PARTITION p VALUES LESS THAN (18),
1587 PARTITION pmax VALUES LESS THAN MAXVALUE);
1588 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1589 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1590 PARTITION BY RANGE (YEAR(a + 0)) (
1591 PARTITION p VALUES LESS THAN (2008),
1592 PARTITION pmax VALUES LESS THAN MAXVALUE);
1593 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1594 ALTER TABLE old
1595 PARTITION BY RANGE (YEAR(a + 0)) (
1596 PARTITION p VALUES LESS THAN (2008),
1597 PARTITION pmax VALUES LESS THAN MAXVALUE);
1598 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1599 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1600 PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
1601 PARTITION p VALUES LESS THAN (733638),
1602 PARTITION pmax VALUES LESS THAN MAXVALUE);
1603 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1604 ALTER TABLE old
1605 PARTITION BY RANGE (TO_DAYS(a + '2008-01-01')) (
1606 PARTITION p VALUES LESS THAN (733638),
1607 PARTITION pmax VALUES LESS THAN MAXVALUE);
1608 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1609 CREATE TABLE new (a TIMESTAMP NOT NULL PRIMARY KEY)
1610 PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
1611 PARTITION p VALUES LESS THAN (2008),
1612 PARTITION pmax VALUES LESS THAN MAXVALUE);
1613 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1614 ALTER TABLE old
1615 PARTITION BY RANGE (YEAR(a + '2008-01-01')) (
1616 PARTITION p VALUES LESS THAN (2008),
1617 PARTITION pmax VALUES LESS THAN MAXVALUE);
1618 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1619 ALTER TABLE old ADD COLUMN b DATE;
1620 CREATE TABLE new (a TIMESTAMP, b DATE)
1621 PARTITION BY RANGE (YEAR(a + b)) (
1622 PARTITION p VALUES LESS THAN (2008),
1623 PARTITION pmax VALUES LESS THAN MAXVALUE);
1624 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1625 ALTER TABLE old
1626 PARTITION BY RANGE (YEAR(a + b)) (
1627 PARTITION p VALUES LESS THAN (2008),
1628 PARTITION pmax VALUES LESS THAN MAXVALUE);
1629 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1630 CREATE TABLE new (a TIMESTAMP, b DATE)
1631 PARTITION BY RANGE (TO_DAYS(a + b)) (
1632 PARTITION p VALUES LESS THAN (733638),
1633 PARTITION pmax VALUES LESS THAN MAXVALUE);
1634 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1635 ALTER TABLE old
1636 PARTITION BY RANGE (TO_DAYS(a + b)) (
1637 PARTITION p VALUES LESS THAN (733638),
1638 PARTITION pmax VALUES LESS THAN MAXVALUE);
1639 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1640 CREATE TABLE new (a TIMESTAMP, b date)
1641 PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
1642 PARTITION p VALUES LESS THAN (1219089600),
1643 PARTITION pmax VALUES LESS THAN MAXVALUE);
1644 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1645 ALTER TABLE old
1646 PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
1647 PARTITION p VALUES LESS THAN (1219089600),
1648 PARTITION pmax VALUES LESS THAN MAXVALUE);
1649 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1650 CREATE TABLE new (a TIMESTAMP, b TIMESTAMP)
1651 PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
1652 PARTITION p VALUES LESS THAN (1219089600),
1653 PARTITION pmax VALUES LESS THAN MAXVALUE);
1654 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1655 ALTER TABLE old MODIFY b TIMESTAMP;
1656 ALTER TABLE old
1657 PARTITION BY RANGE (UNIX_TIMESTAMP(a + b)) (
1658 PARTITION p VALUES LESS THAN (1219089600),
1659 PARTITION pmax VALUES LESS THAN MAXVALUE);
1660 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1661 DROP TABLE old;
1663 # Bug #56709: Memory leaks at running the 5.1 test suite
1665 CREATE TABLE t1 (a TIMESTAMP NOT NULL PRIMARY KEY);
1666 ALTER TABLE t1
1667 PARTITION BY RANGE (EXTRACT(DAY FROM a)) (
1668 PARTITION p VALUES LESS THAN (18),
1669 PARTITION pmax VALUES LESS THAN MAXVALUE);
1670 ERROR HY000: Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed
1671 DROP TABLE t1;
1672 End of 5.1 tests