2
SET @@session.storage_engine = 'InnoDB';
4
#------------------------------------------------------------------------
5
# 0. Setting of auxiliary variables + Creation of an auxiliary tables
6
# needed in many testcases
7
#------------------------------------------------------------------------
8
SELECT @max_row DIV 2 INTO @max_row_div2;
9
SELECT @max_row DIV 3 INTO @max_row_div3;
10
SELECT @max_row DIV 4 INTO @max_row_div4;
11
SET @max_int_4 = 2147483647;
12
DROP TABLE IF EXISTS t0_template;
13
CREATE TABLE t0_template (
18
f_charbig VARCHAR(1000) ,
21
# Logging of <max_row> INSERTs into t0_template suppressed
22
DROP TABLE IF EXISTS t0_definition;
23
CREATE TABLE t0_definition (
25
create_command VARBINARY(5000),
26
file_list VARBINARY(10000),
29
DROP TABLE IF EXISTS t0_aux;
30
CREATE TABLE t0_aux ( f_int1 INTEGER,
34
f_charbig VARCHAR(1000) )
37
SET @@session.sql_mode= '';
38
# End of basic preparations needed for all tests
39
#-----------------------------------------------
41
#========================================================================
42
# 1. Any PRIMARY KEYs or UNIQUE INDEXes must contain the columns used
43
# within the partitioning functions
44
#========================================================================
45
DROP TABLE IF EXISTS t1;
46
#------------------------------------------------------------------------
47
# 1.1 column of partitioning function not included in PRIMARY KEY
48
# PARTITION BY HASH/KEY/LIST/RANGE
49
#------------------------------------------------------------------------
55
f_charbig VARCHAR(1000),
58
PARTITION BY HASH(f_int1) PARTITIONS 2;
59
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
65
f_charbig VARCHAR(1000),
68
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
69
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
75
f_charbig VARCHAR(1000),
78
PARTITION BY KEY(f_int1) PARTITIONS 2;
79
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
85
f_charbig VARCHAR(1000),
88
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
89
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
95
f_charbig VARCHAR(1000),
98
PARTITION BY LIST(f_int1)
99
(PARTITION part1 VALUES IN (1));
100
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
106
f_charbig VARCHAR(1000),
109
PARTITION BY LIST(f_int1 + f_int2)
110
(PARTITION part1 VALUES IN (1));
111
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
117
f_charbig VARCHAR(1000),
120
PARTITION BY RANGE(f_int1)
121
(PARTITION part1 VALUES LESS THAN (1));
122
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
128
f_charbig VARCHAR(1000),
131
PARTITION BY RANGE(f_int1 + f_int2)
132
(PARTITION part1 VALUES LESS THAN (1));
133
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
134
#------------------------------------------------------------------------
135
# 1.2 column of partitioning function not included in UNIQUE INDEX
136
# PARTITION BY HASH/KEY/LIST/RANGE
137
# Variant a) Without additional PRIMARY KEY
138
# Variant b) With correct additional PRIMARY KEY
139
# Variant 1) one column in partitioning function
140
# Variant 2) two columns in partitioning function
141
#------------------------------------------------------------------------
147
f_charbig VARCHAR(1000),
148
UNIQUE INDEX (f_int2)
150
PARTITION BY HASH(f_int1) PARTITIONS 2;
151
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
157
f_charbig VARCHAR(1000),
158
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
160
PARTITION BY HASH(f_int1) PARTITIONS 2;
161
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
167
f_charbig VARCHAR(1000),
168
UNIQUE INDEX (f_int2)
170
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
171
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
177
f_charbig VARCHAR(1000),
178
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
180
PARTITION BY HASH(f_int1 + f_int2) PARTITIONS 2;
181
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
187
f_charbig VARCHAR(1000),
188
UNIQUE INDEX (f_int2)
190
PARTITION BY KEY(f_int1) PARTITIONS 2;
191
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
197
f_charbig VARCHAR(1000),
198
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
200
PARTITION BY KEY(f_int1) PARTITIONS 2;
201
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
207
f_charbig VARCHAR(1000),
208
UNIQUE INDEX (f_int2)
210
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
211
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
217
f_charbig VARCHAR(1000),
218
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
220
PARTITION BY KEY(f_int1,f_int2) PARTITIONS 2;
221
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
227
f_charbig VARCHAR(1000),
228
UNIQUE INDEX (f_int2)
230
PARTITION BY LIST(MOD(f_int1,3))
231
(PARTITION partN VALUES IN (NULL),
232
PARTITION part0 VALUES IN (0),
233
PARTITION part1 VALUES IN (1),
234
PARTITION part2 VALUES IN (2));
235
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
241
f_charbig VARCHAR(1000),
242
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
244
PARTITION BY LIST(MOD(f_int1,3))
245
(PARTITION partN VALUES IN (NULL),
246
PARTITION part0 VALUES IN (0),
247
PARTITION part1 VALUES IN (1),
248
PARTITION part2 VALUES IN (2));
249
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
255
f_charbig VARCHAR(1000),
256
UNIQUE INDEX (f_int2)
258
PARTITION BY LIST(MOD(f_int1 + f_int2,3))
259
(PARTITION partN VALUES IN (NULL),
260
PARTITION part0 VALUES IN (0),
261
PARTITION part1 VALUES IN (1),
262
PARTITION part2 VALUES IN (2));
263
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
269
f_charbig VARCHAR(1000),
270
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
272
PARTITION BY LIST(MOD(f_int1 + f_int2,3))
273
(PARTITION partN VALUES IN (NULL),
274
PARTITION part0 VALUES IN (0),
275
PARTITION part1 VALUES IN (1),
276
PARTITION part2 VALUES IN (2));
277
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
283
f_charbig VARCHAR(1000),
284
UNIQUE INDEX (f_int2)
286
PARTITION BY RANGE(f_int1)
287
(PARTITION part1 VALUES LESS THAN (1),
288
PARTITION part2 VALUES LESS THAN (2147483646));
289
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
295
f_charbig VARCHAR(1000),
296
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
298
PARTITION BY RANGE(f_int1)
299
(PARTITION part1 VALUES LESS THAN (1),
300
PARTITION part2 VALUES LESS THAN (2147483646));
301
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
307
f_charbig VARCHAR(1000),
308
UNIQUE INDEX (f_int2)
310
PARTITION BY RANGE(f_int1 + f_int2)
311
(PARTITION part1 VALUES LESS THAN (1),
312
PARTITION part2 VALUES LESS THAN (2147483646));
313
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
319
f_charbig VARCHAR(1000),
320
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
322
PARTITION BY RANGE(f_int1 + f_int2)
323
(PARTITION part1 VALUES LESS THAN (1),
324
PARTITION part2 VALUES LESS THAN (2147483646));
325
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
326
#------------------------------------------------------------------------
327
# 1.3 column of subpartitioning function not included in PRIMARY KEY
328
# PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
329
#------------------------------------------------------------------------
335
f_charbig VARCHAR(1000),
338
PARTITION BY RANGE(f_int2) SUBPARTITION BY HASH(f_int1)
339
(PARTITION part1 VALUES LESS THAN (1)
340
(SUBPARTITION subpart1));
341
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
347
f_charbig VARCHAR(1000),
350
PARTITION BY RANGE(f_int2) SUBPARTITION BY KEY(f_int1)
351
(PARTITION part1 VALUES LESS THAN (1)
352
(SUBPARTITION subpart1));
353
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
359
f_charbig VARCHAR(1000),
362
PARTITION BY LIST(f_int2) SUBPARTITION BY HASH(f_int1)
363
(PARTITION part1 VALUES IN (1)
364
(SUBPARTITION subpart1));
365
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
371
f_charbig VARCHAR(1000),
374
PARTITION BY LIST(f_int2) SUBPARTITION BY KEY(f_int1)
375
(PARTITION part1 VALUES IN (1)
376
(SUBPARTITION subpart1));
377
ERROR HY000: A PRIMARY KEY must include all columns in the table's partitioning function
378
#------------------------------------------------------------------------
379
# 1.4 column of subpartitioning function not included in UNIQUE INDEX
380
# PARTITION BY RANGE/LIST -- SUBPARTITION BY HASH/KEY
381
# Variant a) Without additional PRIMARY KEY
382
# Variant b) With correct additional PRIMARY KEY
383
#------------------------------------------------------------------------
389
f_charbig VARCHAR(1000),
390
UNIQUE INDEX (f_int2)
392
PARTITION BY RANGE(f_int2)
393
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
394
(PARTITION part1 VALUES LESS THAN (1),
395
PARTITION part2 VALUES LESS THAN (2147483646));
396
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
402
f_charbig VARCHAR(1000),
403
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
405
PARTITION BY RANGE(f_int2)
406
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 3
407
(PARTITION part1 VALUES LESS THAN (1),
408
PARTITION part2 VALUES LESS THAN (2147483646));
409
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
415
f_charbig VARCHAR(1000),
416
UNIQUE INDEX (f_int2)
418
PARTITION BY RANGE(f_int2)
419
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
420
(PARTITION part1 VALUES LESS THAN (1),
421
PARTITION part2 VALUES LESS THAN (2147483646));
422
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
428
f_charbig VARCHAR(1000),
429
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
431
PARTITION BY RANGE(f_int2)
432
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 3
433
(PARTITION part1 VALUES LESS THAN (1),
434
PARTITION part2 VALUES LESS THAN (2147483646));
435
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
441
f_charbig VARCHAR(1000),
442
UNIQUE INDEX (f_int2)
444
PARTITION BY LIST(MOD(f_int2,3))
445
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
446
(PARTITION partN VALUES IN (NULL),
447
PARTITION part0 VALUES IN (0),
448
PARTITION part1 VALUES IN (1),
449
PARTITION part2 VALUES IN (2));
450
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
456
f_charbig VARCHAR(1000),
457
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
459
PARTITION BY LIST(MOD(f_int2,3))
460
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
461
(PARTITION partN VALUES IN (NULL),
462
PARTITION part0 VALUES IN (0),
463
PARTITION part1 VALUES IN (1),
464
PARTITION part2 VALUES IN (2));
465
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
471
f_charbig VARCHAR(1000),
472
UNIQUE INDEX (f_int2)
474
PARTITION BY LIST(MOD(f_int2,3))
475
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2
476
(PARTITION partN VALUES IN (NULL),
477
PARTITION part0 VALUES IN (0),
478
PARTITION part1 VALUES IN (1),
479
PARTITION part2 VALUES IN (2));
480
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
486
f_charbig VARCHAR(1000),
487
PRIMARY KEY(f_int1,f_int2), UNIQUE INDEX (f_int2)
489
PARTITION BY LIST(MOD(f_int2,3))
490
SUBPARTITION BY KEY(f_int1) SUBPARTITIONS 2
491
(PARTITION partN VALUES IN (NULL),
492
PARTITION part0 VALUES IN (0),
493
PARTITION part1 VALUES IN (1),
494
PARTITION part2 VALUES IN (2));
495
ERROR HY000: A UNIQUE INDEX must include all columns in the table's partitioning function
497
#========================================================================
498
# 2 Some properties around subpartitioning
499
#========================================================================
500
#------------------------------------------------------------------------
501
# 2.1 Subpartioned table without subpartitioning rule must be rejected
502
#------------------------------------------------------------------------
503
DROP TABLE IF EXISTS t1;
509
f_charbig VARCHAR(1000)
511
PARTITION BY RANGE(f_int1)
512
( PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11));
513
ERROR HY000: It is only possible to mix RANGE/LIST partitioning with HASH/KEY partitioning for subpartitioning
514
#------------------------------------------------------------------------
515
# 2.2 Every partition must have the same number of subpartitions.
516
# This is a limitation of MySQL 5.1, which could be removed in
518
#------------------------------------------------------------------------
524
f_charbig VARCHAR(1000),
527
PARTITION BY RANGE(f_int1) SUBPARTITION BY KEY(f_int1)
529
PARTITION part1 VALUES LESS THAN (0)
530
(SUBPARTITION subpart1),
531
PARTITION part2 VALUES LESS THAN (5)
532
(SUBPARTITION subpart1, SUBPARTITION subpart2));
533
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 14
535
#========================================================================
537
#========================================================================
538
#------------------------------------------------------------------------
539
# 3.1 The constants in VALUES IN clauses must differ
540
#------------------------------------------------------------------------
546
f_charbig VARCHAR(1000)
548
PARTITION BY LIST(MOD(f_int1,2))
549
( PARTITION part1 VALUES IN (-1),
550
PARTITION part2 VALUES IN (0),
551
PARTITION part3 VALUES IN (-1));
552
ERROR HY000: Multiple definition of same constant in list partitioning
553
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT)
554
PARTITION BY RANGE(f1)
555
(PARTITION part1 VALUES LESS THAN (0),
556
PARTITION part2 VALUES LESS THAN (0),
557
PARTITION part3 VALUES LESS THAN (10000));
558
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
559
#------------------------------------------------------------------------
560
# 3.2 The constants in VALUES LESS must be in increasing order
561
#------------------------------------------------------------------------
562
CREATE TABLE t1 (f1 BIGINT, f2 BIGINT)
563
PARTITION BY RANGE(f1)
564
(PARTITION part1 VALUES LESS THAN (0),
565
PARTITION part2 VALUES LESS THAN (-1),
566
PARTITION part3 VALUES LESS THAN (10000));
567
ERROR HY000: VALUES LESS THAN value must be strictly increasing for each partition
568
#------------------------------------------------------------------------
569
# 3.3 LIST partitions must be defined with VALUES IN
570
#------------------------------------------------------------------------
576
f_charbig VARCHAR(1000)
578
PARTITION BY LIST(MOD(f_int1,2))
579
( PARTITION part1 VALUES LESS THAN (-1),
580
PARTITION part2 VALUES LESS THAN (0),
581
PARTITION part3 VALUES LESS THAN (1000));
582
ERROR HY000: Only RANGE PARTITIONING can use VALUES LESS THAN in partition definition
583
#------------------------------------------------------------------------
584
# 3.4 RANGE partitions must be defined with VALUES LESS THAN
585
#------------------------------------------------------------------------
591
f_charbig VARCHAR(1000)
593
PARTITION BY RANGE(f_int1)
594
( PARTITION part1 VALUES IN (-1),
595
PARTITION part2 VALUES IN (0),
596
PARTITION part3 VALUES IN (1000));
597
ERROR HY000: Only LIST PARTITIONING can use VALUES IN in partition definition
598
#------------------------------------------------------------------------
599
# 3.5 Use of NULL in VALUES clauses
600
#------------------------------------------------------------------------
601
# 3.5.1 NULL in RANGE partitioning clause
602
# 3.5.1.1 VALUE LESS THAN (NULL) is not allowed
608
f_charbig VARCHAR(1000)
610
PARTITION BY RANGE(f_int1)
611
( PARTITION part1 VALUES LESS THAN (NULL),
612
PARTITION part2 VALUES LESS THAN (1000));
613
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
614
PARTITION part2 VALUES LESS THAN (1000))' at line 9
615
# 3.5.1.2 VALUE LESS THAN (NULL) is not allowed
621
f_charbig VARCHAR(1000)
623
PARTITION BY RANGE(f_int1)
624
( PARTITION part1 VALUES LESS THAN (NULL),
625
PARTITION part2 VALUES LESS THAN (1000));
626
ERROR 42000: Not allowed to use NULL value in VALUES LESS THAN near '),
627
PARTITION part2 VALUES LESS THAN (1000))' at line 9
628
# 3.5.2 NULL in LIST partitioning clause
629
# 3.5.2.1 VALUE IN (NULL)
635
f_charbig VARCHAR(1000)
637
PARTITION BY LIST(MOD(f_int1,2))
638
( PARTITION part1 VALUES IN (NULL),
639
PARTITION part2 VALUES IN (0),
640
PARTITION part3 VALUES IN (1));
642
# 3.5.2.2 VALUE IN (NULL)
648
f_charbig VARCHAR(1000)
650
PARTITION BY LIST(MOD(f_int1,2))
651
( PARTITION part1 VALUES IN (NULL),
652
PARTITION part3 VALUES IN (1));
654
SHOW CREATE TABLE t1;
656
t1 CREATE TABLE `t1` (
657
`f_int1` int(11) DEFAULT NULL,
658
`f_int2` int(11) DEFAULT NULL,
659
`f_char1` char(20) DEFAULT NULL,
660
`f_char2` char(20) DEFAULT NULL,
661
`f_charbig` varchar(1000) DEFAULT NULL
662
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB, PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */
665
# 3.5.3 Reveal that IN (...NULL) is not mapped to IN(0)
671
f_charbig VARCHAR(1000)
673
PARTITION BY LIST(MOD(f_int1,2))
674
( PARTITION part1 VALUES IN (NULL),
675
PARTITION part2 VALUES IN (0),
676
PARTITION part3 VALUES IN (1));
678
SHOW CREATE TABLE t1;
680
t1 CREATE TABLE `t1` (
681
`f_int1` int(11) DEFAULT NULL,
682
`f_int2` int(11) DEFAULT NULL,
683
`f_char1` char(20) DEFAULT NULL,
684
`f_char2` char(20) DEFAULT NULL,
685
`f_charbig` varchar(1000) DEFAULT NULL
686
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (MOD(f_int1,2)) (PARTITION part1 VALUES IN (NULL) ENGINE = InnoDB, PARTITION part2 VALUES IN (0) ENGINE = InnoDB, PARTITION part3 VALUES IN (1) ENGINE = InnoDB) */
690
#========================================================================
691
# 4. Check assigning the number of partitions and subpartitions
692
# with and without named partitions/subpartitions
693
#========================================================================
694
DROP TABLE IF EXISTS t1;
695
#------------------------------------------------------------------------
696
# 4.1 (positive) without partition/subpartition number assignment
697
#------------------------------------------------------------------------
698
# 4.1.1 no partition number, no named partitions
704
f_charbig VARCHAR(1000)
706
PARTITION BY HASH(f_int1);
708
SHOW CREATE TABLE t1;
710
t1 CREATE TABLE `t1` (
711
`f_int1` int(11) DEFAULT NULL,
712
`f_int2` int(11) DEFAULT NULL,
713
`f_char1` char(20) DEFAULT NULL,
714
`f_char2` char(20) DEFAULT NULL,
715
`f_charbig` varchar(1000) DEFAULT NULL
716
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) */
719
# 4.1.2 no partition number, named partitions
725
f_charbig VARCHAR(1000)
727
PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part2);
729
SHOW CREATE TABLE t1;
731
t1 CREATE TABLE `t1` (
732
`f_int1` int(11) DEFAULT NULL,
733
`f_int2` int(11) DEFAULT NULL,
734
`f_char1` char(20) DEFAULT NULL,
735
`f_char2` char(20) DEFAULT NULL,
736
`f_charbig` varchar(1000) DEFAULT NULL
737
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
740
# 4.1.3 variations on no partition/subpartition number, named partitions,
741
# different subpartitions are/are not named
742
CREATE TABLE t1 ( f_int1 INTEGER,
746
f_charbig VARCHAR(1000) )
747
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
749
CREATE TABLE t1 ( f_int1 INTEGER,
753
f_charbig VARCHAR(1000) )
754
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
755
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
756
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '))' at line 7
757
CREATE TABLE t1 ( f_int1 INTEGER,
761
f_charbig VARCHAR(1000) )
762
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
763
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
764
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
765
CREATE TABLE t1 ( f_int1 INTEGER,
769
f_charbig VARCHAR(1000) )
770
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10), PARTITION part2 VALUES LESS THAN (20)
771
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
772
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
773
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '), PARTITION part3 VALUES LESS THAN (2147483646)
774
(SUBPARTITION subpart31 , SUBPA' at line 7
775
CREATE TABLE t1 ( f_int1 INTEGER,
779
f_charbig VARCHAR(1000) )
780
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
781
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)) ;
782
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646))' at line 7
783
CREATE TABLE t1 ( f_int1 INTEGER,
787
f_charbig VARCHAR(1000) )
788
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
789
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20), PARTITION part3 VALUES LESS THAN (2147483646)
790
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
791
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ' PARTITION part3 VALUES LESS THAN (2147483646)
792
(SUBPARTITION subpart31 , SUBPART' at line 7
793
CREATE TABLE t1 ( f_int1 INTEGER,
797
f_charbig VARCHAR(1000) )
798
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
799
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20)
800
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)) ;
801
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')' at line 8
802
CREATE TABLE t1 ( f_int1 INTEGER,
806
f_charbig VARCHAR(1000) )
807
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1) (PARTITION part1 VALUES LESS THAN (10)
808
(SUBPARTITION subpart11 , SUBPARTITION subpart12 ), PARTITION part2 VALUES LESS THAN (20)
809
(SUBPARTITION subpart21 , SUBPARTITION subpart22 ), PARTITION part3 VALUES LESS THAN (2147483646)
810
(SUBPARTITION subpart31 , SUBPARTITION subpart32 )) ;
812
SHOW CREATE TABLE t1;
814
t1 CREATE TABLE `t1` (
815
`f_int1` int(11) DEFAULT NULL,
816
`f_int2` int(11) DEFAULT NULL,
817
`f_char1` char(20) DEFAULT NULL,
818
`f_char2` char(20) DEFAULT NULL,
819
`f_charbig` varchar(1000) DEFAULT NULL
820
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (10) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (20) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB), PARTITION part3 VALUES LESS THAN (2147483646) (SUBPARTITION subpart31 ENGINE = InnoDB, SUBPARTITION subpart32 ENGINE = InnoDB)) */
823
#------------------------------------------------------------------------
824
# 4.2 partition/subpartition numbers good and bad values and notations
825
#------------------------------------------------------------------------
826
DROP TABLE IF EXISTS t1;
827
# 4.2.1 partition/subpartition numbers INTEGER notation
833
f_charbig VARCHAR(1000)
835
PARTITION BY HASH(f_int1) PARTITIONS 2;
837
SHOW CREATE TABLE t1;
839
t1 CREATE TABLE `t1` (
840
`f_int1` int(11) DEFAULT NULL,
841
`f_int2` int(11) DEFAULT NULL,
842
`f_char1` char(20) DEFAULT NULL,
843
`f_char2` char(20) DEFAULT NULL,
844
`f_charbig` varchar(1000) DEFAULT NULL
845
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 2 */
853
f_charbig VARCHAR(1000)
855
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
857
(PARTITION part1 VALUES LESS THAN (10),
858
PARTITION part2 VALUES LESS THAN (2147483646));
860
SHOW CREATE TABLE t1;
862
t1 CREATE TABLE `t1` (
863
`f_int1` int(11) DEFAULT NULL,
864
`f_int2` int(11) DEFAULT NULL,
865
`f_char1` char(20) DEFAULT NULL,
866
`f_char2` char(20) DEFAULT NULL,
867
`f_charbig` varchar(1000) DEFAULT NULL
868
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 2 (PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
876
f_charbig VARCHAR(1000)
878
PARTITION BY HASH(f_int1) PARTITIONS 1;
880
SHOW CREATE TABLE t1;
882
t1 CREATE TABLE `t1` (
883
`f_int1` int(11) DEFAULT NULL,
884
`f_int2` int(11) DEFAULT NULL,
885
`f_char1` char(20) DEFAULT NULL,
886
`f_char2` char(20) DEFAULT NULL,
887
`f_charbig` varchar(1000) DEFAULT NULL
888
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) PARTITIONS 1 */
896
f_charbig VARCHAR(1000)
898
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
900
(PARTITION part1 VALUES LESS THAN (10),
901
PARTITION part2 VALUES LESS THAN (2147483646));
903
SHOW CREATE TABLE t1;
905
t1 CREATE TABLE `t1` (
906
`f_int1` int(11) DEFAULT NULL,
907
`f_int2` int(11) DEFAULT NULL,
908
`f_char1` char(20) DEFAULT NULL,
909
`f_char2` char(20) DEFAULT NULL,
910
`f_charbig` varchar(1000) DEFAULT NULL
911
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) SUBPARTITIONS 1 (PARTITION part1 VALUES LESS THAN (10) ENGINE = InnoDB, PARTITION part2 VALUES LESS THAN (2147483646) ENGINE = InnoDB) */
919
f_charbig VARCHAR(1000)
921
PARTITION BY HASH(f_int1) PARTITIONS 0;
922
ERROR HY000: Number of partitions = 0 is not an allowed value
928
f_charbig VARCHAR(1000)
930
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
932
(PARTITION part1 VALUES LESS THAN (10),
933
PARTITION part2 VALUES LESS THAN (2147483646));
934
ERROR HY000: Number of subpartitions = 0 is not an allowed value
940
f_charbig VARCHAR(1000)
942
PARTITION BY HASH(f_int1) PARTITIONS -1;
943
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 '-1' at line 8
949
f_charbig VARCHAR(1000)
951
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
953
(PARTITION part1 VALUES LESS THAN (10),
954
PARTITION part2 VALUES LESS THAN (2147483646));
955
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 '-1
956
(PARTITION part1 VALUES LESS THAN (10),
957
PARTITION part2 VALUES LESS THAN (214' at line 9
963
f_charbig VARCHAR(1000)
965
PARTITION BY HASH(f_int1) PARTITIONS 1000000;
966
ERROR HY000: Too many partitions (including subpartitions) were defined
972
f_charbig VARCHAR(1000)
974
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
975
SUBPARTITIONS 1000000
976
(PARTITION part1 VALUES LESS THAN (10),
977
PARTITION part2 VALUES LESS THAN (2147483646));
978
ERROR HY000: Too many partitions (including subpartitions) were defined
979
# 4.2.2 partition/subpartition numbers DECIMAL notation
985
f_charbig VARCHAR(1000)
987
PARTITION BY HASH(f_int1) PARTITIONS 2.0;
988
ERROR 42000: Only integers allowed as number here near '2.0' at line 8
994
f_charbig VARCHAR(1000)
996
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
998
(PARTITION part1 VALUES LESS THAN (10),
999
PARTITION part2 VALUES LESS THAN (2147483646));
1000
ERROR 42000: Only integers allowed as number here near '2.0
1001
(PARTITION part1 VALUES LESS THAN (10),
1002
PARTITION part2 VALUES LESS THAN (21' at line 9
1008
f_charbig VARCHAR(1000)
1010
PARTITION BY HASH(f_int1) PARTITIONS -2.0;
1011
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.0' at line 8
1017
f_charbig VARCHAR(1000)
1019
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1021
(PARTITION part1 VALUES LESS THAN (10),
1022
PARTITION part2 VALUES LESS THAN (2147483646));
1023
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.0
1024
(PARTITION part1 VALUES LESS THAN (10),
1025
PARTITION part2 VALUES LESS THAN (2' at line 9
1031
f_charbig VARCHAR(1000)
1033
PARTITION BY HASH(f_int1) PARTITIONS 0.0;
1034
ERROR 42000: Only integers allowed as number here near '0.0' at line 8
1040
f_charbig VARCHAR(1000)
1042
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1044
(PARTITION part1 VALUES LESS THAN (10),
1045
PARTITION part2 VALUES LESS THAN (2147483646));
1046
ERROR 42000: Only integers allowed as number here near '0.0
1047
(PARTITION part1 VALUES LESS THAN (10),
1048
PARTITION part2 VALUES LESS THAN (21' at line 9
1054
f_charbig VARCHAR(1000)
1056
PARTITION BY HASH(f_int1) PARTITIONS 1.6;
1057
ERROR 42000: Only integers allowed as number here near '1.6' at line 8
1063
f_charbig VARCHAR(1000)
1065
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1067
(PARTITION part1 VALUES LESS THAN (10),
1068
PARTITION part2 VALUES LESS THAN (2147483646));
1069
ERROR 42000: Only integers allowed as number here near '1.6
1070
(PARTITION part1 VALUES LESS THAN (10),
1071
PARTITION part2 VALUES LESS THAN (21' at line 9
1077
f_charbig VARCHAR(1000)
1079
PARTITION BY HASH(f_int1) PARTITIONS 999999999999999999999999999999.999999999999999999999999999999;
1080
ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999' at line 8
1086
f_charbig VARCHAR(1000)
1088
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1089
SUBPARTITIONS 999999999999999999999999999999.999999999999999999999999999999
1090
(PARTITION part1 VALUES LESS THAN (10),
1091
PARTITION part2 VALUES LESS THAN (2147483646));
1092
ERROR 42000: Only integers allowed as number here near '999999999999999999999999999999.999999999999999999999999999999
1093
(PARTITION part1 V' at line 9
1099
f_charbig VARCHAR(1000)
1101
PARTITION BY HASH(f_int1) PARTITIONS 0.000000000000000000000000000001;
1102
ERROR 42000: Only integers allowed as number here near '0.000000000000000000000000000001' at line 8
1108
f_charbig VARCHAR(1000)
1110
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1111
SUBPARTITIONS 0.000000000000000000000000000001
1112
(PARTITION part1 VALUES LESS THAN (10),
1113
PARTITION part2 VALUES LESS THAN (2147483646));
1114
ERROR 42000: Only integers allowed as number here near '0.000000000000000000000000000001
1115
(PARTITION part1 VALUES LESS THAN (10),
1117
# 4.2.3 partition/subpartition numbers FLOAT notation
1123
f_charbig VARCHAR(1000)
1125
PARTITION BY HASH(f_int1) PARTITIONS 2.0E+0;
1126
ERROR 42000: Only integers allowed as number here near '2.0E+0' at line 8
1132
f_charbig VARCHAR(1000)
1134
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1135
SUBPARTITIONS 2.0E+0
1136
(PARTITION part1 VALUES LESS THAN (10),
1137
PARTITION part2 VALUES LESS THAN (2147483646));
1138
ERROR 42000: Only integers allowed as number here near '2.0E+0
1139
(PARTITION part1 VALUES LESS THAN (10),
1140
PARTITION part2 VALUES LESS THAN ' at line 9
1146
f_charbig VARCHAR(1000)
1148
PARTITION BY HASH(f_int1) PARTITIONS 0.2E+1;
1149
ERROR 42000: Only integers allowed as number here near '0.2E+1' at line 8
1155
f_charbig VARCHAR(1000)
1157
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1158
SUBPARTITIONS 0.2E+1
1159
(PARTITION part1 VALUES LESS THAN (10),
1160
PARTITION part2 VALUES LESS THAN (2147483646));
1161
ERROR 42000: Only integers allowed as number here near '0.2E+1
1162
(PARTITION part1 VALUES LESS THAN (10),
1163
PARTITION part2 VALUES LESS THAN ' at line 9
1169
f_charbig VARCHAR(1000)
1171
PARTITION BY HASH(f_int1) PARTITIONS -2.0E+0;
1172
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.0E+0' at line 8
1178
f_charbig VARCHAR(1000)
1180
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1181
SUBPARTITIONS -2.0E+0
1182
(PARTITION part1 VALUES LESS THAN (10),
1183
PARTITION part2 VALUES LESS THAN (2147483646));
1184
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.0E+0
1185
(PARTITION part1 VALUES LESS THAN (10),
1186
PARTITION part2 VALUES LESS THAN' at line 9
1192
f_charbig VARCHAR(1000)
1194
PARTITION BY HASH(f_int1) PARTITIONS 0.16E+1;
1195
ERROR 42000: Only integers allowed as number here near '0.16E+1' at line 8
1201
f_charbig VARCHAR(1000)
1203
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1204
SUBPARTITIONS 0.16E+1
1205
(PARTITION part1 VALUES LESS THAN (10),
1206
PARTITION part2 VALUES LESS THAN (2147483646));
1207
ERROR 42000: Only integers allowed as number here near '0.16E+1
1208
(PARTITION part1 VALUES LESS THAN (10),
1209
PARTITION part2 VALUES LESS THAN' at line 9
1215
f_charbig VARCHAR(1000)
1217
PARTITION BY HASH(f_int1) PARTITIONS 0.0E+300;
1218
ERROR 42000: Only integers allowed as number here near '0.0E+300' at line 8
1224
f_charbig VARCHAR(1000)
1226
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1227
SUBPARTITIONS 0.0E+300
1228
(PARTITION part1 VALUES LESS THAN (10),
1229
PARTITION part2 VALUES LESS THAN (2147483646));
1230
ERROR 42000: Only integers allowed as number here near '0.0E+300
1231
(PARTITION part1 VALUES LESS THAN (10),
1232
PARTITION part2 VALUES LESS THA' at line 9
1238
f_charbig VARCHAR(1000)
1240
PARTITION BY HASH(f_int1) PARTITIONS 1E+300;
1241
ERROR 42000: Only integers allowed as number here near '1E+300' at line 8
1247
f_charbig VARCHAR(1000)
1249
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1250
SUBPARTITIONS 1E+300
1251
(PARTITION part1 VALUES LESS THAN (10),
1252
PARTITION part2 VALUES LESS THAN (2147483646));
1253
ERROR 42000: Only integers allowed as number here near '1E+300
1254
(PARTITION part1 VALUES LESS THAN (10),
1255
PARTITION part2 VALUES LESS THAN ' at line 9
1261
f_charbig VARCHAR(1000)
1263
PARTITION BY HASH(f_int1) PARTITIONS 1E-300;
1264
ERROR 42000: Only integers allowed as number here near '1E-300' at line 8
1270
f_charbig VARCHAR(1000)
1272
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1273
SUBPARTITIONS 1E-300
1274
(PARTITION part1 VALUES LESS THAN (10),
1275
PARTITION part2 VALUES LESS THAN (2147483646));
1276
ERROR 42000: Only integers allowed as number here near '1E-300
1277
(PARTITION part1 VALUES LESS THAN (10),
1278
PARTITION part2 VALUES LESS THAN ' at line 9
1279
# 4.2.4 partition/subpartition numbers STRING notation
1285
f_charbig VARCHAR(1000)
1287
PARTITION BY HASH(f_int1) PARTITIONS '2';
1288
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'' at line 8
1294
f_charbig VARCHAR(1000)
1296
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1298
(PARTITION part1 VALUES LESS THAN (10),
1299
PARTITION part2 VALUES LESS THAN (2147483646));
1300
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'
1301
(PARTITION part1 VALUES LESS THAN (10),
1302
PARTITION part2 VALUES LESS THAN (21' at line 9
1308
f_charbig VARCHAR(1000)
1310
PARTITION BY HASH(f_int1) PARTITIONS '2.0';
1311
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.0'' at line 8
1317
f_charbig VARCHAR(1000)
1319
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1321
(PARTITION part1 VALUES LESS THAN (10),
1322
PARTITION part2 VALUES LESS THAN (2147483646));
1323
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.0'
1324
(PARTITION part1 VALUES LESS THAN (10),
1325
PARTITION part2 VALUES LESS THAN (' at line 9
1331
f_charbig VARCHAR(1000)
1333
PARTITION BY HASH(f_int1) PARTITIONS '0.2E+1';
1334
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 ''0.2E+1'' at line 8
1340
f_charbig VARCHAR(1000)
1342
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1343
SUBPARTITIONS '0.2E+1'
1344
(PARTITION part1 VALUES LESS THAN (10),
1345
PARTITION part2 VALUES LESS THAN (2147483646));
1346
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 ''0.2E+1'
1347
(PARTITION part1 VALUES LESS THAN (10),
1348
PARTITION part2 VALUES LESS THA' at line 9
1354
f_charbig VARCHAR(1000)
1356
PARTITION BY HASH(f_int1) PARTITIONS '2A';
1357
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 ''2A'' at line 8
1363
f_charbig VARCHAR(1000)
1365
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1367
(PARTITION part1 VALUES LESS THAN (10),
1368
PARTITION part2 VALUES LESS THAN (2147483646));
1369
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 ''2A'
1370
(PARTITION part1 VALUES LESS THAN (10),
1371
PARTITION part2 VALUES LESS THAN (2' at line 9
1377
f_charbig VARCHAR(1000)
1379
PARTITION BY HASH(f_int1) PARTITIONS 'A2';
1380
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 ''A2'' at line 8
1386
f_charbig VARCHAR(1000)
1388
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1390
(PARTITION part1 VALUES LESS THAN (10),
1391
PARTITION part2 VALUES LESS THAN (2147483646));
1392
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 ''A2'
1393
(PARTITION part1 VALUES LESS THAN (10),
1394
PARTITION part2 VALUES LESS THAN (2' at line 9
1400
f_charbig VARCHAR(1000)
1402
PARTITION BY HASH(f_int1) PARTITIONS '';
1403
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 '''' at line 8
1409
f_charbig VARCHAR(1000)
1411
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1413
(PARTITION part1 VALUES LESS THAN (10),
1414
PARTITION part2 VALUES LESS THAN (2147483646));
1415
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 '''
1416
(PARTITION part1 VALUES LESS THAN (10),
1417
PARTITION part2 VALUES LESS THAN (214' at line 9
1423
f_charbig VARCHAR(1000)
1425
PARTITION BY HASH(f_int1) PARTITIONS 'GARBAGE';
1426
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 ''GARBAGE'' at line 8
1432
f_charbig VARCHAR(1000)
1434
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1435
SUBPARTITIONS 'GARBAGE'
1436
(PARTITION part1 VALUES LESS THAN (10),
1437
PARTITION part2 VALUES LESS THAN (2147483646));
1438
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 ''GARBAGE'
1439
(PARTITION part1 VALUES LESS THAN (10),
1440
PARTITION part2 VALUES LESS TH' at line 9
1441
# 4.2.5 partition/subpartition numbers other notations
1447
f_charbig VARCHAR(1000)
1449
PARTITION BY HASH(f_int1) PARTITIONS 2A;
1450
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 '2A' at line 8
1456
f_charbig VARCHAR(1000)
1458
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1460
(PARTITION part1 VALUES LESS THAN (10),
1461
PARTITION part2 VALUES LESS THAN (2147483646));
1462
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 '2A
1463
(PARTITION part1 VALUES LESS THAN (10),
1464
PARTITION part2 VALUES LESS THAN (214' at line 9
1470
f_charbig VARCHAR(1000)
1472
PARTITION BY HASH(f_int1) PARTITIONS A2;
1473
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 'A2' at line 8
1479
f_charbig VARCHAR(1000)
1481
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1483
(PARTITION part1 VALUES LESS THAN (10),
1484
PARTITION part2 VALUES LESS THAN (2147483646));
1485
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 'A2
1486
(PARTITION part1 VALUES LESS THAN (10),
1487
PARTITION part2 VALUES LESS THAN (214' at line 9
1493
f_charbig VARCHAR(1000)
1495
PARTITION BY HASH(f_int1) PARTITIONS GARBAGE;
1496
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 'GARBAGE' at line 8
1502
f_charbig VARCHAR(1000)
1504
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1505
SUBPARTITIONS GARBAGE
1506
(PARTITION part1 VALUES LESS THAN (10),
1507
PARTITION part2 VALUES LESS THAN (2147483646));
1508
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 'GARBAGE
1509
(PARTITION part1 VALUES LESS THAN (10),
1510
PARTITION part2 VALUES LESS THAN' at line 9
1516
f_charbig VARCHAR(1000)
1518
PARTITION BY HASH(f_int1) PARTITIONS "2";
1519
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"' at line 8
1525
f_charbig VARCHAR(1000)
1527
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1529
(PARTITION part1 VALUES LESS THAN (10),
1530
PARTITION part2 VALUES LESS THAN (2147483646));
1531
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"
1532
(PARTITION part1 VALUES LESS THAN (10),
1533
PARTITION part2 VALUES LESS THAN (21' at line 9
1539
f_charbig VARCHAR(1000)
1541
PARTITION BY HASH(f_int1) PARTITIONS "2A";
1542
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 '"2A"' at line 8
1548
f_charbig VARCHAR(1000)
1550
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1552
(PARTITION part1 VALUES LESS THAN (10),
1553
PARTITION part2 VALUES LESS THAN (2147483646));
1554
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 '"2A"
1555
(PARTITION part1 VALUES LESS THAN (10),
1556
PARTITION part2 VALUES LESS THAN (2' at line 9
1562
f_charbig VARCHAR(1000)
1564
PARTITION BY HASH(f_int1) PARTITIONS "A2";
1565
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 '"A2"' at line 8
1571
f_charbig VARCHAR(1000)
1573
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1575
(PARTITION part1 VALUES LESS THAN (10),
1576
PARTITION part2 VALUES LESS THAN (2147483646));
1577
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 '"A2"
1578
(PARTITION part1 VALUES LESS THAN (10),
1579
PARTITION part2 VALUES LESS THAN (2' at line 9
1585
f_charbig VARCHAR(1000)
1587
PARTITION BY HASH(f_int1) PARTITIONS "GARBAGE";
1588
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 '"GARBAGE"' at line 8
1594
f_charbig VARCHAR(1000)
1596
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1597
SUBPARTITIONS "GARBAGE"
1598
(PARTITION part1 VALUES LESS THAN (10),
1599
PARTITION part2 VALUES LESS THAN (2147483646));
1600
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 '"GARBAGE"
1601
(PARTITION part1 VALUES LESS THAN (10),
1602
PARTITION part2 VALUES LESS TH' at line 9
1603
# 4.2.6 (negative) partition/subpartition numbers per @variables
1610
f_charbig VARCHAR(1000)
1612
PARTITION BY HASH(f_int1) PARTITIONS @aux;
1613
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 '@aux' at line 8
1619
f_charbig VARCHAR(1000)
1621
PARTITION BY RANGE(f_int1) SUBPARTITION BY HASH(f_int1)
1622
SUBPARTITIONS @aux = 5
1623
(PARTITION part1 VALUES LESS THAN (10),
1624
PARTITION part2 VALUES LESS THAN (2147483646));
1625
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 '@aux = 5
1626
(PARTITION part1 VALUES LESS THAN (10),
1627
PARTITION part2 VALUES LESS THA' at line 9
1628
#------------------------------------------------------------------------
1629
# 4.3 Mixups of assigned partition/subpartition numbers and names
1630
#------------------------------------------------------------------------
1631
# 4.3.1 (positive) number of partition/subpartition
1632
# = number of named partition/subpartition
1638
f_charbig VARCHAR(1000)
1640
PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1, PARTITION part2 ) ;
1642
SHOW CREATE TABLE t1;
1644
t1 CREATE TABLE `t1` (
1645
`f_int1` int(11) DEFAULT NULL,
1646
`f_int2` int(11) DEFAULT NULL,
1647
`f_char1` char(20) DEFAULT NULL,
1648
`f_char2` char(20) DEFAULT NULL,
1649
`f_charbig` varchar(1000) DEFAULT NULL
1650
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH (f_int1) (PARTITION part1 ENGINE = InnoDB, PARTITION part2 ENGINE = InnoDB) */
1658
f_charbig VARCHAR(1000)
1660
PARTITION BY RANGE(f_int1) PARTITIONS 2
1661
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
1662
( PARTITION part1 VALUES LESS THAN (1000)
1663
(SUBPARTITION subpart11, SUBPARTITION subpart12),
1664
PARTITION part2 VALUES LESS THAN (2147483646)
1665
(SUBPARTITION subpart21, SUBPARTITION subpart22)
1668
SHOW CREATE TABLE t1;
1670
t1 CREATE TABLE `t1` (
1671
`f_int1` int(11) DEFAULT NULL,
1672
`f_int2` int(11) DEFAULT NULL,
1673
`f_char1` char(20) DEFAULT NULL,
1674
`f_char2` char(20) DEFAULT NULL,
1675
`f_charbig` varchar(1000) DEFAULT NULL
1676
) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (f_int1) SUBPARTITION BY HASH (f_int1) (PARTITION part1 VALUES LESS THAN (1000) (SUBPARTITION subpart11 ENGINE = InnoDB, SUBPARTITION subpart12 ENGINE = InnoDB), PARTITION part2 VALUES LESS THAN (2147483646) (SUBPARTITION subpart21 ENGINE = InnoDB, SUBPARTITION subpart22 ENGINE = InnoDB)) */
1679
# 4.3.2 (positive) number of partition/subpartition ,
1680
# 0 (= no) named partition/subpartition
1681
# already checked above
1682
# 4.3.3 (negative) number of partitions/subpartitions
1683
# > number of named partitions/subpartitions
1689
f_charbig VARCHAR(1000)
1691
PARTITION BY HASH(f_int1) PARTITIONS 2 ( PARTITION part1 ) ;
1692
ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
1698
f_charbig VARCHAR(1000)
1700
PARTITION BY RANGE(f_int1)
1701
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
1702
( PARTITION part1 VALUES LESS THAN (1000)
1703
(SUBPARTITION subpart11 ),
1704
PARTITION part2 VALUES LESS THAN (2147483646)
1705
(SUBPARTITION subpart21, SUBPARTITION subpart22)
1707
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
1708
PARTITION part2 VALUES LESS THAN (2147483646)
1709
(SUBPARTITION subpart21, SUBPAR' at line 11
1715
f_charbig VARCHAR(1000)
1717
PARTITION BY RANGE(f_int1)
1718
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
1719
( PARTITION part1 VALUES LESS THAN (1000)
1720
(SUBPARTITION subpart11, SUBPARTITION subpart12),
1721
PARTITION part2 VALUES LESS THAN (2000)
1722
(SUBPARTITION subpart21 ),
1723
PARTITION part3 VALUES LESS THAN (2147483646)
1724
(SUBPARTITION subpart31, SUBPARTITION subpart32)
1726
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
1727
PARTITION part3 VALUES LESS THAN (2147483646)
1728
(SUBPARTITION subpart31, SUBPAR' at line 13
1734
f_charbig VARCHAR(1000)
1736
PARTITION BY RANGE(f_int1) PARTITIONS 2
1737
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 2
1738
( PARTITION part1 VALUES LESS THAN (1000)
1739
(SUBPARTITION subpart11, SUBPARTITION subpart12),
1740
PARTITION part2 VALUES LESS THAN (2147483646)
1741
(SUBPARTITION subpart21 )
1743
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near ')
1745
# 4.3.4 (negative) number of partitions < number of named partitions
1751
f_charbig VARCHAR(1000)
1753
PARTITION BY HASH(f_int1) PARTITIONS 1 ( PARTITION part1, PARTITION part2 ) ;
1754
ERROR 42000: Wrong number of partitions defined, mismatch with previous setting near ')' at line 8
1760
f_charbig VARCHAR(1000)
1762
PARTITION BY RANGE(f_int1)
1763
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 1
1764
( PARTITION part1 VALUES LESS THAN (1000)
1765
(SUBPARTITION subpart11, SUBPARTITION subpart12),
1766
PARTITION part2 VALUES LESS THAN (2147483646)
1767
(SUBPARTITION subpart21, SUBPARTITION subpart22)
1769
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
1770
PARTITION part2 VALUES LESS THAN (2147483646)
1771
(SUBPARTITION subpart21, SUBPAR' at line 11
1777
f_charbig VARCHAR(1000)
1779
PARTITION BY RANGE(f_int1)
1780
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 1
1781
( PARTITION part1 VALUES LESS THAN (1000)
1782
(SUBPARTITION subpart11, SUBPARTITION subpart12),
1783
PARTITION part2 VALUES LESS THAN (2000)
1784
(SUBPARTITION subpart21 ),
1785
PARTITION part3 VALUES LESS THAN (2147483646)
1786
(SUBPARTITION subpart31, SUBPARTITION subpart32)
1788
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
1789
PARTITION part2 VALUES LESS THAN (2000)
1790
(SUBPARTITION subpart21 ' at line 11
1796
f_charbig VARCHAR(1000)
1798
PARTITION BY RANGE(f_int1)
1799
SUBPARTITION BY HASH(f_int1) SUBPARTITIONS 1
1800
( PARTITION part1 VALUES LESS THAN (1000)
1801
(SUBPARTITION subpart11, SUBPARTITION subpart12),
1802
PARTITION part2 VALUES LESS THAN (2147483646)
1803
(SUBPARTITION subpart21, SUBPARTITION subpart22)
1805
ERROR 42000: Wrong number of subpartitions defined, mismatch with previous setting near '),
1806
PARTITION part2 VALUES LESS THAN (2147483646)
1807
(SUBPARTITION subpart21, SUBPAR' at line 11
1809
#========================================================================
1810
# 5. Checks of logical partition/subpartition name
1811
# file name clashes during CREATE TABLE
1812
#========================================================================
1813
DROP TABLE IF EXISTS t1;
1814
#------------------------------------------------------------------------
1815
# 5.1 (negative) A partition/subpartition name used more than once
1816
#------------------------------------------------------------------------
1817
# 5.1.1 duplicate partition name
1823
f_charbig VARCHAR(1000)
1825
PARTITION BY HASH(f_int1) (PARTITION part1, PARTITION part1);
1826
ERROR HY000: Duplicate partition name part1
1827
# 5.1.2 duplicate subpartition name
1833
f_charbig VARCHAR(1000)
1835
PARTITION BY RANGE(f_int1)
1836
SUBPARTITION BY HASH(f_int1)
1837
( PARTITION part1 VALUES LESS THAN (1000)
1838
(SUBPARTITION subpart11, SUBPARTITION subpart11)
1840
ERROR HY000: Duplicate partition name subpart11
1841
DROP VIEW IF EXISTS v1;
1842
DROP TABLE IF EXISTS t1;
1843
DROP TABLE IF EXISTS t0_aux;
1844
DROP TABLE IF EXISTS t0_definition;
1845
DROP TABLE IF EXISTS t0_template;