~jlukas79/+junk/mysql-server

« back to all changes in this revision

Viewing changes to mysql-test/suite/parts/r/part_supported_sql_func_ndb.result

manual merge 6.0-main --> 6.0-bka-review

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
(partition p0 values less than (15),
32
32
partition p1 values less than maxvalue);
33
33
create table t5 (colint int, col1 int) engine='NDB' 
34
 
partition by list(colint)
 
34
partition by list(colint) 
35
35
subpartition by hash(abs(col1)) subpartitions 2 
36
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
37
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
38
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
39
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
40
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
41
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
36
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
37
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
38
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
39
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
42
40
);
43
41
create table t6 (colint int, col1 int) engine='NDB' 
44
42
partition by range(colint) 
55
53
insert into t3 values (5 );
56
54
insert into t3 values (13 );
57
55
insert into t3 values (17 );
58
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t4;
59
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t5;
60
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_int.in' into table t6;
 
56
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
 
57
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
 
58
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
61
59
select abs(col1) from t1 order by col1;
62
60
abs(col1)
63
61
5
414
412
(partition p0 values less than (15),
415
413
partition p1 values less than maxvalue);
416
414
alter table t55
417
 
partition by list(colint)
 
415
partition by list(colint) 
418
416
subpartition by hash(abs(col1)) subpartitions 2 
419
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
420
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
421
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
422
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
423
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
424
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
417
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
418
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
419
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
420
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
425
421
);
426
422
alter table t66
427
423
partition by range(colint) 
585
581
---------------------------
586
582
---- some alter table begin
587
583
---------------------------
588
 
alter table t11
589
 
reorganize partition p0,p1 into
590
 
(partition s1 values less than maxvalue);
591
 
select * from t11 order by col1;
592
 
col1
593
 
13
594
 
15
595
 
alter table t11
596
 
reorganize partition s1 into
597
 
(partition p0 values less than (15),
598
 
partition p1 values less than maxvalue);
599
 
select * from t11 order by col1;
600
 
col1
601
 
13
602
 
15
603
584
alter table t55
604
 
partition by list(colint)
605
 
subpartition by hash(abs(col1)) subpartitions 5 
606
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
607
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
608
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
609
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
610
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
611
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
585
partition by list(colint) 
 
586
subpartition by hash(abs(col1)) subpartitions 4 
 
587
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
588
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
612
589
);
613
590
show create table t55;
614
591
Table   Create Table
615
592
t55     CREATE TABLE `t55` (
616
593
  `colint` int(11) DEFAULT NULL,
617
594
  `col1` int(11) DEFAULT NULL
618
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
595
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (abs(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
619
596
select * from t55 order by colint;
620
597
colint  col1
621
598
1       15
663
640
50      56
664
641
51      34
665
642
55      123
666
 
alter table t66
667
 
reorganize partition p0,p1 into
668
 
(partition s1 values less than maxvalue);
669
 
select * from t66 order by colint;
670
 
colint  col1
671
 
1       15
672
 
2       13
673
 
3       15
674
 
4       17
675
 
5       23
676
 
6       34
677
 
7       56
678
 
8       56
679
 
9       45
680
 
10      34
681
 
11      78
682
 
12      89
683
 
13      67
684
 
14      46
685
 
15      34
686
 
16      324
687
 
17      345
688
 
18      34
689
 
19      78
690
 
20      567
691
 
21      4
692
 
22      435
693
 
23      34
694
 
24      45
695
 
25      4565
696
 
26      4
697
 
27      3
698
 
28      2
699
 
29      3
700
 
30      15
701
 
31      6
702
 
32      8
703
 
33      9
704
 
34      745
705
 
35      34
706
 
36      34
707
 
37      324
708
 
38      67
709
 
39      78
710
 
40      89
711
 
41      90
712
 
42      78967
713
 
50      56
714
 
51      34
715
 
55      123
716
 
alter table t66
717
 
reorganize partition s1 into
718
 
(partition p0 values less than (abs(15)),
719
 
partition p1 values less than maxvalue);
720
 
select * from t66 order by colint;
721
 
colint  col1
722
 
1       15
723
 
2       13
724
 
3       15
725
 
4       17
726
 
5       23
727
 
6       34
728
 
7       56
729
 
8       56
730
 
9       45
731
 
10      34
732
 
11      78
733
 
12      89
734
 
13      67
735
 
14      46
736
 
15      34
737
 
16      324
738
 
17      345
739
 
18      34
740
 
19      78
741
 
20      567
742
 
21      4
743
 
22      435
744
 
23      34
745
 
24      45
746
 
25      4565
747
 
26      4
748
 
27      3
749
 
28      2
750
 
29      3
751
 
30      15
752
 
31      6
753
 
32      8
754
 
33      9
755
 
34      745
756
 
35      34
757
 
36      34
758
 
37      324
759
 
38      67
760
 
39      78
761
 
40      89
762
 
41      90
763
 
42      78967
764
 
50      56
765
 
51      34
766
 
55      123
767
 
alter table t66
768
 
reorganize partition p0,p1 into
769
 
(partition s1 values less than maxvalue);
770
 
select * from t66 order by colint;
771
 
colint  col1
772
 
1       15
773
 
2       13
774
 
3       15
775
 
4       17
776
 
5       23
777
 
6       34
778
 
7       56
779
 
8       56
780
 
9       45
781
 
10      34
782
 
11      78
783
 
12      89
784
 
13      67
785
 
14      46
786
 
15      34
787
 
16      324
788
 
17      345
789
 
18      34
790
 
19      78
791
 
20      567
792
 
21      4
793
 
22      435
794
 
23      34
795
 
24      45
796
 
25      4565
797
 
26      4
798
 
27      3
799
 
28      2
800
 
29      3
801
 
30      15
802
 
31      6
803
 
32      8
804
 
33      9
805
 
34      745
806
 
35      34
807
 
36      34
808
 
37      324
809
 
38      67
810
 
39      78
811
 
40      89
812
 
41      90
813
 
42      78967
814
 
50      56
815
 
51      34
816
 
55      123
817
 
alter table t66
818
 
reorganize partition s1 into
819
 
(partition p0 values less than (abs(15)),
820
 
partition p1 values less than maxvalue);
821
 
select * from t66 order by colint;
822
 
colint  col1
823
 
1       15
824
 
2       13
825
 
3       15
826
 
4       17
827
 
5       23
828
 
6       34
829
 
7       56
830
 
8       56
831
 
9       45
832
 
10      34
833
 
11      78
834
 
12      89
835
 
13      67
836
 
14      46
837
 
15      34
838
 
16      324
839
 
17      345
840
 
18      34
841
 
19      78
842
 
20      567
843
 
21      4
844
 
22      435
845
 
23      34
846
 
24      45
847
 
25      4565
848
 
26      4
849
 
27      3
850
 
28      2
851
 
29      3
852
 
30      15
853
 
31      6
854
 
32      8
855
 
33      9
856
 
34      745
857
 
35      34
858
 
36      34
859
 
37      324
860
 
38      67
861
 
39      78
862
 
40      89
863
 
41      90
864
 
42      78967
865
 
50      56
866
 
51      34
867
 
55      123
868
643
-------------------------------------------------------------------------
869
644
---  Delete rows and partitions of tables with abs(col1)
870
645
-------------------------------------------------------------------------
1138
913
51      34
1139
914
55      123
1140
915
60      13
1141
 
alter table t1 drop partition p0;
1142
 
alter table t2 drop partition p0;
1143
 
alter table t4 drop partition p0;
1144
 
alter table t5 drop partition p0;
1145
 
alter table t6 drop partition p0;
1146
 
select * from t1 order by col1;
1147
 
col1
1148
 
15
1149
 
select * from t2 order by col1;
1150
 
col1
1151
 
13
1152
 
15
1153
 
17
1154
 
select * from t3 order by col1;
1155
 
col1
1156
 
13
1157
 
15
1158
 
17
1159
 
select * from t4 order by colint;
1160
 
colint  col1
1161
 
15      34
1162
 
16      324
1163
 
17      345
1164
 
18      34
1165
 
19      78
1166
 
20      567
1167
 
21      4
1168
 
22      435
1169
 
23      34
1170
 
24      45
1171
 
25      4565
1172
 
26      4
1173
 
27      3
1174
 
28      2
1175
 
29      3
1176
 
30      15
1177
 
31      6
1178
 
32      8
1179
 
33      9
1180
 
34      745
1181
 
35      34
1182
 
36      34
1183
 
37      324
1184
 
38      67
1185
 
39      78
1186
 
40      89
1187
 
41      90
1188
 
42      78967
1189
 
50      56
1190
 
51      34
1191
 
55      123
1192
 
60      13
1193
 
select * from t5 order by colint;
1194
 
colint  col1
1195
 
11      78
1196
 
12      89
1197
 
13      67
1198
 
14      46
1199
 
15      34
1200
 
16      324
1201
 
17      345
1202
 
18      34
1203
 
19      78
1204
 
20      567
1205
 
21      4
1206
 
22      435
1207
 
23      34
1208
 
24      45
1209
 
25      4565
1210
 
26      4
1211
 
27      3
1212
 
28      2
1213
 
29      3
1214
 
30      15
1215
 
31      6
1216
 
32      8
1217
 
33      9
1218
 
34      745
1219
 
35      34
1220
 
36      34
1221
 
37      324
1222
 
38      67
1223
 
39      78
1224
 
40      89
1225
 
41      90
1226
 
42      78967
1227
 
50      56
1228
 
51      34
1229
 
55      123
1230
 
60      13
1231
 
select * from t6 order by colint;
1232
 
colint  col1
1233
 
15      34
1234
 
16      324
1235
 
17      345
1236
 
18      34
1237
 
19      78
1238
 
20      567
1239
 
21      4
1240
 
22      435
1241
 
23      34
1242
 
24      45
1243
 
25      4565
1244
 
26      4
1245
 
27      3
1246
 
28      2
1247
 
29      3
1248
 
30      15
1249
 
31      6
1250
 
32      8
1251
 
33      9
1252
 
34      745
1253
 
35      34
1254
 
36      34
1255
 
37      324
1256
 
38      67
1257
 
39      78
1258
 
40      89
1259
 
41      90
1260
 
42      78967
1261
 
50      56
1262
 
51      34
1263
 
55      123
1264
 
60      13
1265
916
-------------------------------------------------------------------------
1266
917
---  Delete rows and partitions of tables with abs(col1)
1267
918
-------------------------------------------------------------------------
1535
1186
51      34
1536
1187
55      123
1537
1188
60      13
1538
 
alter table t11 drop partition p0;
1539
 
alter table t22 drop partition p0;
1540
 
alter table t44 drop partition p0;
1541
 
alter table t55 drop partition p0;
1542
 
alter table t66 drop partition p0;
1543
 
select * from t11 order by col1;
1544
 
col1
1545
 
15
1546
 
select * from t22 order by col1;
1547
 
col1
1548
 
13
1549
 
15
1550
 
17
1551
 
select * from t33 order by col1;
1552
 
col1
1553
 
13
1554
 
15
1555
 
17
1556
 
select * from t44 order by colint;
1557
 
colint  col1
1558
 
15      34
1559
 
16      324
1560
 
17      345
1561
 
18      34
1562
 
19      78
1563
 
20      567
1564
 
21      4
1565
 
22      435
1566
 
23      34
1567
 
24      45
1568
 
25      4565
1569
 
26      4
1570
 
27      3
1571
 
28      2
1572
 
29      3
1573
 
30      15
1574
 
31      6
1575
 
32      8
1576
 
33      9
1577
 
34      745
1578
 
35      34
1579
 
36      34
1580
 
37      324
1581
 
38      67
1582
 
39      78
1583
 
40      89
1584
 
41      90
1585
 
42      78967
1586
 
50      56
1587
 
51      34
1588
 
55      123
1589
 
60      13
1590
 
select * from t55 order by colint;
1591
 
colint  col1
1592
 
11      78
1593
 
12      89
1594
 
13      67
1595
 
14      46
1596
 
15      34
1597
 
16      324
1598
 
17      345
1599
 
18      34
1600
 
19      78
1601
 
20      567
1602
 
21      4
1603
 
22      435
1604
 
23      34
1605
 
24      45
1606
 
25      4565
1607
 
26      4
1608
 
27      3
1609
 
28      2
1610
 
29      3
1611
 
30      15
1612
 
31      6
1613
 
32      8
1614
 
33      9
1615
 
34      745
1616
 
35      34
1617
 
36      34
1618
 
37      324
1619
 
38      67
1620
 
39      78
1621
 
40      89
1622
 
41      90
1623
 
42      78967
1624
 
50      56
1625
 
51      34
1626
 
55      123
1627
 
60      13
1628
 
select * from t66 order by colint;
1629
 
colint  col1
1630
 
15      34
1631
 
16      324
1632
 
17      345
1633
 
18      34
1634
 
19      78
1635
 
20      567
1636
 
21      4
1637
 
22      435
1638
 
23      34
1639
 
24      45
1640
 
25      4565
1641
 
26      4
1642
 
27      3
1643
 
28      2
1644
 
29      3
1645
 
30      15
1646
 
31      6
1647
 
32      8
1648
 
33      9
1649
 
34      745
1650
 
35      34
1651
 
36      34
1652
 
37      324
1653
 
38      67
1654
 
39      78
1655
 
40      89
1656
 
41      90
1657
 
42      78967
1658
 
50      56
1659
 
51      34
1660
 
55      123
1661
 
60      13
1662
 
-------------------------
1663
 
---- some alter table end
1664
 
-------------------------
1665
 
drop table if exists t1 ;
1666
 
drop table if exists t2 ;
1667
 
drop table if exists t3 ;
1668
 
drop table if exists t4 ;
1669
 
drop table if exists t5 ;
1670
 
drop table if exists t6 ;
1671
 
drop table if exists t11 ;
1672
 
drop table if exists t22 ;
1673
 
drop table if exists t33 ;
1674
 
drop table if exists t44 ;
1675
 
drop table if exists t55 ;
1676
 
drop table if exists t66 ;
1677
 
-------------------------------------------------------------------------
1678
 
---  ascii(col1)  in partition with coltype  char(1)
1679
 
-------------------------------------------------------------------------
1680
 
drop table if exists t1 ;
1681
 
drop table if exists t2 ;
1682
 
drop table if exists t3 ;
1683
 
drop table if exists t4 ;
1684
 
drop table if exists t5 ;
1685
 
drop table if exists t6 ;
1686
 
-------------------------------------------------------------------------
1687
 
---  Create tables with ascii(col1)
1688
 
-------------------------------------------------------------------------
1689
 
create table t1 (col1 char(1)) engine='NDB' 
1690
 
partition by range(ascii(col1)) 
1691
 
(partition p0 values less than (15),
1692
 
partition p1 values less than maxvalue);
1693
 
create table t2 (col1 char(1)) engine='NDB' 
1694
 
partition by list(ascii(col1)) 
1695
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
1696
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
1697
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
1698
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
1699
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
1700
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
1701
 
);
1702
 
create table t3 (col1 char(1)) engine='NDB' 
1703
 
partition by hash(ascii(col1));
1704
 
create table t4 (colint int, col1 char(1)) engine='NDB' 
1705
 
partition by range(colint) 
1706
 
subpartition by hash(ascii(col1)) subpartitions 2 
1707
 
(partition p0 values less than (15),
1708
 
partition p1 values less than maxvalue);
1709
 
create table t5 (colint int, col1 char(1)) engine='NDB' 
1710
 
partition by list(colint)
1711
 
subpartition by hash(ascii(col1)) subpartitions 2 
1712
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
1713
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
1714
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
1715
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
1716
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
1717
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
1718
 
);
1719
 
create table t6 (colint int, col1 char(1)) engine='NDB' 
1720
 
partition by range(colint) 
1721
 
(partition p0 values less than (ascii('5')),
1722
 
partition p1 values less than maxvalue);
1723
 
-------------------------------------------------------------------------
1724
 
---  Access tables with ascii(col1) 
1725
 
-------------------------------------------------------------------------
1726
 
insert into t1 values ('1');
1727
 
insert into t1 values ('9');
1728
 
insert into t2 values ('1');
1729
 
insert into t2 values ('9');
1730
 
insert into t2 values ('3');
1731
 
insert into t3 values ('1');
1732
 
insert into t3 values ('9');
1733
 
insert into t3 values ('3');
1734
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4;
1735
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5;
1736
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6;
1737
 
select ascii(col1) from t1 order by col1;
1738
 
ascii(col1)
1739
 
49
1740
 
57
1741
 
select * from t1 order by col1;
1742
 
col1
1743
 
1
1744
 
9
1745
 
select * from t2 order by col1;
1746
 
col1
1747
 
1
1748
 
3
1749
 
9
1750
 
select * from t3 order by col1;
1751
 
col1
1752
 
1
1753
 
3
1754
 
9
1755
 
select * from t4 order by colint;
1756
 
colint  col1
1757
 
1       1
1758
 
2       9
1759
 
3       3
1760
 
4       8
1761
 
select * from t5 order by colint;
1762
 
colint  col1
1763
 
1       1
1764
 
2       9
1765
 
3       3
1766
 
4       8
1767
 
select * from t6 order by colint;
1768
 
colint  col1
1769
 
1       1
1770
 
2       9
1771
 
3       3
1772
 
4       8
1773
 
update t1 set col1='8' where col1='1';
1774
 
update t2 set col1='8' where col1='1';
1775
 
update t3 set col1='8' where col1='1';
1776
 
update t4 set col1='8' where col1='1';
1777
 
update t5 set col1='8' where col1='1';
1778
 
update t6 set col1='8' where col1='1';
1779
 
select * from t1 order by col1;
1780
 
col1
1781
 
8
1782
 
9
1783
 
select * from t2 order by col1;
1784
 
col1
1785
 
3
1786
 
8
1787
 
9
1788
 
select * from t3 order by col1;
1789
 
col1
1790
 
3
1791
 
8
1792
 
9
1793
 
select * from t4 order by colint;
1794
 
colint  col1
1795
 
1       8
1796
 
2       9
1797
 
3       3
1798
 
4       8
1799
 
select * from t5 order by colint;
1800
 
colint  col1
1801
 
1       8
1802
 
2       9
1803
 
3       3
1804
 
4       8
1805
 
select * from t6 order by colint;
1806
 
colint  col1
1807
 
1       8
1808
 
2       9
1809
 
3       3
1810
 
4       8
1811
 
-------------------------------------------------------------------------
1812
 
---  Alter tables with ascii(col1)
1813
 
-------------------------------------------------------------------------
1814
 
drop table if exists t11 ;
1815
 
drop table if exists t22 ;
1816
 
drop table if exists t33 ;
1817
 
drop table if exists t44 ;
1818
 
drop table if exists t55 ;
1819
 
drop table if exists t66 ;
1820
 
create table t11 engine='NDB' as select * from t1;
1821
 
create table t22 engine='NDB' as select * from t2;
1822
 
create table t33 engine='NDB' as select * from t3;
1823
 
create table t44 engine='NDB' as select * from t4;
1824
 
create table t55 engine='NDB' as select * from t5;
1825
 
create table t66 engine='NDB' as select * from t6;
1826
 
alter table t11
1827
 
partition by range(ascii(col1)) 
1828
 
(partition p0 values less than (15),
1829
 
partition p1 values less than maxvalue);
1830
 
alter table t22
1831
 
partition by list(ascii(col1)) 
1832
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
1833
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
1834
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
1835
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
1836
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
1837
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
1838
 
);
1839
 
alter table t33
1840
 
partition by hash(ascii(col1));
1841
 
alter table t44
1842
 
partition by range(colint) 
1843
 
subpartition by hash(ascii(col1)) subpartitions 2 
1844
 
(partition p0 values less than (15),
1845
 
partition p1 values less than maxvalue);
1846
 
alter table t55
1847
 
partition by list(colint)
1848
 
subpartition by hash(ascii(col1)) subpartitions 2 
1849
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
1850
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
1851
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
1852
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
1853
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
1854
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
1855
 
);
1856
 
alter table t66
1857
 
partition by range(colint) 
1858
 
(partition p0 values less than (ascii('5')),
1859
 
partition p1 values less than maxvalue);
1860
 
select * from t11 order by col1;
1861
 
col1
1862
 
8
1863
 
9
1864
 
select * from t22 order by col1;
1865
 
col1
1866
 
3
1867
 
8
1868
 
9
1869
 
select * from t33 order by col1;
1870
 
col1
1871
 
3
1872
 
8
1873
 
9
1874
 
select * from t44 order by colint;
1875
 
colint  col1
1876
 
1       8
1877
 
2       9
1878
 
3       3
1879
 
4       8
1880
 
select * from t55 order by colint;
1881
 
colint  col1
1882
 
1       8
1883
 
2       9
1884
 
3       3
1885
 
4       8
1886
 
select * from t66 order by colint;
1887
 
colint  col1
1888
 
1       8
1889
 
2       9
1890
 
3       3
1891
 
4       8
1892
 
---------------------------
1893
 
---- some alter table begin
1894
 
---------------------------
1895
 
alter table t11
1896
 
reorganize partition p0,p1 into
1897
 
(partition s1 values less than maxvalue);
1898
 
select * from t11 order by col1;
1899
 
col1
1900
 
8
1901
 
9
1902
 
alter table t11
1903
 
reorganize partition s1 into
1904
 
(partition p0 values less than (15),
1905
 
partition p1 values less than maxvalue);
1906
 
select * from t11 order by col1;
1907
 
col1
1908
 
8
1909
 
9
1910
 
alter table t55
1911
 
partition by list(colint)
1912
 
subpartition by hash(ascii(col1)) subpartitions 5 
1913
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
1914
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
1915
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
1916
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
1917
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
1918
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
1919
 
);
1920
 
show create table t55;
1921
 
Table   Create Table
1922
 
t55     CREATE TABLE `t55` (
1923
 
  `colint` int(11) DEFAULT NULL,
1924
 
  `col1` char(1) DEFAULT NULL
1925
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ascii(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
1926
 
select * from t55 order by colint;
1927
 
colint  col1
1928
 
1       8
1929
 
2       9
1930
 
3       3
1931
 
4       8
1932
 
alter table t66
1933
 
reorganize partition p0,p1 into
1934
 
(partition s1 values less than maxvalue);
1935
 
select * from t66 order by colint;
1936
 
colint  col1
1937
 
1       8
1938
 
2       9
1939
 
3       3
1940
 
4       8
1941
 
alter table t66
1942
 
reorganize partition s1 into
1943
 
(partition p0 values less than (ascii('5')),
1944
 
partition p1 values less than maxvalue);
1945
 
select * from t66 order by colint;
1946
 
colint  col1
1947
 
1       8
1948
 
2       9
1949
 
3       3
1950
 
4       8
1951
 
alter table t66
1952
 
reorganize partition p0,p1 into
1953
 
(partition s1 values less than maxvalue);
1954
 
select * from t66 order by colint;
1955
 
colint  col1
1956
 
1       8
1957
 
2       9
1958
 
3       3
1959
 
4       8
1960
 
alter table t66
1961
 
reorganize partition s1 into
1962
 
(partition p0 values less than (ascii('5')),
1963
 
partition p1 values less than maxvalue);
1964
 
select * from t66 order by colint;
1965
 
colint  col1
1966
 
1       8
1967
 
2       9
1968
 
3       3
1969
 
4       8
1970
 
-------------------------------------------------------------------------
1971
 
---  Delete rows and partitions of tables with ascii(col1)
1972
 
-------------------------------------------------------------------------
1973
 
delete from t1 where col1='9';
1974
 
delete from t2 where col1='9';
1975
 
delete from t3 where col1='9';
1976
 
delete from t4 where col1='9';
1977
 
delete from t5 where col1='9';
1978
 
delete from t6 where col1='9';
1979
 
select * from t1 order by col1;
1980
 
col1
1981
 
8
1982
 
select * from t2 order by col1;
1983
 
col1
1984
 
3
1985
 
8
1986
 
select * from t3 order by col1;
1987
 
col1
1988
 
3
1989
 
8
1990
 
select * from t4 order by colint;
1991
 
colint  col1
1992
 
1       8
1993
 
3       3
1994
 
4       8
1995
 
select * from t5 order by colint;
1996
 
colint  col1
1997
 
1       8
1998
 
3       3
1999
 
4       8
2000
 
insert into t1 values ('9');
2001
 
insert into t2 values ('9');
2002
 
insert into t3 values ('9');
2003
 
insert into t4 values (60,'9');
2004
 
insert into t5 values (60,'9');
2005
 
insert into t6 values (60,'9');
2006
 
select * from t1 order by col1;
2007
 
col1
2008
 
8
2009
 
9
2010
 
select * from t2 order by col1;
2011
 
col1
2012
 
3
2013
 
8
2014
 
9
2015
 
select * from t3 order by col1;
2016
 
col1
2017
 
3
2018
 
8
2019
 
9
2020
 
select * from t4 order by colint;
2021
 
colint  col1
2022
 
1       8
2023
 
3       3
2024
 
4       8
2025
 
60      9
2026
 
select * from t5 order by colint;
2027
 
colint  col1
2028
 
1       8
2029
 
3       3
2030
 
4       8
2031
 
60      9
2032
 
select * from t6 order by colint;
2033
 
colint  col1
2034
 
1       8
2035
 
3       3
2036
 
4       8
2037
 
60      9
2038
 
alter table t1 drop partition p0;
2039
 
alter table t2 drop partition p0;
2040
 
alter table t4 drop partition p0;
2041
 
alter table t5 drop partition p0;
2042
 
alter table t6 drop partition p0;
2043
 
select * from t1 order by col1;
2044
 
col1
2045
 
8
2046
 
9
2047
 
select * from t2 order by col1;
2048
 
col1
2049
 
3
2050
 
8
2051
 
9
2052
 
select * from t3 order by col1;
2053
 
col1
2054
 
3
2055
 
8
2056
 
9
2057
 
select * from t4 order by colint;
2058
 
colint  col1
2059
 
60      9
2060
 
select * from t5 order by colint;
2061
 
colint  col1
2062
 
60      9
2063
 
select * from t6 order by colint;
2064
 
colint  col1
2065
 
60      9
2066
 
-------------------------------------------------------------------------
2067
 
---  Delete rows and partitions of tables with ascii(col1)
2068
 
-------------------------------------------------------------------------
2069
 
delete from t11 where col1='9';
2070
 
delete from t22 where col1='9';
2071
 
delete from t33 where col1='9';
2072
 
delete from t44 where col1='9';
2073
 
delete from t55 where col1='9';
2074
 
delete from t66 where col1='9';
2075
 
select * from t11 order by col1;
2076
 
col1
2077
 
8
2078
 
select * from t22 order by col1;
2079
 
col1
2080
 
3
2081
 
8
2082
 
select * from t33 order by col1;
2083
 
col1
2084
 
3
2085
 
8
2086
 
select * from t44 order by colint;
2087
 
colint  col1
2088
 
1       8
2089
 
3       3
2090
 
4       8
2091
 
select * from t55 order by colint;
2092
 
colint  col1
2093
 
1       8
2094
 
3       3
2095
 
4       8
2096
 
insert into t11 values ('9');
2097
 
insert into t22 values ('9');
2098
 
insert into t33 values ('9');
2099
 
insert into t44 values (60,'9');
2100
 
insert into t55 values (60,'9');
2101
 
insert into t66 values (60,'9');
2102
 
select * from t11 order by col1;
2103
 
col1
2104
 
8
2105
 
9
2106
 
select * from t22 order by col1;
2107
 
col1
2108
 
3
2109
 
8
2110
 
9
2111
 
select * from t33 order by col1;
2112
 
col1
2113
 
3
2114
 
8
2115
 
9
2116
 
select * from t44 order by colint;
2117
 
colint  col1
2118
 
1       8
2119
 
3       3
2120
 
4       8
2121
 
60      9
2122
 
select * from t55 order by colint;
2123
 
colint  col1
2124
 
1       8
2125
 
3       3
2126
 
4       8
2127
 
60      9
2128
 
select * from t66 order by colint;
2129
 
colint  col1
2130
 
1       8
2131
 
3       3
2132
 
4       8
2133
 
60      9
2134
 
alter table t11 drop partition p0;
2135
 
alter table t22 drop partition p0;
2136
 
alter table t44 drop partition p0;
2137
 
alter table t55 drop partition p0;
2138
 
alter table t66 drop partition p0;
2139
 
select * from t11 order by col1;
2140
 
col1
2141
 
8
2142
 
9
2143
 
select * from t22 order by col1;
2144
 
col1
2145
 
3
2146
 
8
2147
 
9
2148
 
select * from t33 order by col1;
2149
 
col1
2150
 
3
2151
 
8
2152
 
9
2153
 
select * from t44 order by colint;
2154
 
colint  col1
2155
 
60      9
2156
 
select * from t55 order by colint;
2157
 
colint  col1
2158
 
60      9
2159
 
select * from t66 order by colint;
2160
 
colint  col1
2161
 
60      9
2162
 
-------------------------
2163
 
---- some alter table end
2164
 
-------------------------
2165
 
drop table if exists t1 ;
2166
 
drop table if exists t2 ;
2167
 
drop table if exists t3 ;
2168
 
drop table if exists t4 ;
2169
 
drop table if exists t5 ;
2170
 
drop table if exists t6 ;
2171
 
drop table if exists t11 ;
2172
 
drop table if exists t22 ;
2173
 
drop table if exists t33 ;
2174
 
drop table if exists t44 ;
2175
 
drop table if exists t55 ;
2176
 
drop table if exists t66 ;
2177
 
-------------------------------------------------------------------------
2178
 
---  cast(ceiling(col1) as signed integer)  in partition with coltype  float(7,4)
2179
 
-------------------------------------------------------------------------
2180
 
drop table if exists t1 ;
2181
 
drop table if exists t2 ;
2182
 
drop table if exists t3 ;
2183
 
drop table if exists t4 ;
2184
 
drop table if exists t5 ;
2185
 
drop table if exists t6 ;
2186
 
-------------------------------------------------------------------------
2187
 
---  Create tables with cast(ceiling(col1) as signed integer)
2188
 
-------------------------------------------------------------------------
2189
 
create table t1 (col1 float(7,4)) engine='NDB' 
2190
 
partition by range(cast(ceiling(col1) as signed integer)) 
2191
 
(partition p0 values less than (15),
2192
 
partition p1 values less than maxvalue);
2193
 
create table t2 (col1 float(7,4)) engine='NDB' 
2194
 
partition by list(cast(ceiling(col1) as signed integer)) 
2195
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
2196
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2197
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2198
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2199
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2200
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2201
 
);
2202
 
create table t3 (col1 float(7,4)) engine='NDB' 
2203
 
partition by hash(cast(ceiling(col1) as signed integer));
2204
 
create table t4 (colint int, col1 float(7,4)) engine='NDB' 
2205
 
partition by range(colint) 
2206
 
subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 
2207
 
(partition p0 values less than (15),
2208
 
partition p1 values less than maxvalue);
2209
 
create table t5 (colint int, col1 float(7,4)) engine='NDB' 
2210
 
partition by list(colint)
2211
 
subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 
2212
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
2213
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2214
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2215
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2216
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2217
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2218
 
);
2219
 
create table t6 (colint int, col1 float(7,4)) engine='NDB' 
2220
 
partition by range(colint) 
2221
 
(partition p0 values less than (cast(ceiling(15) as signed integer)),
2222
 
partition p1 values less than maxvalue);
2223
 
-------------------------------------------------------------------------
2224
 
---  Access tables with cast(ceiling(col1) as signed integer) 
2225
 
-------------------------------------------------------------------------
2226
 
insert into t1 values (5.1230);
2227
 
insert into t1 values (13.345);
2228
 
insert into t2 values (5.1230);
2229
 
insert into t2 values (13.345);
2230
 
insert into t2 values (17.987);
2231
 
insert into t3 values (5.1230);
2232
 
insert into t3 values (13.345);
2233
 
insert into t3 values (17.987);
2234
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4;
2235
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5;
2236
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6;
2237
 
select cast(ceiling(col1) as signed integer) from t1 order by col1;
2238
 
cast(ceiling(col1) as signed integer)
2239
 
6
2240
 
14
2241
 
select * from t1 order by col1;
2242
 
col1
2243
 
5.1230
2244
 
13.3450
2245
 
select * from t2 order by col1;
2246
 
col1
2247
 
5.1230
2248
 
13.3450
2249
 
17.9870
2250
 
select * from t3 order by col1;
2251
 
col1
2252
 
5.1230
2253
 
13.3450
2254
 
17.9870
2255
 
select * from t4 order by colint;
2256
 
colint  col1
2257
 
1       5.1230
2258
 
2       13.3450
2259
 
3       17.9870
2260
 
4       15.6540
2261
 
select * from t5 order by colint;
2262
 
colint  col1
2263
 
1       5.1230
2264
 
2       13.3450
2265
 
3       17.9870
2266
 
4       15.6540
2267
 
select * from t6 order by colint;
2268
 
colint  col1
2269
 
1       5.1230
2270
 
2       13.3450
2271
 
3       17.9870
2272
 
4       15.6540
2273
 
update t1 set col1=15.654  where col1=5.1230;
2274
 
update t2 set col1=15.654  where col1=5.1230;
2275
 
update t3 set col1=15.654  where col1=5.1230;
2276
 
update t4 set col1=15.654  where col1=5.1230;
2277
 
update t5 set col1=15.654  where col1=5.1230;
2278
 
update t6 set col1=15.654  where col1=5.1230;
2279
 
select * from t1 order by col1;
2280
 
col1
2281
 
13.3450
2282
 
15.6540
2283
 
select * from t2 order by col1;
2284
 
col1
2285
 
13.3450
2286
 
15.6540
2287
 
17.9870
2288
 
select * from t3 order by col1;
2289
 
col1
2290
 
13.3450
2291
 
15.6540
2292
 
17.9870
2293
 
select * from t4 order by colint;
2294
 
colint  col1
2295
 
1       15.6540
2296
 
2       13.3450
2297
 
3       17.9870
2298
 
4       15.6540
2299
 
select * from t5 order by colint;
2300
 
colint  col1
2301
 
1       15.6540
2302
 
2       13.3450
2303
 
3       17.9870
2304
 
4       15.6540
2305
 
select * from t6 order by colint;
2306
 
colint  col1
2307
 
1       15.6540
2308
 
2       13.3450
2309
 
3       17.9870
2310
 
4       15.6540
2311
 
-------------------------------------------------------------------------
2312
 
---  Alter tables with cast(ceiling(col1) as signed integer)
2313
 
-------------------------------------------------------------------------
2314
 
drop table if exists t11 ;
2315
 
drop table if exists t22 ;
2316
 
drop table if exists t33 ;
2317
 
drop table if exists t44 ;
2318
 
drop table if exists t55 ;
2319
 
drop table if exists t66 ;
2320
 
create table t11 engine='NDB' as select * from t1;
2321
 
create table t22 engine='NDB' as select * from t2;
2322
 
create table t33 engine='NDB' as select * from t3;
2323
 
create table t44 engine='NDB' as select * from t4;
2324
 
create table t55 engine='NDB' as select * from t5;
2325
 
create table t66 engine='NDB' as select * from t6;
2326
 
alter table t11
2327
 
partition by range(cast(ceiling(col1) as signed integer)) 
2328
 
(partition p0 values less than (15),
2329
 
partition p1 values less than maxvalue);
2330
 
alter table t22
2331
 
partition by list(cast(ceiling(col1) as signed integer)) 
2332
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
2333
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2334
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2335
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2336
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2337
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2338
 
);
2339
 
alter table t33
2340
 
partition by hash(cast(ceiling(col1) as signed integer));
2341
 
alter table t44
2342
 
partition by range(colint) 
2343
 
subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 
2344
 
(partition p0 values less than (15),
2345
 
partition p1 values less than maxvalue);
2346
 
alter table t55
2347
 
partition by list(colint)
2348
 
subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 2 
2349
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
2350
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2351
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2352
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2353
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2354
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2355
 
);
2356
 
alter table t66
2357
 
partition by range(colint) 
2358
 
(partition p0 values less than (cast(ceiling(15) as signed integer)),
2359
 
partition p1 values less than maxvalue);
2360
 
select * from t11 order by col1;
2361
 
col1
2362
 
13.3450
2363
 
15.6540
2364
 
select * from t22 order by col1;
2365
 
col1
2366
 
13.3450
2367
 
15.6540
2368
 
17.9870
2369
 
select * from t33 order by col1;
2370
 
col1
2371
 
13.3450
2372
 
15.6540
2373
 
17.9870
2374
 
select * from t44 order by colint;
2375
 
colint  col1
2376
 
1       15.6540
2377
 
2       13.3450
2378
 
3       17.9870
2379
 
4       15.6540
2380
 
select * from t55 order by colint;
2381
 
colint  col1
2382
 
1       15.6540
2383
 
2       13.3450
2384
 
3       17.9870
2385
 
4       15.6540
2386
 
select * from t66 order by colint;
2387
 
colint  col1
2388
 
1       15.6540
2389
 
2       13.3450
2390
 
3       17.9870
2391
 
4       15.6540
2392
 
---------------------------
2393
 
---- some alter table begin
2394
 
---------------------------
2395
 
alter table t11
2396
 
reorganize partition p0,p1 into
2397
 
(partition s1 values less than maxvalue);
2398
 
select * from t11 order by col1;
2399
 
col1
2400
 
13.3450
2401
 
15.6540
2402
 
alter table t11
2403
 
reorganize partition s1 into
2404
 
(partition p0 values less than (15),
2405
 
partition p1 values less than maxvalue);
2406
 
select * from t11 order by col1;
2407
 
col1
2408
 
13.3450
2409
 
15.6540
2410
 
alter table t55
2411
 
partition by list(colint)
2412
 
subpartition by hash(cast(ceiling(col1) as signed integer)) subpartitions 5 
2413
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
2414
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2415
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2416
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2417
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2418
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2419
 
);
2420
 
show create table t55;
2421
 
Table   Create Table
2422
 
t55     CREATE TABLE `t55` (
2423
 
  `colint` int(11) DEFAULT NULL,
2424
 
  `col1` float(7,4) DEFAULT NULL
2425
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(ceiling(col1) as signed integer)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
2426
 
select * from t55 order by colint;
2427
 
colint  col1
2428
 
1       15.6540
2429
 
2       13.3450
2430
 
3       17.9870
2431
 
4       15.6540
2432
 
alter table t66
2433
 
reorganize partition p0,p1 into
2434
 
(partition s1 values less than maxvalue);
2435
 
select * from t66 order by colint;
2436
 
colint  col1
2437
 
1       15.6540
2438
 
2       13.3450
2439
 
3       17.9870
2440
 
4       15.6540
2441
 
alter table t66
2442
 
reorganize partition s1 into
2443
 
(partition p0 values less than (cast(ceiling(15) as signed integer)),
2444
 
partition p1 values less than maxvalue);
2445
 
select * from t66 order by colint;
2446
 
colint  col1
2447
 
1       15.6540
2448
 
2       13.3450
2449
 
3       17.9870
2450
 
4       15.6540
2451
 
alter table t66
2452
 
reorganize partition p0,p1 into
2453
 
(partition s1 values less than maxvalue);
2454
 
select * from t66 order by colint;
2455
 
colint  col1
2456
 
1       15.6540
2457
 
2       13.3450
2458
 
3       17.9870
2459
 
4       15.6540
2460
 
alter table t66
2461
 
reorganize partition s1 into
2462
 
(partition p0 values less than (cast(ceiling(15) as signed integer)),
2463
 
partition p1 values less than maxvalue);
2464
 
select * from t66 order by colint;
2465
 
colint  col1
2466
 
1       15.6540
2467
 
2       13.3450
2468
 
3       17.9870
2469
 
4       15.6540
2470
 
-------------------------------------------------------------------------
2471
 
---  Delete rows and partitions of tables with cast(ceiling(col1) as signed integer)
2472
 
-------------------------------------------------------------------------
2473
 
delete from t1 where col1=13.345;
2474
 
delete from t2 where col1=13.345;
2475
 
delete from t3 where col1=13.345;
2476
 
delete from t4 where col1=13.345;
2477
 
delete from t5 where col1=13.345;
2478
 
delete from t6 where col1=13.345;
2479
 
select * from t1 order by col1;
2480
 
col1
2481
 
15.6540
2482
 
select * from t2 order by col1;
2483
 
col1
2484
 
15.6540
2485
 
17.9870
2486
 
select * from t3 order by col1;
2487
 
col1
2488
 
15.6540
2489
 
17.9870
2490
 
select * from t4 order by colint;
2491
 
colint  col1
2492
 
1       15.6540
2493
 
3       17.9870
2494
 
4       15.6540
2495
 
select * from t5 order by colint;
2496
 
colint  col1
2497
 
1       15.6540
2498
 
3       17.9870
2499
 
4       15.6540
2500
 
insert into t1 values (13.345);
2501
 
insert into t2 values (13.345);
2502
 
insert into t3 values (13.345);
2503
 
insert into t4 values (60,13.345);
2504
 
insert into t5 values (60,13.345);
2505
 
insert into t6 values (60,13.345);
2506
 
select * from t1 order by col1;
2507
 
col1
2508
 
13.3450
2509
 
15.6540
2510
 
select * from t2 order by col1;
2511
 
col1
2512
 
13.3450
2513
 
15.6540
2514
 
17.9870
2515
 
select * from t3 order by col1;
2516
 
col1
2517
 
13.3450
2518
 
15.6540
2519
 
17.9870
2520
 
select * from t4 order by colint;
2521
 
colint  col1
2522
 
1       15.6540
2523
 
3       17.9870
2524
 
4       15.6540
2525
 
60      13.3450
2526
 
select * from t5 order by colint;
2527
 
colint  col1
2528
 
1       15.6540
2529
 
3       17.9870
2530
 
4       15.6540
2531
 
60      13.3450
2532
 
select * from t6 order by colint;
2533
 
colint  col1
2534
 
1       15.6540
2535
 
3       17.9870
2536
 
4       15.6540
2537
 
60      13.3450
2538
 
alter table t1 drop partition p0;
2539
 
alter table t2 drop partition p0;
2540
 
alter table t4 drop partition p0;
2541
 
alter table t5 drop partition p0;
2542
 
alter table t6 drop partition p0;
2543
 
select * from t1 order by col1;
2544
 
col1
2545
 
15.6540
2546
 
select * from t2 order by col1;
2547
 
col1
2548
 
13.3450
2549
 
15.6540
2550
 
17.9870
2551
 
select * from t3 order by col1;
2552
 
col1
2553
 
13.3450
2554
 
15.6540
2555
 
17.9870
2556
 
select * from t4 order by colint;
2557
 
colint  col1
2558
 
60      13.3450
2559
 
select * from t5 order by colint;
2560
 
colint  col1
2561
 
60      13.3450
2562
 
select * from t6 order by colint;
2563
 
colint  col1
2564
 
60      13.3450
2565
 
-------------------------------------------------------------------------
2566
 
---  Delete rows and partitions of tables with cast(ceiling(col1) as signed integer)
2567
 
-------------------------------------------------------------------------
2568
 
delete from t11 where col1=13.345;
2569
 
delete from t22 where col1=13.345;
2570
 
delete from t33 where col1=13.345;
2571
 
delete from t44 where col1=13.345;
2572
 
delete from t55 where col1=13.345;
2573
 
delete from t66 where col1=13.345;
2574
 
select * from t11 order by col1;
2575
 
col1
2576
 
15.6540
2577
 
select * from t22 order by col1;
2578
 
col1
2579
 
15.6540
2580
 
17.9870
2581
 
select * from t33 order by col1;
2582
 
col1
2583
 
15.6540
2584
 
17.9870
2585
 
select * from t44 order by colint;
2586
 
colint  col1
2587
 
1       15.6540
2588
 
3       17.9870
2589
 
4       15.6540
2590
 
select * from t55 order by colint;
2591
 
colint  col1
2592
 
1       15.6540
2593
 
3       17.9870
2594
 
4       15.6540
2595
 
insert into t11 values (13.345);
2596
 
insert into t22 values (13.345);
2597
 
insert into t33 values (13.345);
2598
 
insert into t44 values (60,13.345);
2599
 
insert into t55 values (60,13.345);
2600
 
insert into t66 values (60,13.345);
2601
 
select * from t11 order by col1;
2602
 
col1
2603
 
13.3450
2604
 
15.6540
2605
 
select * from t22 order by col1;
2606
 
col1
2607
 
13.3450
2608
 
15.6540
2609
 
17.9870
2610
 
select * from t33 order by col1;
2611
 
col1
2612
 
13.3450
2613
 
15.6540
2614
 
17.9870
2615
 
select * from t44 order by colint;
2616
 
colint  col1
2617
 
1       15.6540
2618
 
3       17.9870
2619
 
4       15.6540
2620
 
60      13.3450
2621
 
select * from t55 order by colint;
2622
 
colint  col1
2623
 
1       15.6540
2624
 
3       17.9870
2625
 
4       15.6540
2626
 
60      13.3450
2627
 
select * from t66 order by colint;
2628
 
colint  col1
2629
 
1       15.6540
2630
 
3       17.9870
2631
 
4       15.6540
2632
 
60      13.3450
2633
 
alter table t11 drop partition p0;
2634
 
alter table t22 drop partition p0;
2635
 
alter table t44 drop partition p0;
2636
 
alter table t55 drop partition p0;
2637
 
alter table t66 drop partition p0;
2638
 
select * from t11 order by col1;
2639
 
col1
2640
 
15.6540
2641
 
select * from t22 order by col1;
2642
 
col1
2643
 
13.3450
2644
 
15.6540
2645
 
17.9870
2646
 
select * from t33 order by col1;
2647
 
col1
2648
 
13.3450
2649
 
15.6540
2650
 
17.9870
2651
 
select * from t44 order by colint;
2652
 
colint  col1
2653
 
60      13.3450
2654
 
select * from t55 order by colint;
2655
 
colint  col1
2656
 
60      13.3450
2657
 
select * from t66 order by colint;
2658
 
colint  col1
2659
 
60      13.3450
2660
 
-------------------------
2661
 
---- some alter table end
2662
 
-------------------------
2663
 
drop table if exists t1 ;
2664
 
drop table if exists t2 ;
2665
 
drop table if exists t3 ;
2666
 
drop table if exists t4 ;
2667
 
drop table if exists t5 ;
2668
 
drop table if exists t6 ;
2669
 
drop table if exists t11 ;
2670
 
drop table if exists t22 ;
2671
 
drop table if exists t33 ;
2672
 
drop table if exists t44 ;
2673
 
drop table if exists t55 ;
2674
 
drop table if exists t66 ;
2675
 
-------------------------------------------------------------------------
2676
 
---  cast(floor(col1) as signed)  in partition with coltype  float(7,4)
2677
 
-------------------------------------------------------------------------
2678
 
drop table if exists t1 ;
2679
 
drop table if exists t2 ;
2680
 
drop table if exists t3 ;
2681
 
drop table if exists t4 ;
2682
 
drop table if exists t5 ;
2683
 
drop table if exists t6 ;
2684
 
-------------------------------------------------------------------------
2685
 
---  Create tables with cast(floor(col1) as signed)
2686
 
-------------------------------------------------------------------------
2687
 
create table t1 (col1 float(7,4)) engine='NDB' 
2688
 
partition by range(cast(floor(col1) as signed)) 
2689
 
(partition p0 values less than (15),
2690
 
partition p1 values less than maxvalue);
2691
 
create table t2 (col1 float(7,4)) engine='NDB' 
2692
 
partition by list(cast(floor(col1) as signed)) 
2693
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
2694
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2695
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2696
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2697
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2698
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2699
 
);
2700
 
create table t3 (col1 float(7,4)) engine='NDB' 
2701
 
partition by hash(cast(floor(col1) as signed));
2702
 
create table t4 (colint int, col1 float(7,4)) engine='NDB' 
2703
 
partition by range(colint) 
2704
 
subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 
2705
 
(partition p0 values less than (15),
2706
 
partition p1 values less than maxvalue);
2707
 
create table t5 (colint int, col1 float(7,4)) engine='NDB' 
2708
 
partition by list(colint)
2709
 
subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 
2710
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
2711
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2712
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2713
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2714
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2715
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2716
 
);
2717
 
create table t6 (colint int, col1 float(7,4)) engine='NDB' 
2718
 
partition by range(colint) 
2719
 
(partition p0 values less than (cast(floor(15.123) as signed)),
2720
 
partition p1 values less than maxvalue);
2721
 
-------------------------------------------------------------------------
2722
 
---  Access tables with cast(floor(col1) as signed) 
2723
 
-------------------------------------------------------------------------
2724
 
insert into t1 values (5.1230);
2725
 
insert into t1 values (13.345);
2726
 
insert into t2 values (5.1230);
2727
 
insert into t2 values (13.345);
2728
 
insert into t2 values (17.987);
2729
 
insert into t3 values (5.1230);
2730
 
insert into t3 values (13.345);
2731
 
insert into t3 values (17.987);
2732
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4;
2733
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5;
2734
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6;
2735
 
select cast(floor(col1) as signed) from t1 order by col1;
2736
 
cast(floor(col1) as signed)
2737
 
5
2738
 
13
2739
 
select * from t1 order by col1;
2740
 
col1
2741
 
5.1230
2742
 
13.3450
2743
 
select * from t2 order by col1;
2744
 
col1
2745
 
5.1230
2746
 
13.3450
2747
 
17.9870
2748
 
select * from t3 order by col1;
2749
 
col1
2750
 
5.1230
2751
 
13.3450
2752
 
17.9870
2753
 
select * from t4 order by colint;
2754
 
colint  col1
2755
 
1       5.1230
2756
 
2       13.3450
2757
 
3       17.9870
2758
 
4       15.6540
2759
 
select * from t5 order by colint;
2760
 
colint  col1
2761
 
1       5.1230
2762
 
2       13.3450
2763
 
3       17.9870
2764
 
4       15.6540
2765
 
select * from t6 order by colint;
2766
 
colint  col1
2767
 
1       5.1230
2768
 
2       13.3450
2769
 
3       17.9870
2770
 
4       15.6540
2771
 
update t1 set col1=15.654  where col1=5.1230;
2772
 
update t2 set col1=15.654  where col1=5.1230;
2773
 
update t3 set col1=15.654  where col1=5.1230;
2774
 
update t4 set col1=15.654  where col1=5.1230;
2775
 
update t5 set col1=15.654  where col1=5.1230;
2776
 
update t6 set col1=15.654  where col1=5.1230;
2777
 
select * from t1 order by col1;
2778
 
col1
2779
 
13.3450
2780
 
15.6540
2781
 
select * from t2 order by col1;
2782
 
col1
2783
 
13.3450
2784
 
15.6540
2785
 
17.9870
2786
 
select * from t3 order by col1;
2787
 
col1
2788
 
13.3450
2789
 
15.6540
2790
 
17.9870
2791
 
select * from t4 order by colint;
2792
 
colint  col1
2793
 
1       15.6540
2794
 
2       13.3450
2795
 
3       17.9870
2796
 
4       15.6540
2797
 
select * from t5 order by colint;
2798
 
colint  col1
2799
 
1       15.6540
2800
 
2       13.3450
2801
 
3       17.9870
2802
 
4       15.6540
2803
 
select * from t6 order by colint;
2804
 
colint  col1
2805
 
1       15.6540
2806
 
2       13.3450
2807
 
3       17.9870
2808
 
4       15.6540
2809
 
-------------------------------------------------------------------------
2810
 
---  Alter tables with cast(floor(col1) as signed)
2811
 
-------------------------------------------------------------------------
2812
 
drop table if exists t11 ;
2813
 
drop table if exists t22 ;
2814
 
drop table if exists t33 ;
2815
 
drop table if exists t44 ;
2816
 
drop table if exists t55 ;
2817
 
drop table if exists t66 ;
2818
 
create table t11 engine='NDB' as select * from t1;
2819
 
create table t22 engine='NDB' as select * from t2;
2820
 
create table t33 engine='NDB' as select * from t3;
2821
 
create table t44 engine='NDB' as select * from t4;
2822
 
create table t55 engine='NDB' as select * from t5;
2823
 
create table t66 engine='NDB' as select * from t6;
2824
 
alter table t11
2825
 
partition by range(cast(floor(col1) as signed)) 
2826
 
(partition p0 values less than (15),
2827
 
partition p1 values less than maxvalue);
2828
 
alter table t22
2829
 
partition by list(cast(floor(col1) as signed)) 
2830
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
2831
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2832
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2833
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2834
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2835
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2836
 
);
2837
 
alter table t33
2838
 
partition by hash(cast(floor(col1) as signed));
2839
 
alter table t44
2840
 
partition by range(colint) 
2841
 
subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 
2842
 
(partition p0 values less than (15),
2843
 
partition p1 values less than maxvalue);
2844
 
alter table t55
2845
 
partition by list(colint)
2846
 
subpartition by hash(cast(floor(col1) as signed)) subpartitions 2 
2847
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
2848
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2849
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2850
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2851
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2852
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2853
 
);
2854
 
alter table t66
2855
 
partition by range(colint) 
2856
 
(partition p0 values less than (cast(floor(15.123) as signed)),
2857
 
partition p1 values less than maxvalue);
2858
 
select * from t11 order by col1;
2859
 
col1
2860
 
13.3450
2861
 
15.6540
2862
 
select * from t22 order by col1;
2863
 
col1
2864
 
13.3450
2865
 
15.6540
2866
 
17.9870
2867
 
select * from t33 order by col1;
2868
 
col1
2869
 
13.3450
2870
 
15.6540
2871
 
17.9870
2872
 
select * from t44 order by colint;
2873
 
colint  col1
2874
 
1       15.6540
2875
 
2       13.3450
2876
 
3       17.9870
2877
 
4       15.6540
2878
 
select * from t55 order by colint;
2879
 
colint  col1
2880
 
1       15.6540
2881
 
2       13.3450
2882
 
3       17.9870
2883
 
4       15.6540
2884
 
select * from t66 order by colint;
2885
 
colint  col1
2886
 
1       15.6540
2887
 
2       13.3450
2888
 
3       17.9870
2889
 
4       15.6540
2890
 
---------------------------
2891
 
---- some alter table begin
2892
 
---------------------------
2893
 
alter table t11
2894
 
reorganize partition p0,p1 into
2895
 
(partition s1 values less than maxvalue);
2896
 
select * from t11 order by col1;
2897
 
col1
2898
 
13.3450
2899
 
15.6540
2900
 
alter table t11
2901
 
reorganize partition s1 into
2902
 
(partition p0 values less than (15),
2903
 
partition p1 values less than maxvalue);
2904
 
select * from t11 order by col1;
2905
 
col1
2906
 
13.3450
2907
 
15.6540
2908
 
alter table t55
2909
 
partition by list(colint)
2910
 
subpartition by hash(cast(floor(col1) as signed)) subpartitions 5 
2911
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
2912
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
2913
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
2914
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
2915
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
2916
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
2917
 
);
2918
 
show create table t55;
2919
 
Table   Create Table
2920
 
t55     CREATE TABLE `t55` (
2921
 
  `colint` int(11) DEFAULT NULL,
2922
 
  `col1` float(7,4) DEFAULT NULL
2923
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(floor(col1) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
2924
 
select * from t55 order by colint;
2925
 
colint  col1
2926
 
1       15.6540
2927
 
2       13.3450
2928
 
3       17.9870
2929
 
4       15.6540
2930
 
alter table t66
2931
 
reorganize partition p0,p1 into
2932
 
(partition s1 values less than maxvalue);
2933
 
select * from t66 order by colint;
2934
 
colint  col1
2935
 
1       15.6540
2936
 
2       13.3450
2937
 
3       17.9870
2938
 
4       15.6540
2939
 
alter table t66
2940
 
reorganize partition s1 into
2941
 
(partition p0 values less than (cast(floor(15.123) as signed)),
2942
 
partition p1 values less than maxvalue);
2943
 
select * from t66 order by colint;
2944
 
colint  col1
2945
 
1       15.6540
2946
 
2       13.3450
2947
 
3       17.9870
2948
 
4       15.6540
2949
 
alter table t66
2950
 
reorganize partition p0,p1 into
2951
 
(partition s1 values less than maxvalue);
2952
 
select * from t66 order by colint;
2953
 
colint  col1
2954
 
1       15.6540
2955
 
2       13.3450
2956
 
3       17.9870
2957
 
4       15.6540
2958
 
alter table t66
2959
 
reorganize partition s1 into
2960
 
(partition p0 values less than (cast(floor(15.123) as signed)),
2961
 
partition p1 values less than maxvalue);
2962
 
select * from t66 order by colint;
2963
 
colint  col1
2964
 
1       15.6540
2965
 
2       13.3450
2966
 
3       17.9870
2967
 
4       15.6540
2968
 
-------------------------------------------------------------------------
2969
 
---  Delete rows and partitions of tables with cast(floor(col1) as signed)
2970
 
-------------------------------------------------------------------------
2971
 
delete from t1 where col1=13.345;
2972
 
delete from t2 where col1=13.345;
2973
 
delete from t3 where col1=13.345;
2974
 
delete from t4 where col1=13.345;
2975
 
delete from t5 where col1=13.345;
2976
 
delete from t6 where col1=13.345;
2977
 
select * from t1 order by col1;
2978
 
col1
2979
 
15.6540
2980
 
select * from t2 order by col1;
2981
 
col1
2982
 
15.6540
2983
 
17.9870
2984
 
select * from t3 order by col1;
2985
 
col1
2986
 
15.6540
2987
 
17.9870
2988
 
select * from t4 order by colint;
2989
 
colint  col1
2990
 
1       15.6540
2991
 
3       17.9870
2992
 
4       15.6540
2993
 
select * from t5 order by colint;
2994
 
colint  col1
2995
 
1       15.6540
2996
 
3       17.9870
2997
 
4       15.6540
2998
 
insert into t1 values (13.345);
2999
 
insert into t2 values (13.345);
3000
 
insert into t3 values (13.345);
3001
 
insert into t4 values (60,13.345);
3002
 
insert into t5 values (60,13.345);
3003
 
insert into t6 values (60,13.345);
3004
 
select * from t1 order by col1;
3005
 
col1
3006
 
13.3450
3007
 
15.6540
3008
 
select * from t2 order by col1;
3009
 
col1
3010
 
13.3450
3011
 
15.6540
3012
 
17.9870
3013
 
select * from t3 order by col1;
3014
 
col1
3015
 
13.3450
3016
 
15.6540
3017
 
17.9870
3018
 
select * from t4 order by colint;
3019
 
colint  col1
3020
 
1       15.6540
3021
 
3       17.9870
3022
 
4       15.6540
3023
 
60      13.3450
3024
 
select * from t5 order by colint;
3025
 
colint  col1
3026
 
1       15.6540
3027
 
3       17.9870
3028
 
4       15.6540
3029
 
60      13.3450
3030
 
select * from t6 order by colint;
3031
 
colint  col1
3032
 
1       15.6540
3033
 
3       17.9870
3034
 
4       15.6540
3035
 
60      13.3450
3036
 
alter table t1 drop partition p0;
3037
 
alter table t2 drop partition p0;
3038
 
alter table t4 drop partition p0;
3039
 
alter table t5 drop partition p0;
3040
 
alter table t6 drop partition p0;
3041
 
select * from t1 order by col1;
3042
 
col1
3043
 
15.6540
3044
 
select * from t2 order by col1;
3045
 
col1
3046
 
13.3450
3047
 
15.6540
3048
 
17.9870
3049
 
select * from t3 order by col1;
3050
 
col1
3051
 
13.3450
3052
 
15.6540
3053
 
17.9870
3054
 
select * from t4 order by colint;
3055
 
colint  col1
3056
 
60      13.3450
3057
 
select * from t5 order by colint;
3058
 
colint  col1
3059
 
60      13.3450
3060
 
select * from t6 order by colint;
3061
 
colint  col1
3062
 
60      13.3450
3063
 
-------------------------------------------------------------------------
3064
 
---  Delete rows and partitions of tables with cast(floor(col1) as signed)
3065
 
-------------------------------------------------------------------------
3066
 
delete from t11 where col1=13.345;
3067
 
delete from t22 where col1=13.345;
3068
 
delete from t33 where col1=13.345;
3069
 
delete from t44 where col1=13.345;
3070
 
delete from t55 where col1=13.345;
3071
 
delete from t66 where col1=13.345;
3072
 
select * from t11 order by col1;
3073
 
col1
3074
 
15.6540
3075
 
select * from t22 order by col1;
3076
 
col1
3077
 
15.6540
3078
 
17.9870
3079
 
select * from t33 order by col1;
3080
 
col1
3081
 
15.6540
3082
 
17.9870
3083
 
select * from t44 order by colint;
3084
 
colint  col1
3085
 
1       15.6540
3086
 
3       17.9870
3087
 
4       15.6540
3088
 
select * from t55 order by colint;
3089
 
colint  col1
3090
 
1       15.6540
3091
 
3       17.9870
3092
 
4       15.6540
3093
 
insert into t11 values (13.345);
3094
 
insert into t22 values (13.345);
3095
 
insert into t33 values (13.345);
3096
 
insert into t44 values (60,13.345);
3097
 
insert into t55 values (60,13.345);
3098
 
insert into t66 values (60,13.345);
3099
 
select * from t11 order by col1;
3100
 
col1
3101
 
13.3450
3102
 
15.6540
3103
 
select * from t22 order by col1;
3104
 
col1
3105
 
13.3450
3106
 
15.6540
3107
 
17.9870
3108
 
select * from t33 order by col1;
3109
 
col1
3110
 
13.3450
3111
 
15.6540
3112
 
17.9870
3113
 
select * from t44 order by colint;
3114
 
colint  col1
3115
 
1       15.6540
3116
 
3       17.9870
3117
 
4       15.6540
3118
 
60      13.3450
3119
 
select * from t55 order by colint;
3120
 
colint  col1
3121
 
1       15.6540
3122
 
3       17.9870
3123
 
4       15.6540
3124
 
60      13.3450
3125
 
select * from t66 order by colint;
3126
 
colint  col1
3127
 
1       15.6540
3128
 
3       17.9870
3129
 
4       15.6540
3130
 
60      13.3450
3131
 
alter table t11 drop partition p0;
3132
 
alter table t22 drop partition p0;
3133
 
alter table t44 drop partition p0;
3134
 
alter table t55 drop partition p0;
3135
 
alter table t66 drop partition p0;
3136
 
select * from t11 order by col1;
3137
 
col1
3138
 
15.6540
3139
 
select * from t22 order by col1;
3140
 
col1
3141
 
13.3450
3142
 
15.6540
3143
 
17.9870
3144
 
select * from t33 order by col1;
3145
 
col1
3146
 
13.3450
3147
 
15.6540
3148
 
17.9870
3149
 
select * from t44 order by colint;
3150
 
colint  col1
3151
 
60      13.3450
3152
 
select * from t55 order by colint;
3153
 
colint  col1
3154
 
60      13.3450
3155
 
select * from t66 order by colint;
3156
 
colint  col1
3157
 
60      13.3450
3158
 
-------------------------
3159
 
---- some alter table end
3160
 
-------------------------
3161
 
drop table if exists t1 ;
3162
 
drop table if exists t2 ;
3163
 
drop table if exists t3 ;
3164
 
drop table if exists t4 ;
3165
 
drop table if exists t5 ;
3166
 
drop table if exists t6 ;
3167
 
drop table if exists t11 ;
3168
 
drop table if exists t22 ;
3169
 
drop table if exists t33 ;
3170
 
drop table if exists t44 ;
3171
 
drop table if exists t55 ;
3172
 
drop table if exists t66 ;
3173
 
-------------------------------------------------------------------------
3174
 
---  cast(mod(col1,10) as signed)  in partition with coltype  float(7,4)
3175
 
-------------------------------------------------------------------------
3176
 
drop table if exists t1 ;
3177
 
drop table if exists t2 ;
3178
 
drop table if exists t3 ;
3179
 
drop table if exists t4 ;
3180
 
drop table if exists t5 ;
3181
 
drop table if exists t6 ;
3182
 
-------------------------------------------------------------------------
3183
 
---  Create tables with cast(mod(col1,10) as signed)
3184
 
-------------------------------------------------------------------------
3185
 
create table t1 (col1 float(7,4)) engine='NDB' 
3186
 
partition by range(cast(mod(col1,10) as signed)) 
3187
 
(partition p0 values less than (15),
3188
 
partition p1 values less than maxvalue);
3189
 
create table t2 (col1 float(7,4)) engine='NDB' 
3190
 
partition by list(cast(mod(col1,10) as signed)) 
3191
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
3192
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3193
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3194
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3195
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3196
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3197
 
);
3198
 
create table t3 (col1 float(7,4)) engine='NDB' 
3199
 
partition by hash(cast(mod(col1,10) as signed));
3200
 
create table t4 (colint int, col1 float(7,4)) engine='NDB' 
3201
 
partition by range(colint) 
3202
 
subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 
3203
 
(partition p0 values less than (15),
3204
 
partition p1 values less than maxvalue);
3205
 
create table t5 (colint int, col1 float(7,4)) engine='NDB' 
3206
 
partition by list(colint)
3207
 
subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 
3208
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
3209
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3210
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3211
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3212
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3213
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3214
 
);
3215
 
create table t6 (colint int, col1 float(7,4)) engine='NDB' 
3216
 
partition by range(colint) 
3217
 
(partition p0 values less than (cast(mod(15,10) as signed)),
3218
 
partition p1 values less than maxvalue);
3219
 
-------------------------------------------------------------------------
3220
 
---  Access tables with cast(mod(col1,10) as signed) 
3221
 
-------------------------------------------------------------------------
3222
 
insert into t1 values (5.0000);
 
1189
-------------------------
 
1190
---- some alter table end
 
1191
-------------------------
 
1192
drop table if exists t1 ;
 
1193
drop table if exists t2 ;
 
1194
drop table if exists t3 ;
 
1195
drop table if exists t4 ;
 
1196
drop table if exists t5 ;
 
1197
drop table if exists t6 ;
 
1198
drop table if exists t11 ;
 
1199
drop table if exists t22 ;
 
1200
drop table if exists t33 ;
 
1201
drop table if exists t44 ;
 
1202
drop table if exists t55 ;
 
1203
drop table if exists t66 ;
 
1204
-------------------------------------------------------------------------
 
1205
---  mod(col1,10)  in partition with coltype  int
 
1206
-------------------------------------------------------------------------
 
1207
drop table if exists t1 ;
 
1208
drop table if exists t2 ;
 
1209
drop table if exists t3 ;
 
1210
drop table if exists t4 ;
 
1211
drop table if exists t5 ;
 
1212
drop table if exists t6 ;
 
1213
-------------------------------------------------------------------------
 
1214
---  Create tables with mod(col1,10)
 
1215
-------------------------------------------------------------------------
 
1216
create table t1 (col1 int) engine='NDB' 
 
1217
partition by range(mod(col1,10)) 
 
1218
(partition p0 values less than (15),
 
1219
partition p1 values less than maxvalue);
 
1220
create table t2 (col1 int) engine='NDB' 
 
1221
partition by list(mod(col1,10)) 
 
1222
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
 
1223
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 
1224
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
 
1225
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
 
1226
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
 
1227
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
1228
);
 
1229
create table t3 (col1 int) engine='NDB' 
 
1230
partition by hash(mod(col1,10));
 
1231
create table t4 (colint int, col1 int) engine='NDB' 
 
1232
partition by range(colint) 
 
1233
subpartition by hash(mod(col1,10)) subpartitions 2 
 
1234
(partition p0 values less than (15),
 
1235
partition p1 values less than maxvalue);
 
1236
create table t5 (colint int, col1 int) engine='NDB' 
 
1237
partition by list(colint) 
 
1238
subpartition by hash(mod(col1,10)) subpartitions 2 
 
1239
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
1240
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
1241
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
1242
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
 
1243
);
 
1244
create table t6 (colint int, col1 int) engine='NDB' 
 
1245
partition by range(colint) 
 
1246
(partition p0 values less than (mod(15,10)),
 
1247
partition p1 values less than maxvalue);
 
1248
-------------------------------------------------------------------------
 
1249
---  Access tables with mod(col1,10) 
 
1250
-------------------------------------------------------------------------
 
1251
insert into t1 values (5);
3223
1252
insert into t1 values (19);
3224
 
insert into t2 values (5.0000);
 
1253
insert into t2 values (5);
3225
1254
insert into t2 values (19);
3226
1255
insert into t2 values (17);
3227
 
insert into t3 values (5.0000);
 
1256
insert into t3 values (5);
3228
1257
insert into t3 values (19);
3229
1258
insert into t3 values (17);
3230
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t4;
3231
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t5;
3232
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_float.in' into table t6;
3233
 
select cast(mod(col1,10) as signed) from t1 order by col1;
3234
 
cast(mod(col1,10) as signed)
 
1259
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t4;
 
1260
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t5;
 
1261
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_int.inc' into table t6;
 
1262
select mod(col1,10) from t1 order by col1;
 
1263
mod(col1,10)
3235
1264
5
3236
1265
9
3237
1266
select * from t1 order by col1;
3238
1267
col1
3239
 
5.0000
3240
 
19.0000
 
1268
5
 
1269
19
3241
1270
select * from t2 order by col1;
3242
1271
col1
3243
 
5.0000
3244
 
17.0000
3245
 
19.0000
 
1272
5
 
1273
17
 
1274
19
3246
1275
select * from t3 order by col1;
3247
1276
col1
3248
 
5.0000
3249
 
17.0000
3250
 
19.0000
 
1277
5
 
1278
17
 
1279
19
3251
1280
select * from t4 order by colint;
3252
1281
colint  col1
3253
 
1       5.1230
3254
 
2       13.3450
3255
 
3       17.9870
3256
 
4       15.6540
 
1282
1       5
 
1283
2       13
 
1284
3       15
 
1285
4       17
 
1286
5       23
 
1287
6       34
 
1288
7       56
 
1289
8       56
 
1290
9       45
 
1291
10      34
 
1292
11      78
 
1293
12      89
 
1294
13      67
 
1295
14      46
 
1296
15      34
 
1297
16      324
 
1298
17      345
 
1299
18      34
 
1300
19      78
 
1301
20      567
 
1302
21      4
 
1303
22      435
 
1304
23      34
 
1305
24      45
 
1306
25      4565
 
1307
26      4
 
1308
27      3
 
1309
28      2
 
1310
29      3
 
1311
30      5
 
1312
31      6
 
1313
32      8
 
1314
33      9
 
1315
34      745
 
1316
35      34
 
1317
36      34
 
1318
37      324
 
1319
38      67
 
1320
39      78
 
1321
40      89
 
1322
41      90
 
1323
42      78967
 
1324
50      56
 
1325
51      34
 
1326
55      123
3257
1327
select * from t5 order by colint;
3258
1328
colint  col1
3259
 
1       5.1230
3260
 
2       13.3450
3261
 
3       17.9870
3262
 
4       15.6540
 
1329
1       5
 
1330
2       13
 
1331
3       15
 
1332
4       17
 
1333
5       23
 
1334
6       34
 
1335
7       56
 
1336
8       56
 
1337
9       45
 
1338
10      34
 
1339
11      78
 
1340
12      89
 
1341
13      67
 
1342
14      46
 
1343
15      34
 
1344
16      324
 
1345
17      345
 
1346
18      34
 
1347
19      78
 
1348
20      567
 
1349
21      4
 
1350
22      435
 
1351
23      34
 
1352
24      45
 
1353
25      4565
 
1354
26      4
 
1355
27      3
 
1356
28      2
 
1357
29      3
 
1358
30      5
 
1359
31      6
 
1360
32      8
 
1361
33      9
 
1362
34      745
 
1363
35      34
 
1364
36      34
 
1365
37      324
 
1366
38      67
 
1367
39      78
 
1368
40      89
 
1369
41      90
 
1370
42      78967
 
1371
50      56
 
1372
51      34
 
1373
55      123
3263
1374
select * from t6 order by colint;
3264
1375
colint  col1
3265
 
1       5.1230
3266
 
2       13.3450
3267
 
3       17.9870
3268
 
4       15.6540
3269
 
update t1 set col1=15  where col1=5.0000;
3270
 
update t2 set col1=15  where col1=5.0000;
3271
 
update t3 set col1=15  where col1=5.0000;
3272
 
update t4 set col1=15  where col1=5.0000;
3273
 
update t5 set col1=15  where col1=5.0000;
3274
 
update t6 set col1=15  where col1=5.0000;
 
1376
1       5
 
1377
2       13
 
1378
3       15
 
1379
4       17
 
1380
5       23
 
1381
6       34
 
1382
7       56
 
1383
8       56
 
1384
9       45
 
1385
10      34
 
1386
11      78
 
1387
12      89
 
1388
13      67
 
1389
14      46
 
1390
15      34
 
1391
16      324
 
1392
17      345
 
1393
18      34
 
1394
19      78
 
1395
20      567
 
1396
21      4
 
1397
22      435
 
1398
23      34
 
1399
24      45
 
1400
25      4565
 
1401
26      4
 
1402
27      3
 
1403
28      2
 
1404
29      3
 
1405
30      5
 
1406
31      6
 
1407
32      8
 
1408
33      9
 
1409
34      745
 
1410
35      34
 
1411
36      34
 
1412
37      324
 
1413
38      67
 
1414
39      78
 
1415
40      89
 
1416
41      90
 
1417
42      78967
 
1418
50      56
 
1419
51      34
 
1420
55      123
 
1421
update t1 set col1=15  where col1=5;
 
1422
update t2 set col1=15  where col1=5;
 
1423
update t3 set col1=15  where col1=5;
 
1424
update t4 set col1=15  where col1=5;
 
1425
update t5 set col1=15  where col1=5;
 
1426
update t6 set col1=15  where col1=5;
3275
1427
select * from t1 order by col1;
3276
1428
col1
3277
 
15.0000
3278
 
19.0000
 
1429
15
 
1430
19
3279
1431
select * from t2 order by col1;
3280
1432
col1
3281
 
15.0000
3282
 
17.0000
3283
 
19.0000
 
1433
15
 
1434
17
 
1435
19
3284
1436
select * from t3 order by col1;
3285
1437
col1
3286
 
15.0000
3287
 
17.0000
3288
 
19.0000
 
1438
15
 
1439
17
 
1440
19
3289
1441
select * from t4 order by colint;
3290
1442
colint  col1
3291
 
1       5.1230
3292
 
2       13.3450
3293
 
3       17.9870
3294
 
4       15.6540
 
1443
1       15
 
1444
2       13
 
1445
3       15
 
1446
4       17
 
1447
5       23
 
1448
6       34
 
1449
7       56
 
1450
8       56
 
1451
9       45
 
1452
10      34
 
1453
11      78
 
1454
12      89
 
1455
13      67
 
1456
14      46
 
1457
15      34
 
1458
16      324
 
1459
17      345
 
1460
18      34
 
1461
19      78
 
1462
20      567
 
1463
21      4
 
1464
22      435
 
1465
23      34
 
1466
24      45
 
1467
25      4565
 
1468
26      4
 
1469
27      3
 
1470
28      2
 
1471
29      3
 
1472
30      15
 
1473
31      6
 
1474
32      8
 
1475
33      9
 
1476
34      745
 
1477
35      34
 
1478
36      34
 
1479
37      324
 
1480
38      67
 
1481
39      78
 
1482
40      89
 
1483
41      90
 
1484
42      78967
 
1485
50      56
 
1486
51      34
 
1487
55      123
3295
1488
select * from t5 order by colint;
3296
1489
colint  col1
3297
 
1       5.1230
3298
 
2       13.3450
3299
 
3       17.9870
3300
 
4       15.6540
 
1490
1       15
 
1491
2       13
 
1492
3       15
 
1493
4       17
 
1494
5       23
 
1495
6       34
 
1496
7       56
 
1497
8       56
 
1498
9       45
 
1499
10      34
 
1500
11      78
 
1501
12      89
 
1502
13      67
 
1503
14      46
 
1504
15      34
 
1505
16      324
 
1506
17      345
 
1507
18      34
 
1508
19      78
 
1509
20      567
 
1510
21      4
 
1511
22      435
 
1512
23      34
 
1513
24      45
 
1514
25      4565
 
1515
26      4
 
1516
27      3
 
1517
28      2
 
1518
29      3
 
1519
30      15
 
1520
31      6
 
1521
32      8
 
1522
33      9
 
1523
34      745
 
1524
35      34
 
1525
36      34
 
1526
37      324
 
1527
38      67
 
1528
39      78
 
1529
40      89
 
1530
41      90
 
1531
42      78967
 
1532
50      56
 
1533
51      34
 
1534
55      123
3301
1535
select * from t6 order by colint;
3302
1536
colint  col1
3303
 
1       5.1230
3304
 
2       13.3450
3305
 
3       17.9870
3306
 
4       15.6540
 
1537
1       15
 
1538
2       13
 
1539
3       15
 
1540
4       17
 
1541
5       23
 
1542
6       34
 
1543
7       56
 
1544
8       56
 
1545
9       45
 
1546
10      34
 
1547
11      78
 
1548
12      89
 
1549
13      67
 
1550
14      46
 
1551
15      34
 
1552
16      324
 
1553
17      345
 
1554
18      34
 
1555
19      78
 
1556
20      567
 
1557
21      4
 
1558
22      435
 
1559
23      34
 
1560
24      45
 
1561
25      4565
 
1562
26      4
 
1563
27      3
 
1564
28      2
 
1565
29      3
 
1566
30      15
 
1567
31      6
 
1568
32      8
 
1569
33      9
 
1570
34      745
 
1571
35      34
 
1572
36      34
 
1573
37      324
 
1574
38      67
 
1575
39      78
 
1576
40      89
 
1577
41      90
 
1578
42      78967
 
1579
50      56
 
1580
51      34
 
1581
55      123
3307
1582
-------------------------------------------------------------------------
3308
 
---  Alter tables with cast(mod(col1,10) as signed)
 
1583
---  Alter tables with mod(col1,10)
3309
1584
-------------------------------------------------------------------------
3310
1585
drop table if exists t11 ;
3311
1586
drop table if exists t22 ;
3320
1595
create table t55 engine='NDB' as select * from t5;
3321
1596
create table t66 engine='NDB' as select * from t6;
3322
1597
alter table t11
3323
 
partition by range(cast(mod(col1,10) as signed)) 
 
1598
partition by range(mod(col1,10)) 
3324
1599
(partition p0 values less than (15),
3325
1600
partition p1 values less than maxvalue);
3326
1601
alter table t22
3327
 
partition by list(cast(mod(col1,10) as signed)) 
 
1602
partition by list(mod(col1,10)) 
3328
1603
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
3329
1604
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3330
1605
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3333
1608
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3334
1609
);
3335
1610
alter table t33
3336
 
partition by hash(cast(mod(col1,10) as signed));
 
1611
partition by hash(mod(col1,10));
3337
1612
alter table t44
3338
1613
partition by range(colint) 
3339
 
subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 
 
1614
subpartition by hash(mod(col1,10)) subpartitions 2 
3340
1615
(partition p0 values less than (15),
3341
1616
partition p1 values less than maxvalue);
3342
1617
alter table t55
3343
 
partition by list(colint)
3344
 
subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 2 
3345
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
3346
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3347
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3348
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3349
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3350
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
1618
partition by list(colint) 
 
1619
subpartition by hash(mod(col1,10)) subpartitions 2 
 
1620
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
1621
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
1622
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
1623
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
3351
1624
);
3352
1625
alter table t66
3353
1626
partition by range(colint) 
3354
 
(partition p0 values less than (cast(mod(15,10) as signed)),
 
1627
(partition p0 values less than (mod(15,10)),
3355
1628
partition p1 values less than maxvalue);
3356
1629
select * from t11 order by col1;
3357
1630
col1
3358
 
15.0000
3359
 
19.0000
 
1631
15
 
1632
19
3360
1633
select * from t22 order by col1;
3361
1634
col1
3362
 
15.0000
3363
 
17.0000
3364
 
19.0000
 
1635
15
 
1636
17
 
1637
19
3365
1638
select * from t33 order by col1;
3366
1639
col1
3367
 
15.0000
3368
 
17.0000
3369
 
19.0000
 
1640
15
 
1641
17
 
1642
19
3370
1643
select * from t44 order by colint;
3371
1644
colint  col1
3372
 
1       5.1230
3373
 
2       13.3450
3374
 
3       17.9870
3375
 
4       15.6540
 
1645
1       15
 
1646
2       13
 
1647
3       15
 
1648
4       17
 
1649
5       23
 
1650
6       34
 
1651
7       56
 
1652
8       56
 
1653
9       45
 
1654
10      34
 
1655
11      78
 
1656
12      89
 
1657
13      67
 
1658
14      46
 
1659
15      34
 
1660
16      324
 
1661
17      345
 
1662
18      34
 
1663
19      78
 
1664
20      567
 
1665
21      4
 
1666
22      435
 
1667
23      34
 
1668
24      45
 
1669
25      4565
 
1670
26      4
 
1671
27      3
 
1672
28      2
 
1673
29      3
 
1674
30      15
 
1675
31      6
 
1676
32      8
 
1677
33      9
 
1678
34      745
 
1679
35      34
 
1680
36      34
 
1681
37      324
 
1682
38      67
 
1683
39      78
 
1684
40      89
 
1685
41      90
 
1686
42      78967
 
1687
50      56
 
1688
51      34
 
1689
55      123
3376
1690
select * from t55 order by colint;
3377
1691
colint  col1
3378
 
1       5.1230
3379
 
2       13.3450
3380
 
3       17.9870
3381
 
4       15.6540
 
1692
1       15
 
1693
2       13
 
1694
3       15
 
1695
4       17
 
1696
5       23
 
1697
6       34
 
1698
7       56
 
1699
8       56
 
1700
9       45
 
1701
10      34
 
1702
11      78
 
1703
12      89
 
1704
13      67
 
1705
14      46
 
1706
15      34
 
1707
16      324
 
1708
17      345
 
1709
18      34
 
1710
19      78
 
1711
20      567
 
1712
21      4
 
1713
22      435
 
1714
23      34
 
1715
24      45
 
1716
25      4565
 
1717
26      4
 
1718
27      3
 
1719
28      2
 
1720
29      3
 
1721
30      15
 
1722
31      6
 
1723
32      8
 
1724
33      9
 
1725
34      745
 
1726
35      34
 
1727
36      34
 
1728
37      324
 
1729
38      67
 
1730
39      78
 
1731
40      89
 
1732
41      90
 
1733
42      78967
 
1734
50      56
 
1735
51      34
 
1736
55      123
3382
1737
select * from t66 order by colint;
3383
1738
colint  col1
3384
 
1       5.1230
3385
 
2       13.3450
3386
 
3       17.9870
3387
 
4       15.6540
 
1739
1       15
 
1740
2       13
 
1741
3       15
 
1742
4       17
 
1743
5       23
 
1744
6       34
 
1745
7       56
 
1746
8       56
 
1747
9       45
 
1748
10      34
 
1749
11      78
 
1750
12      89
 
1751
13      67
 
1752
14      46
 
1753
15      34
 
1754
16      324
 
1755
17      345
 
1756
18      34
 
1757
19      78
 
1758
20      567
 
1759
21      4
 
1760
22      435
 
1761
23      34
 
1762
24      45
 
1763
25      4565
 
1764
26      4
 
1765
27      3
 
1766
28      2
 
1767
29      3
 
1768
30      15
 
1769
31      6
 
1770
32      8
 
1771
33      9
 
1772
34      745
 
1773
35      34
 
1774
36      34
 
1775
37      324
 
1776
38      67
 
1777
39      78
 
1778
40      89
 
1779
41      90
 
1780
42      78967
 
1781
50      56
 
1782
51      34
 
1783
55      123
3388
1784
---------------------------
3389
1785
---- some alter table begin
3390
1786
---------------------------
3391
 
alter table t11
3392
 
reorganize partition p0,p1 into
3393
 
(partition s1 values less than maxvalue);
3394
 
select * from t11 order by col1;
3395
 
col1
3396
 
15.0000
3397
 
19.0000
3398
 
alter table t11
3399
 
reorganize partition s1 into
3400
 
(partition p0 values less than (15),
3401
 
partition p1 values less than maxvalue);
3402
 
select * from t11 order by col1;
3403
 
col1
3404
 
15.0000
3405
 
19.0000
3406
1787
alter table t55
3407
 
partition by list(colint)
3408
 
subpartition by hash(cast(mod(col1,10) as signed)) subpartitions 5 
3409
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
3410
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3411
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3412
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3413
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3414
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
1788
partition by list(colint) 
 
1789
subpartition by hash(mod(col1,10)) subpartitions 4 
 
1790
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
1791
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
3415
1792
);
3416
1793
show create table t55;
3417
1794
Table   Create Table
3418
1795
t55     CREATE TABLE `t55` (
3419
1796
  `colint` int(11) DEFAULT NULL,
3420
 
  `col1` float(7,4) DEFAULT NULL
3421
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (cast(mod(col1,10) as signed)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
1797
  `col1` int(11) DEFAULT NULL
 
1798
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (mod(col1,10)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
3422
1799
select * from t55 order by colint;
3423
1800
colint  col1
3424
 
1       5.1230
3425
 
2       13.3450
3426
 
3       17.9870
3427
 
4       15.6540
3428
 
alter table t66
3429
 
reorganize partition p0,p1 into
3430
 
(partition s1 values less than maxvalue);
3431
 
select * from t66 order by colint;
3432
 
colint  col1
3433
 
1       5.1230
3434
 
2       13.3450
3435
 
3       17.9870
3436
 
4       15.6540
3437
 
alter table t66
3438
 
reorganize partition s1 into
3439
 
(partition p0 values less than (cast(mod(15,10) as signed)),
3440
 
partition p1 values less than maxvalue);
3441
 
select * from t66 order by colint;
3442
 
colint  col1
3443
 
1       5.1230
3444
 
2       13.3450
3445
 
3       17.9870
3446
 
4       15.6540
3447
 
alter table t66
3448
 
reorganize partition p0,p1 into
3449
 
(partition s1 values less than maxvalue);
3450
 
select * from t66 order by colint;
3451
 
colint  col1
3452
 
1       5.1230
3453
 
2       13.3450
3454
 
3       17.9870
3455
 
4       15.6540
3456
 
alter table t66
3457
 
reorganize partition s1 into
3458
 
(partition p0 values less than (cast(mod(15,10) as signed)),
3459
 
partition p1 values less than maxvalue);
3460
 
select * from t66 order by colint;
3461
 
colint  col1
3462
 
1       5.1230
3463
 
2       13.3450
3464
 
3       17.9870
3465
 
4       15.6540
 
1801
1       15
 
1802
2       13
 
1803
3       15
 
1804
4       17
 
1805
5       23
 
1806
6       34
 
1807
7       56
 
1808
8       56
 
1809
9       45
 
1810
10      34
 
1811
11      78
 
1812
12      89
 
1813
13      67
 
1814
14      46
 
1815
15      34
 
1816
16      324
 
1817
17      345
 
1818
18      34
 
1819
19      78
 
1820
20      567
 
1821
21      4
 
1822
22      435
 
1823
23      34
 
1824
24      45
 
1825
25      4565
 
1826
26      4
 
1827
27      3
 
1828
28      2
 
1829
29      3
 
1830
30      15
 
1831
31      6
 
1832
32      8
 
1833
33      9
 
1834
34      745
 
1835
35      34
 
1836
36      34
 
1837
37      324
 
1838
38      67
 
1839
39      78
 
1840
40      89
 
1841
41      90
 
1842
42      78967
 
1843
50      56
 
1844
51      34
 
1845
55      123
3466
1846
-------------------------------------------------------------------------
3467
 
---  Delete rows and partitions of tables with cast(mod(col1,10) as signed)
 
1847
---  Delete rows and partitions of tables with mod(col1,10)
3468
1848
-------------------------------------------------------------------------
3469
1849
delete from t1 where col1=19;
3470
1850
delete from t2 where col1=19;
3474
1854
delete from t6 where col1=19;
3475
1855
select * from t1 order by col1;
3476
1856
col1
3477
 
15.0000
 
1857
15
3478
1858
select * from t2 order by col1;
3479
1859
col1
3480
 
15.0000
3481
 
17.0000
 
1860
15
 
1861
17
3482
1862
select * from t3 order by col1;
3483
1863
col1
3484
 
15.0000
3485
 
17.0000
 
1864
15
 
1865
17
3486
1866
select * from t4 order by colint;
3487
1867
colint  col1
3488
 
1       5.1230
3489
 
2       13.3450
3490
 
3       17.9870
3491
 
4       15.6540
 
1868
1       15
 
1869
2       13
 
1870
3       15
 
1871
4       17
 
1872
5       23
 
1873
6       34
 
1874
7       56
 
1875
8       56
 
1876
9       45
 
1877
10      34
 
1878
11      78
 
1879
12      89
 
1880
13      67
 
1881
14      46
 
1882
15      34
 
1883
16      324
 
1884
17      345
 
1885
18      34
 
1886
19      78
 
1887
20      567
 
1888
21      4
 
1889
22      435
 
1890
23      34
 
1891
24      45
 
1892
25      4565
 
1893
26      4
 
1894
27      3
 
1895
28      2
 
1896
29      3
 
1897
30      15
 
1898
31      6
 
1899
32      8
 
1900
33      9
 
1901
34      745
 
1902
35      34
 
1903
36      34
 
1904
37      324
 
1905
38      67
 
1906
39      78
 
1907
40      89
 
1908
41      90
 
1909
42      78967
 
1910
50      56
 
1911
51      34
 
1912
55      123
3492
1913
select * from t5 order by colint;
3493
1914
colint  col1
3494
 
1       5.1230
3495
 
2       13.3450
3496
 
3       17.9870
3497
 
4       15.6540
 
1915
1       15
 
1916
2       13
 
1917
3       15
 
1918
4       17
 
1919
5       23
 
1920
6       34
 
1921
7       56
 
1922
8       56
 
1923
9       45
 
1924
10      34
 
1925
11      78
 
1926
12      89
 
1927
13      67
 
1928
14      46
 
1929
15      34
 
1930
16      324
 
1931
17      345
 
1932
18      34
 
1933
19      78
 
1934
20      567
 
1935
21      4
 
1936
22      435
 
1937
23      34
 
1938
24      45
 
1939
25      4565
 
1940
26      4
 
1941
27      3
 
1942
28      2
 
1943
29      3
 
1944
30      15
 
1945
31      6
 
1946
32      8
 
1947
33      9
 
1948
34      745
 
1949
35      34
 
1950
36      34
 
1951
37      324
 
1952
38      67
 
1953
39      78
 
1954
40      89
 
1955
41      90
 
1956
42      78967
 
1957
50      56
 
1958
51      34
 
1959
55      123
3498
1960
insert into t1 values (19);
3499
1961
insert into t2 values (19);
3500
1962
insert into t3 values (19);
3503
1965
insert into t6 values (60,19);
3504
1966
select * from t1 order by col1;
3505
1967
col1
3506
 
15.0000
3507
 
19.0000
3508
 
select * from t2 order by col1;
3509
 
col1
3510
 
15.0000
3511
 
17.0000
3512
 
19.0000
3513
 
select * from t3 order by col1;
3514
 
col1
3515
 
15.0000
3516
 
17.0000
3517
 
19.0000
3518
 
select * from t4 order by colint;
3519
 
colint  col1
3520
 
1       5.1230
3521
 
2       13.3450
3522
 
3       17.9870
3523
 
4       15.6540
3524
 
60      19.0000
3525
 
select * from t5 order by colint;
3526
 
colint  col1
3527
 
1       5.1230
3528
 
2       13.3450
3529
 
3       17.9870
3530
 
4       15.6540
3531
 
60      19.0000
3532
 
select * from t6 order by colint;
3533
 
colint  col1
3534
 
1       5.1230
3535
 
2       13.3450
3536
 
3       17.9870
3537
 
4       15.6540
3538
 
60      19.0000
3539
 
alter table t1 drop partition p0;
3540
 
alter table t2 drop partition p0;
3541
 
alter table t4 drop partition p0;
3542
 
alter table t5 drop partition p0;
3543
 
alter table t6 drop partition p0;
3544
 
select * from t1 order by col1;
3545
 
col1
3546
 
select * from t2 order by col1;
3547
 
col1
3548
 
select * from t3 order by col1;
3549
 
col1
3550
 
15.0000
3551
 
17.0000
3552
 
19.0000
3553
 
select * from t4 order by colint;
3554
 
colint  col1
3555
 
60      19.0000
3556
 
select * from t5 order by colint;
3557
 
colint  col1
3558
 
60      19.0000
3559
 
select * from t6 order by colint;
3560
 
colint  col1
3561
 
60      19.0000
 
1968
15
 
1969
19
 
1970
select * from t2 order by col1;
 
1971
col1
 
1972
15
 
1973
17
 
1974
19
 
1975
select * from t3 order by col1;
 
1976
col1
 
1977
15
 
1978
17
 
1979
19
 
1980
select * from t4 order by colint;
 
1981
colint  col1
 
1982
1       15
 
1983
2       13
 
1984
3       15
 
1985
4       17
 
1986
5       23
 
1987
6       34
 
1988
7       56
 
1989
8       56
 
1990
9       45
 
1991
10      34
 
1992
11      78
 
1993
12      89
 
1994
13      67
 
1995
14      46
 
1996
15      34
 
1997
16      324
 
1998
17      345
 
1999
18      34
 
2000
19      78
 
2001
20      567
 
2002
21      4
 
2003
22      435
 
2004
23      34
 
2005
24      45
 
2006
25      4565
 
2007
26      4
 
2008
27      3
 
2009
28      2
 
2010
29      3
 
2011
30      15
 
2012
31      6
 
2013
32      8
 
2014
33      9
 
2015
34      745
 
2016
35      34
 
2017
36      34
 
2018
37      324
 
2019
38      67
 
2020
39      78
 
2021
40      89
 
2022
41      90
 
2023
42      78967
 
2024
50      56
 
2025
51      34
 
2026
55      123
 
2027
60      19
 
2028
select * from t5 order by colint;
 
2029
colint  col1
 
2030
1       15
 
2031
2       13
 
2032
3       15
 
2033
4       17
 
2034
5       23
 
2035
6       34
 
2036
7       56
 
2037
8       56
 
2038
9       45
 
2039
10      34
 
2040
11      78
 
2041
12      89
 
2042
13      67
 
2043
14      46
 
2044
15      34
 
2045
16      324
 
2046
17      345
 
2047
18      34
 
2048
19      78
 
2049
20      567
 
2050
21      4
 
2051
22      435
 
2052
23      34
 
2053
24      45
 
2054
25      4565
 
2055
26      4
 
2056
27      3
 
2057
28      2
 
2058
29      3
 
2059
30      15
 
2060
31      6
 
2061
32      8
 
2062
33      9
 
2063
34      745
 
2064
35      34
 
2065
36      34
 
2066
37      324
 
2067
38      67
 
2068
39      78
 
2069
40      89
 
2070
41      90
 
2071
42      78967
 
2072
50      56
 
2073
51      34
 
2074
55      123
 
2075
60      19
 
2076
select * from t6 order by colint;
 
2077
colint  col1
 
2078
1       15
 
2079
2       13
 
2080
3       15
 
2081
4       17
 
2082
5       23
 
2083
6       34
 
2084
7       56
 
2085
8       56
 
2086
9       45
 
2087
10      34
 
2088
11      78
 
2089
12      89
 
2090
13      67
 
2091
14      46
 
2092
15      34
 
2093
16      324
 
2094
17      345
 
2095
18      34
 
2096
19      78
 
2097
20      567
 
2098
21      4
 
2099
22      435
 
2100
23      34
 
2101
24      45
 
2102
25      4565
 
2103
26      4
 
2104
27      3
 
2105
28      2
 
2106
29      3
 
2107
30      15
 
2108
31      6
 
2109
32      8
 
2110
33      9
 
2111
34      745
 
2112
35      34
 
2113
36      34
 
2114
37      324
 
2115
38      67
 
2116
39      78
 
2117
40      89
 
2118
41      90
 
2119
42      78967
 
2120
50      56
 
2121
51      34
 
2122
55      123
 
2123
60      19
3562
2124
-------------------------------------------------------------------------
3563
 
---  Delete rows and partitions of tables with cast(mod(col1,10) as signed)
 
2125
---  Delete rows and partitions of tables with mod(col1,10)
3564
2126
-------------------------------------------------------------------------
3565
2127
delete from t11 where col1=19;
3566
2128
delete from t22 where col1=19;
3570
2132
delete from t66 where col1=19;
3571
2133
select * from t11 order by col1;
3572
2134
col1
3573
 
15.0000
 
2135
15
3574
2136
select * from t22 order by col1;
3575
2137
col1
3576
 
15.0000
3577
 
17.0000
 
2138
15
 
2139
17
3578
2140
select * from t33 order by col1;
3579
2141
col1
3580
 
15.0000
3581
 
17.0000
 
2142
15
 
2143
17
3582
2144
select * from t44 order by colint;
3583
2145
colint  col1
3584
 
1       5.1230
3585
 
2       13.3450
3586
 
3       17.9870
3587
 
4       15.6540
 
2146
1       15
 
2147
2       13
 
2148
3       15
 
2149
4       17
 
2150
5       23
 
2151
6       34
 
2152
7       56
 
2153
8       56
 
2154
9       45
 
2155
10      34
 
2156
11      78
 
2157
12      89
 
2158
13      67
 
2159
14      46
 
2160
15      34
 
2161
16      324
 
2162
17      345
 
2163
18      34
 
2164
19      78
 
2165
20      567
 
2166
21      4
 
2167
22      435
 
2168
23      34
 
2169
24      45
 
2170
25      4565
 
2171
26      4
 
2172
27      3
 
2173
28      2
 
2174
29      3
 
2175
30      15
 
2176
31      6
 
2177
32      8
 
2178
33      9
 
2179
34      745
 
2180
35      34
 
2181
36      34
 
2182
37      324
 
2183
38      67
 
2184
39      78
 
2185
40      89
 
2186
41      90
 
2187
42      78967
 
2188
50      56
 
2189
51      34
 
2190
55      123
3588
2191
select * from t55 order by colint;
3589
2192
colint  col1
3590
 
1       5.1230
3591
 
2       13.3450
3592
 
3       17.9870
3593
 
4       15.6540
 
2193
1       15
 
2194
2       13
 
2195
3       15
 
2196
4       17
 
2197
5       23
 
2198
6       34
 
2199
7       56
 
2200
8       56
 
2201
9       45
 
2202
10      34
 
2203
11      78
 
2204
12      89
 
2205
13      67
 
2206
14      46
 
2207
15      34
 
2208
16      324
 
2209
17      345
 
2210
18      34
 
2211
19      78
 
2212
20      567
 
2213
21      4
 
2214
22      435
 
2215
23      34
 
2216
24      45
 
2217
25      4565
 
2218
26      4
 
2219
27      3
 
2220
28      2
 
2221
29      3
 
2222
30      15
 
2223
31      6
 
2224
32      8
 
2225
33      9
 
2226
34      745
 
2227
35      34
 
2228
36      34
 
2229
37      324
 
2230
38      67
 
2231
39      78
 
2232
40      89
 
2233
41      90
 
2234
42      78967
 
2235
50      56
 
2236
51      34
 
2237
55      123
3594
2238
insert into t11 values (19);
3595
2239
insert into t22 values (19);
3596
2240
insert into t33 values (19);
3599
2243
insert into t66 values (60,19);
3600
2244
select * from t11 order by col1;
3601
2245
col1
3602
 
15.0000
3603
 
19.0000
3604
 
select * from t22 order by col1;
3605
 
col1
3606
 
15.0000
3607
 
17.0000
3608
 
19.0000
3609
 
select * from t33 order by col1;
3610
 
col1
3611
 
15.0000
3612
 
17.0000
3613
 
19.0000
3614
 
select * from t44 order by colint;
3615
 
colint  col1
3616
 
1       5.1230
3617
 
2       13.3450
3618
 
3       17.9870
3619
 
4       15.6540
3620
 
60      19.0000
3621
 
select * from t55 order by colint;
3622
 
colint  col1
3623
 
1       5.1230
3624
 
2       13.3450
3625
 
3       17.9870
3626
 
4       15.6540
3627
 
60      19.0000
3628
 
select * from t66 order by colint;
3629
 
colint  col1
3630
 
1       5.1230
3631
 
2       13.3450
3632
 
3       17.9870
3633
 
4       15.6540
3634
 
60      19.0000
3635
 
alter table t11 drop partition p0;
3636
 
alter table t22 drop partition p0;
3637
 
alter table t44 drop partition p0;
3638
 
alter table t55 drop partition p0;
3639
 
alter table t66 drop partition p0;
3640
 
select * from t11 order by col1;
3641
 
col1
3642
 
select * from t22 order by col1;
3643
 
col1
3644
 
select * from t33 order by col1;
3645
 
col1
3646
 
15.0000
3647
 
17.0000
3648
 
19.0000
3649
 
select * from t44 order by colint;
3650
 
colint  col1
3651
 
60      19.0000
3652
 
select * from t55 order by colint;
3653
 
colint  col1
3654
 
60      19.0000
3655
 
select * from t66 order by colint;
3656
 
colint  col1
3657
 
60      19.0000
3658
 
-------------------------
3659
 
---- some alter table end
3660
 
-------------------------
3661
 
drop table if exists t1 ;
3662
 
drop table if exists t2 ;
3663
 
drop table if exists t3 ;
3664
 
drop table if exists t4 ;
3665
 
drop table if exists t5 ;
3666
 
drop table if exists t6 ;
3667
 
drop table if exists t11 ;
3668
 
drop table if exists t22 ;
3669
 
drop table if exists t33 ;
3670
 
drop table if exists t44 ;
3671
 
drop table if exists t55 ;
3672
 
drop table if exists t66 ;
3673
 
-------------------------------------------------------------------------
3674
 
---  ord(col1)  in partition with coltype  char(3)
3675
 
-------------------------------------------------------------------------
3676
 
drop table if exists t1 ;
3677
 
drop table if exists t2 ;
3678
 
drop table if exists t3 ;
3679
 
drop table if exists t4 ;
3680
 
drop table if exists t5 ;
3681
 
drop table if exists t6 ;
3682
 
-------------------------------------------------------------------------
3683
 
---  Create tables with ord(col1)
3684
 
-------------------------------------------------------------------------
3685
 
create table t1 (col1 char(3)) engine='NDB' 
3686
 
partition by range(ord(col1)) 
3687
 
(partition p0 values less than (15),
3688
 
partition p1 values less than maxvalue);
3689
 
create table t2 (col1 char(3)) engine='NDB' 
3690
 
partition by list(ord(col1)) 
3691
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
3692
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3693
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3694
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3695
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3696
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3697
 
);
3698
 
create table t3 (col1 char(3)) engine='NDB' 
3699
 
partition by hash(ord(col1));
3700
 
create table t4 (colint int, col1 char(3)) engine='NDB' 
3701
 
partition by range(colint) 
3702
 
subpartition by hash(ord(col1)) subpartitions 2 
3703
 
(partition p0 values less than (15),
3704
 
partition p1 values less than maxvalue);
3705
 
create table t5 (colint int, col1 char(3)) engine='NDB' 
3706
 
partition by list(colint)
3707
 
subpartition by hash(ord(col1)) subpartitions 2 
3708
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
3709
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3710
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3711
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3712
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3713
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3714
 
);
3715
 
create table t6 (colint int, col1 char(3)) engine='NDB' 
3716
 
partition by range(colint) 
3717
 
(partition p0 values less than (ord('a')),
3718
 
partition p1 values less than maxvalue);
3719
 
-------------------------------------------------------------------------
3720
 
---  Access tables with ord(col1) 
3721
 
-------------------------------------------------------------------------
3722
 
insert into t1 values ('1');
3723
 
insert into t1 values ('9');
3724
 
insert into t2 values ('1');
3725
 
insert into t2 values ('9');
3726
 
insert into t2 values ('3');
3727
 
insert into t3 values ('1');
3728
 
insert into t3 values ('9');
3729
 
insert into t3 values ('3');
3730
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t4;
3731
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t5;
3732
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_ch1.in' into table t6;
3733
 
select ord(col1) from t1 order by col1;
3734
 
ord(col1)
3735
 
49
3736
 
57
3737
 
select * from t1 order by col1;
3738
 
col1
3739
 
1
3740
 
9
3741
 
select * from t2 order by col1;
3742
 
col1
3743
 
1
3744
 
3
3745
 
9
3746
 
select * from t3 order by col1;
3747
 
col1
3748
 
1
3749
 
3
3750
 
9
3751
 
select * from t4 order by colint;
3752
 
colint  col1
3753
 
1       1
3754
 
2       9
3755
 
3       3
3756
 
4       8
3757
 
select * from t5 order by colint;
3758
 
colint  col1
3759
 
1       1
3760
 
2       9
3761
 
3       3
3762
 
4       8
3763
 
select * from t6 order by colint;
3764
 
colint  col1
3765
 
1       1
3766
 
2       9
3767
 
3       3
3768
 
4       8
3769
 
update t1 set col1='8' where col1='1';
3770
 
update t2 set col1='8' where col1='1';
3771
 
update t3 set col1='8' where col1='1';
3772
 
update t4 set col1='8' where col1='1';
3773
 
update t5 set col1='8' where col1='1';
3774
 
update t6 set col1='8' where col1='1';
3775
 
select * from t1 order by col1;
3776
 
col1
3777
 
8
3778
 
9
3779
 
select * from t2 order by col1;
3780
 
col1
3781
 
3
3782
 
8
3783
 
9
3784
 
select * from t3 order by col1;
3785
 
col1
3786
 
3
3787
 
8
3788
 
9
3789
 
select * from t4 order by colint;
3790
 
colint  col1
3791
 
1       8
3792
 
2       9
3793
 
3       3
3794
 
4       8
3795
 
select * from t5 order by colint;
3796
 
colint  col1
3797
 
1       8
3798
 
2       9
3799
 
3       3
3800
 
4       8
3801
 
select * from t6 order by colint;
3802
 
colint  col1
3803
 
1       8
3804
 
2       9
3805
 
3       3
3806
 
4       8
3807
 
-------------------------------------------------------------------------
3808
 
---  Alter tables with ord(col1)
3809
 
-------------------------------------------------------------------------
3810
 
drop table if exists t11 ;
3811
 
drop table if exists t22 ;
3812
 
drop table if exists t33 ;
3813
 
drop table if exists t44 ;
3814
 
drop table if exists t55 ;
3815
 
drop table if exists t66 ;
3816
 
create table t11 engine='NDB' as select * from t1;
3817
 
create table t22 engine='NDB' as select * from t2;
3818
 
create table t33 engine='NDB' as select * from t3;
3819
 
create table t44 engine='NDB' as select * from t4;
3820
 
create table t55 engine='NDB' as select * from t5;
3821
 
create table t66 engine='NDB' as select * from t6;
3822
 
alter table t11
3823
 
partition by range(ord(col1)) 
3824
 
(partition p0 values less than (15),
3825
 
partition p1 values less than maxvalue);
3826
 
alter table t22
3827
 
partition by list(ord(col1)) 
3828
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
3829
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3830
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3831
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3832
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3833
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3834
 
);
3835
 
alter table t33
3836
 
partition by hash(ord(col1));
3837
 
alter table t44
3838
 
partition by range(colint) 
3839
 
subpartition by hash(ord(col1)) subpartitions 2 
3840
 
(partition p0 values less than (15),
3841
 
partition p1 values less than maxvalue);
3842
 
alter table t55
3843
 
partition by list(colint)
3844
 
subpartition by hash(ord(col1)) subpartitions 2 
3845
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
3846
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3847
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3848
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3849
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3850
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3851
 
);
3852
 
alter table t66
3853
 
partition by range(colint) 
3854
 
(partition p0 values less than (ord('a')),
3855
 
partition p1 values less than maxvalue);
3856
 
select * from t11 order by col1;
3857
 
col1
3858
 
8
3859
 
9
3860
 
select * from t22 order by col1;
3861
 
col1
3862
 
3
3863
 
8
3864
 
9
3865
 
select * from t33 order by col1;
3866
 
col1
3867
 
3
3868
 
8
3869
 
9
3870
 
select * from t44 order by colint;
3871
 
colint  col1
3872
 
1       8
3873
 
2       9
3874
 
3       3
3875
 
4       8
3876
 
select * from t55 order by colint;
3877
 
colint  col1
3878
 
1       8
3879
 
2       9
3880
 
3       3
3881
 
4       8
3882
 
select * from t66 order by colint;
3883
 
colint  col1
3884
 
1       8
3885
 
2       9
3886
 
3       3
3887
 
4       8
3888
 
---------------------------
3889
 
---- some alter table begin
3890
 
---------------------------
3891
 
alter table t11
3892
 
reorganize partition p0,p1 into
3893
 
(partition s1 values less than maxvalue);
3894
 
select * from t11 order by col1;
3895
 
col1
3896
 
8
3897
 
9
3898
 
alter table t11
3899
 
reorganize partition s1 into
3900
 
(partition p0 values less than (15),
3901
 
partition p1 values less than maxvalue);
3902
 
select * from t11 order by col1;
3903
 
col1
3904
 
8
3905
 
9
3906
 
alter table t55
3907
 
partition by list(colint)
3908
 
subpartition by hash(ord(col1)) subpartitions 5 
3909
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
3910
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
3911
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
3912
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
3913
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
3914
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
3915
 
);
3916
 
show create table t55;
3917
 
Table   Create Table
3918
 
t55     CREATE TABLE `t55` (
3919
 
  `colint` int(11) DEFAULT NULL,
3920
 
  `col1` char(3) DEFAULT NULL
3921
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (ord(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
3922
 
select * from t55 order by colint;
3923
 
colint  col1
3924
 
1       8
3925
 
2       9
3926
 
3       3
3927
 
4       8
3928
 
alter table t66
3929
 
reorganize partition p0,p1 into
3930
 
(partition s1 values less than maxvalue);
3931
 
select * from t66 order by colint;
3932
 
colint  col1
3933
 
1       8
3934
 
2       9
3935
 
3       3
3936
 
4       8
3937
 
alter table t66
3938
 
reorganize partition s1 into
3939
 
(partition p0 values less than (ord('a')),
3940
 
partition p1 values less than maxvalue);
3941
 
select * from t66 order by colint;
3942
 
colint  col1
3943
 
1       8
3944
 
2       9
3945
 
3       3
3946
 
4       8
3947
 
alter table t66
3948
 
reorganize partition p0,p1 into
3949
 
(partition s1 values less than maxvalue);
3950
 
select * from t66 order by colint;
3951
 
colint  col1
3952
 
1       8
3953
 
2       9
3954
 
3       3
3955
 
4       8
3956
 
alter table t66
3957
 
reorganize partition s1 into
3958
 
(partition p0 values less than (ord('a')),
3959
 
partition p1 values less than maxvalue);
3960
 
select * from t66 order by colint;
3961
 
colint  col1
3962
 
1       8
3963
 
2       9
3964
 
3       3
3965
 
4       8
3966
 
-------------------------------------------------------------------------
3967
 
---  Delete rows and partitions of tables with ord(col1)
3968
 
-------------------------------------------------------------------------
3969
 
delete from t1 where col1='9';
3970
 
delete from t2 where col1='9';
3971
 
delete from t3 where col1='9';
3972
 
delete from t4 where col1='9';
3973
 
delete from t5 where col1='9';
3974
 
delete from t6 where col1='9';
3975
 
select * from t1 order by col1;
3976
 
col1
3977
 
8
3978
 
select * from t2 order by col1;
3979
 
col1
3980
 
3
3981
 
8
3982
 
select * from t3 order by col1;
3983
 
col1
3984
 
3
3985
 
8
3986
 
select * from t4 order by colint;
3987
 
colint  col1
3988
 
1       8
3989
 
3       3
3990
 
4       8
3991
 
select * from t5 order by colint;
3992
 
colint  col1
3993
 
1       8
3994
 
3       3
3995
 
4       8
3996
 
insert into t1 values ('9');
3997
 
insert into t2 values ('9');
3998
 
insert into t3 values ('9');
3999
 
insert into t4 values (60,'9');
4000
 
insert into t5 values (60,'9');
4001
 
insert into t6 values (60,'9');
4002
 
select * from t1 order by col1;
4003
 
col1
4004
 
8
4005
 
9
4006
 
select * from t2 order by col1;
4007
 
col1
4008
 
3
4009
 
8
4010
 
9
4011
 
select * from t3 order by col1;
4012
 
col1
4013
 
3
4014
 
8
4015
 
9
4016
 
select * from t4 order by colint;
4017
 
colint  col1
4018
 
1       8
4019
 
3       3
4020
 
4       8
4021
 
60      9
4022
 
select * from t5 order by colint;
4023
 
colint  col1
4024
 
1       8
4025
 
3       3
4026
 
4       8
4027
 
60      9
4028
 
select * from t6 order by colint;
4029
 
colint  col1
4030
 
1       8
4031
 
3       3
4032
 
4       8
4033
 
60      9
4034
 
alter table t1 drop partition p0;
4035
 
alter table t2 drop partition p0;
4036
 
alter table t4 drop partition p0;
4037
 
alter table t5 drop partition p0;
4038
 
alter table t6 drop partition p0;
4039
 
select * from t1 order by col1;
4040
 
col1
4041
 
8
4042
 
9
4043
 
select * from t2 order by col1;
4044
 
col1
4045
 
3
4046
 
8
4047
 
9
4048
 
select * from t3 order by col1;
4049
 
col1
4050
 
3
4051
 
8
4052
 
9
4053
 
select * from t4 order by colint;
4054
 
colint  col1
4055
 
60      9
4056
 
select * from t5 order by colint;
4057
 
colint  col1
4058
 
60      9
4059
 
select * from t6 order by colint;
4060
 
colint  col1
4061
 
-------------------------------------------------------------------------
4062
 
---  Delete rows and partitions of tables with ord(col1)
4063
 
-------------------------------------------------------------------------
4064
 
delete from t11 where col1='9';
4065
 
delete from t22 where col1='9';
4066
 
delete from t33 where col1='9';
4067
 
delete from t44 where col1='9';
4068
 
delete from t55 where col1='9';
4069
 
delete from t66 where col1='9';
4070
 
select * from t11 order by col1;
4071
 
col1
4072
 
8
4073
 
select * from t22 order by col1;
4074
 
col1
4075
 
3
4076
 
8
4077
 
select * from t33 order by col1;
4078
 
col1
4079
 
3
4080
 
8
4081
 
select * from t44 order by colint;
4082
 
colint  col1
4083
 
1       8
4084
 
3       3
4085
 
4       8
4086
 
select * from t55 order by colint;
4087
 
colint  col1
4088
 
1       8
4089
 
3       3
4090
 
4       8
4091
 
insert into t11 values ('9');
4092
 
insert into t22 values ('9');
4093
 
insert into t33 values ('9');
4094
 
insert into t44 values (60,'9');
4095
 
insert into t55 values (60,'9');
4096
 
insert into t66 values (60,'9');
4097
 
select * from t11 order by col1;
4098
 
col1
4099
 
8
4100
 
9
4101
 
select * from t22 order by col1;
4102
 
col1
4103
 
3
4104
 
8
4105
 
9
4106
 
select * from t33 order by col1;
4107
 
col1
4108
 
3
4109
 
8
4110
 
9
4111
 
select * from t44 order by colint;
4112
 
colint  col1
4113
 
1       8
4114
 
3       3
4115
 
4       8
4116
 
60      9
4117
 
select * from t55 order by colint;
4118
 
colint  col1
4119
 
1       8
4120
 
3       3
4121
 
4       8
4122
 
60      9
4123
 
select * from t66 order by colint;
4124
 
colint  col1
4125
 
1       8
4126
 
3       3
4127
 
4       8
4128
 
60      9
4129
 
alter table t11 drop partition p0;
4130
 
alter table t22 drop partition p0;
4131
 
alter table t44 drop partition p0;
4132
 
alter table t55 drop partition p0;
4133
 
alter table t66 drop partition p0;
4134
 
select * from t11 order by col1;
4135
 
col1
4136
 
8
4137
 
9
4138
 
select * from t22 order by col1;
4139
 
col1
4140
 
3
4141
 
8
4142
 
9
4143
 
select * from t33 order by col1;
4144
 
col1
4145
 
3
4146
 
8
4147
 
9
4148
 
select * from t44 order by colint;
4149
 
colint  col1
4150
 
60      9
4151
 
select * from t55 order by colint;
4152
 
colint  col1
4153
 
60      9
4154
 
select * from t66 order by colint;
4155
 
colint  col1
 
2246
15
 
2247
19
 
2248
select * from t22 order by col1;
 
2249
col1
 
2250
15
 
2251
17
 
2252
19
 
2253
select * from t33 order by col1;
 
2254
col1
 
2255
15
 
2256
17
 
2257
19
 
2258
select * from t44 order by colint;
 
2259
colint  col1
 
2260
1       15
 
2261
2       13
 
2262
3       15
 
2263
4       17
 
2264
5       23
 
2265
6       34
 
2266
7       56
 
2267
8       56
 
2268
9       45
 
2269
10      34
 
2270
11      78
 
2271
12      89
 
2272
13      67
 
2273
14      46
 
2274
15      34
 
2275
16      324
 
2276
17      345
 
2277
18      34
 
2278
19      78
 
2279
20      567
 
2280
21      4
 
2281
22      435
 
2282
23      34
 
2283
24      45
 
2284
25      4565
 
2285
26      4
 
2286
27      3
 
2287
28      2
 
2288
29      3
 
2289
30      15
 
2290
31      6
 
2291
32      8
 
2292
33      9
 
2293
34      745
 
2294
35      34
 
2295
36      34
 
2296
37      324
 
2297
38      67
 
2298
39      78
 
2299
40      89
 
2300
41      90
 
2301
42      78967
 
2302
50      56
 
2303
51      34
 
2304
55      123
 
2305
60      19
 
2306
select * from t55 order by colint;
 
2307
colint  col1
 
2308
1       15
 
2309
2       13
 
2310
3       15
 
2311
4       17
 
2312
5       23
 
2313
6       34
 
2314
7       56
 
2315
8       56
 
2316
9       45
 
2317
10      34
 
2318
11      78
 
2319
12      89
 
2320
13      67
 
2321
14      46
 
2322
15      34
 
2323
16      324
 
2324
17      345
 
2325
18      34
 
2326
19      78
 
2327
20      567
 
2328
21      4
 
2329
22      435
 
2330
23      34
 
2331
24      45
 
2332
25      4565
 
2333
26      4
 
2334
27      3
 
2335
28      2
 
2336
29      3
 
2337
30      15
 
2338
31      6
 
2339
32      8
 
2340
33      9
 
2341
34      745
 
2342
35      34
 
2343
36      34
 
2344
37      324
 
2345
38      67
 
2346
39      78
 
2347
40      89
 
2348
41      90
 
2349
42      78967
 
2350
50      56
 
2351
51      34
 
2352
55      123
 
2353
60      19
 
2354
select * from t66 order by colint;
 
2355
colint  col1
 
2356
1       15
 
2357
2       13
 
2358
3       15
 
2359
4       17
 
2360
5       23
 
2361
6       34
 
2362
7       56
 
2363
8       56
 
2364
9       45
 
2365
10      34
 
2366
11      78
 
2367
12      89
 
2368
13      67
 
2369
14      46
 
2370
15      34
 
2371
16      324
 
2372
17      345
 
2373
18      34
 
2374
19      78
 
2375
20      567
 
2376
21      4
 
2377
22      435
 
2378
23      34
 
2379
24      45
 
2380
25      4565
 
2381
26      4
 
2382
27      3
 
2383
28      2
 
2384
29      3
 
2385
30      15
 
2386
31      6
 
2387
32      8
 
2388
33      9
 
2389
34      745
 
2390
35      34
 
2391
36      34
 
2392
37      324
 
2393
38      67
 
2394
39      78
 
2395
40      89
 
2396
41      90
 
2397
42      78967
 
2398
50      56
 
2399
51      34
 
2400
55      123
 
2401
60      19
4156
2402
-------------------------
4157
2403
---- some alter table end
4158
2404
-------------------------
4201
2447
(partition p0 values less than (15),
4202
2448
partition p1 values less than maxvalue);
4203
2449
create table t5 (colint int, col1 date) engine='NDB' 
4204
 
partition by list(colint)
 
2450
partition by list(colint) 
4205
2451
subpartition by hash(day(col1)) subpartitions 2 
4206
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
4207
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
4208
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
4209
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
4210
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
4211
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
2452
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
2453
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
2454
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
2455
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
4212
2456
);
4213
2457
create table t6 (colint int, col1 date) engine='NDB' 
4214
2458
partition by range(colint) 
4225
2469
insert into t3 values ('2006-02-03');
4226
2470
insert into t3 values ('2006-01-17');
4227
2471
insert into t3 values ('2006-01-25');
4228
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
4229
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
4230
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
2472
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
2473
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
2474
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
4231
2475
select day(col1) from t1 order by col1;
4232
2476
day(col1)
4233
2477
17
4338
2582
(partition p0 values less than (15),
4339
2583
partition p1 values less than maxvalue);
4340
2584
alter table t55
4341
 
partition by list(colint)
 
2585
partition by list(colint) 
4342
2586
subpartition by hash(day(col1)) subpartitions 2 
4343
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
4344
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
4345
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
4346
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
4347
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
4348
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
2587
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
2588
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
2589
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
2590
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
4349
2591
);
4350
2592
alter table t66
4351
2593
partition by range(colint) 
4386
2628
---------------------------
4387
2629
---- some alter table begin
4388
2630
---------------------------
4389
 
alter table t11
4390
 
reorganize partition p0,p1 into
4391
 
(partition s1 values less than maxvalue);
4392
 
select * from t11 order by col1;
4393
 
col1
4394
 
2006-01-17
4395
 
2006-02-05
4396
 
alter table t11
4397
 
reorganize partition s1 into
4398
 
(partition p0 values less than (15),
4399
 
partition p1 values less than maxvalue);
4400
 
select * from t11 order by col1;
4401
 
col1
4402
 
2006-01-17
4403
 
2006-02-05
4404
2631
alter table t55
4405
 
partition by list(colint)
4406
 
subpartition by hash(day(col1)) subpartitions 5 
4407
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
4408
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
4409
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
4410
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
4411
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
4412
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
2632
partition by list(colint) 
 
2633
subpartition by hash(day(col1)) subpartitions 4 
 
2634
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
2635
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
4413
2636
);
4414
2637
show create table t55;
4415
2638
Table   Create Table
4416
2639
t55     CREATE TABLE `t55` (
4417
2640
  `colint` int(11) DEFAULT NULL,
4418
2641
  `col1` date DEFAULT NULL
4419
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
2642
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (day(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
4420
2643
select * from t55 order by colint;
4421
2644
colint  col1
4422
2645
1       2006-02-05
4423
2646
2       2006-01-17
4424
2647
3       2006-01-25
4425
2648
4       2006-02-05
4426
 
alter table t66
4427
 
reorganize partition p0,p1 into
4428
 
(partition s1 values less than maxvalue);
4429
 
select * from t66 order by colint;
4430
 
colint  col1
4431
 
1       2006-02-05
4432
 
2       2006-01-17
4433
 
3       2006-01-25
4434
 
4       2006-02-05
4435
 
alter table t66
4436
 
reorganize partition s1 into
4437
 
(partition p0 values less than (day('2006-12-21')),
4438
 
partition p1 values less than maxvalue);
4439
 
select * from t66 order by colint;
4440
 
colint  col1
4441
 
1       2006-02-05
4442
 
2       2006-01-17
4443
 
3       2006-01-25
4444
 
4       2006-02-05
4445
 
alter table t66
4446
 
reorganize partition p0,p1 into
4447
 
(partition s1 values less than maxvalue);
4448
 
select * from t66 order by colint;
4449
 
colint  col1
4450
 
1       2006-02-05
4451
 
2       2006-01-17
4452
 
3       2006-01-25
4453
 
4       2006-02-05
4454
 
alter table t66
4455
 
reorganize partition s1 into
4456
 
(partition p0 values less than (day('2006-12-21')),
4457
 
partition p1 values less than maxvalue);
4458
 
select * from t66 order by colint;
4459
 
colint  col1
4460
 
1       2006-02-05
4461
 
2       2006-01-17
4462
 
3       2006-01-25
4463
 
4       2006-02-05
4464
2649
-------------------------------------------------------------------------
4465
2650
---  Delete rows and partitions of tables with day(col1)
4466
2651
-------------------------------------------------------------------------
4529
2714
3       2006-01-25
4530
2715
4       2006-02-05
4531
2716
60      2006-01-17
4532
 
alter table t1 drop partition p0;
4533
 
alter table t2 drop partition p0;
4534
 
alter table t4 drop partition p0;
4535
 
alter table t5 drop partition p0;
4536
 
alter table t6 drop partition p0;
4537
 
select * from t1 order by col1;
4538
 
col1
4539
 
2006-01-17
4540
 
select * from t2 order by col1;
4541
 
col1
4542
 
2006-01-17
4543
 
2006-01-25
4544
 
select * from t3 order by col1;
4545
 
col1
4546
 
2006-01-17
4547
 
2006-01-25
4548
 
2006-02-05
4549
 
select * from t4 order by colint;
4550
 
colint  col1
4551
 
60      2006-01-17
4552
 
select * from t5 order by colint;
4553
 
colint  col1
4554
 
60      2006-01-17
4555
 
select * from t6 order by colint;
4556
 
colint  col1
4557
 
60      2006-01-17
4558
2717
-------------------------------------------------------------------------
4559
2718
---  Delete rows and partitions of tables with day(col1)
4560
2719
-------------------------------------------------------------------------
4623
2782
3       2006-01-25
4624
2783
4       2006-02-05
4625
2784
60      2006-01-17
4626
 
alter table t11 drop partition p0;
4627
 
alter table t22 drop partition p0;
4628
 
alter table t44 drop partition p0;
4629
 
alter table t55 drop partition p0;
4630
 
alter table t66 drop partition p0;
4631
 
select * from t11 order by col1;
4632
 
col1
4633
 
2006-01-17
4634
 
select * from t22 order by col1;
4635
 
col1
4636
 
2006-01-17
4637
 
2006-01-25
4638
 
select * from t33 order by col1;
4639
 
col1
4640
 
2006-01-17
4641
 
2006-01-25
4642
 
2006-02-05
4643
 
select * from t44 order by colint;
4644
 
colint  col1
4645
 
60      2006-01-17
4646
 
select * from t55 order by colint;
4647
 
colint  col1
4648
 
60      2006-01-17
4649
 
select * from t66 order by colint;
4650
 
colint  col1
4651
 
60      2006-01-17
4652
2785
-------------------------
4653
2786
---- some alter table end
4654
2787
-------------------------
4697
2830
(partition p0 values less than (15),
4698
2831
partition p1 values less than maxvalue);
4699
2832
create table t5 (colint int, col1 date) engine='NDB' 
4700
 
partition by list(colint)
 
2833
partition by list(colint) 
4701
2834
subpartition by hash(dayofmonth(col1)) subpartitions 2 
4702
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
4703
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
4704
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
4705
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
4706
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
4707
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
2835
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
2836
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
2837
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
2838
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
4708
2839
);
4709
2840
create table t6 (colint int, col1 date) engine='NDB' 
4710
2841
partition by range(colint) 
4721
2852
insert into t3 values ('2006-02-03');
4722
2853
insert into t3 values ('2006-01-17');
4723
2854
insert into t3 values ('2006-01-25');
4724
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
4725
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
4726
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
2855
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
2856
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
2857
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
4727
2858
select dayofmonth(col1) from t1 order by col1;
4728
2859
dayofmonth(col1)
4729
2860
17
4834
2965
(partition p0 values less than (15),
4835
2966
partition p1 values less than maxvalue);
4836
2967
alter table t55
4837
 
partition by list(colint)
 
2968
partition by list(colint) 
4838
2969
subpartition by hash(dayofmonth(col1)) subpartitions 2 
4839
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
4840
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
4841
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
4842
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
4843
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
4844
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
2970
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
2971
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
2972
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
2973
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
4845
2974
);
4846
2975
alter table t66
4847
2976
partition by range(colint) 
4882
3011
---------------------------
4883
3012
---- some alter table begin
4884
3013
---------------------------
4885
 
alter table t11
4886
 
reorganize partition p0,p1 into
4887
 
(partition s1 values less than maxvalue);
4888
 
select * from t11 order by col1;
4889
 
col1
4890
 
2006-01-17
4891
 
2006-02-05
4892
 
alter table t11
4893
 
reorganize partition s1 into
4894
 
(partition p0 values less than (15),
4895
 
partition p1 values less than maxvalue);
4896
 
select * from t11 order by col1;
4897
 
col1
4898
 
2006-01-17
4899
 
2006-02-05
4900
3014
alter table t55
4901
 
partition by list(colint)
4902
 
subpartition by hash(dayofmonth(col1)) subpartitions 5 
4903
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
4904
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
4905
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
4906
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
4907
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
4908
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3015
partition by list(colint) 
 
3016
subpartition by hash(dayofmonth(col1)) subpartitions 4 
 
3017
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3018
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
4909
3019
);
4910
3020
show create table t55;
4911
3021
Table   Create Table
4912
3022
t55     CREATE TABLE `t55` (
4913
3023
  `colint` int(11) DEFAULT NULL,
4914
3024
  `col1` date DEFAULT NULL
4915
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
3025
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofmonth(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
4916
3026
select * from t55 order by colint;
4917
3027
colint  col1
4918
3028
1       2006-02-05
4919
3029
2       2006-01-17
4920
3030
3       2006-01-25
4921
3031
4       2006-02-05
4922
 
alter table t66
4923
 
reorganize partition p0,p1 into
4924
 
(partition s1 values less than maxvalue);
4925
 
select * from t66 order by colint;
4926
 
colint  col1
4927
 
1       2006-02-05
4928
 
2       2006-01-17
4929
 
3       2006-01-25
4930
 
4       2006-02-05
4931
 
alter table t66
4932
 
reorganize partition s1 into
4933
 
(partition p0 values less than (dayofmonth('2006-12-24')),
4934
 
partition p1 values less than maxvalue);
4935
 
select * from t66 order by colint;
4936
 
colint  col1
4937
 
1       2006-02-05
4938
 
2       2006-01-17
4939
 
3       2006-01-25
4940
 
4       2006-02-05
4941
 
alter table t66
4942
 
reorganize partition p0,p1 into
4943
 
(partition s1 values less than maxvalue);
4944
 
select * from t66 order by colint;
4945
 
colint  col1
4946
 
1       2006-02-05
4947
 
2       2006-01-17
4948
 
3       2006-01-25
4949
 
4       2006-02-05
4950
 
alter table t66
4951
 
reorganize partition s1 into
4952
 
(partition p0 values less than (dayofmonth('2006-12-24')),
4953
 
partition p1 values less than maxvalue);
4954
 
select * from t66 order by colint;
4955
 
colint  col1
4956
 
1       2006-02-05
4957
 
2       2006-01-17
4958
 
3       2006-01-25
4959
 
4       2006-02-05
4960
3032
-------------------------------------------------------------------------
4961
3033
---  Delete rows and partitions of tables with dayofmonth(col1)
4962
3034
-------------------------------------------------------------------------
5025
3097
3       2006-01-25
5026
3098
4       2006-02-05
5027
3099
60      2006-01-17
5028
 
alter table t1 drop partition p0;
5029
 
alter table t2 drop partition p0;
5030
 
alter table t4 drop partition p0;
5031
 
alter table t5 drop partition p0;
5032
 
alter table t6 drop partition p0;
5033
 
select * from t1 order by col1;
5034
 
col1
5035
 
2006-01-17
5036
 
select * from t2 order by col1;
5037
 
col1
5038
 
2006-01-17
5039
 
2006-01-25
5040
 
select * from t3 order by col1;
5041
 
col1
5042
 
2006-01-17
5043
 
2006-01-25
5044
 
2006-02-05
5045
 
select * from t4 order by colint;
5046
 
colint  col1
5047
 
60      2006-01-17
5048
 
select * from t5 order by colint;
5049
 
colint  col1
5050
 
60      2006-01-17
5051
 
select * from t6 order by colint;
5052
 
colint  col1
5053
 
60      2006-01-17
5054
3100
-------------------------------------------------------------------------
5055
3101
---  Delete rows and partitions of tables with dayofmonth(col1)
5056
3102
-------------------------------------------------------------------------
5119
3165
3       2006-01-25
5120
3166
4       2006-02-05
5121
3167
60      2006-01-17
5122
 
alter table t11 drop partition p0;
5123
 
alter table t22 drop partition p0;
5124
 
alter table t44 drop partition p0;
5125
 
alter table t55 drop partition p0;
5126
 
alter table t66 drop partition p0;
5127
 
select * from t11 order by col1;
5128
 
col1
5129
 
2006-01-17
5130
 
select * from t22 order by col1;
5131
 
col1
5132
 
2006-01-17
5133
 
2006-01-25
5134
 
select * from t33 order by col1;
5135
 
col1
5136
 
2006-01-17
5137
 
2006-01-25
5138
 
2006-02-05
5139
 
select * from t44 order by colint;
5140
 
colint  col1
5141
 
60      2006-01-17
5142
 
select * from t55 order by colint;
5143
 
colint  col1
5144
 
60      2006-01-17
5145
 
select * from t66 order by colint;
5146
 
colint  col1
5147
 
60      2006-01-17
5148
3168
-------------------------
5149
3169
---- some alter table end
5150
3170
-------------------------
5193
3213
(partition p0 values less than (15),
5194
3214
partition p1 values less than maxvalue);
5195
3215
create table t5 (colint int, col1 date) engine='NDB' 
5196
 
partition by list(colint)
 
3216
partition by list(colint) 
5197
3217
subpartition by hash(dayofweek(col1)) subpartitions 2 
5198
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
5199
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
5200
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
5201
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
5202
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
5203
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3218
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
3219
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3220
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
3221
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
5204
3222
);
5205
3223
create table t6 (colint int, col1 date) engine='NDB' 
5206
3224
partition by range(colint) 
5217
3235
insert into t3 values ('2006-01-03');
5218
3236
insert into t3 values ('2006-02-17');
5219
3237
insert into t3 values ('2006-01-25');
5220
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
5221
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
5222
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
3238
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
3239
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
3240
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
5223
3241
select dayofweek(col1) from t1 order by col1;
5224
3242
dayofweek(col1)
5225
3243
3
5330
3348
(partition p0 values less than (15),
5331
3349
partition p1 values less than maxvalue);
5332
3350
alter table t55
5333
 
partition by list(colint)
 
3351
partition by list(colint) 
5334
3352
subpartition by hash(dayofweek(col1)) subpartitions 2 
5335
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
5336
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
5337
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
5338
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
5339
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
5340
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3353
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
3354
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3355
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
3356
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
5341
3357
);
5342
3358
alter table t66
5343
3359
partition by range(colint) 
5378
3394
---------------------------
5379
3395
---- some alter table begin
5380
3396
---------------------------
5381
 
alter table t11
5382
 
reorganize partition p0,p1 into
5383
 
(partition s1 values less than maxvalue);
5384
 
select * from t11 order by col1;
5385
 
col1
5386
 
2006-02-05
5387
 
2006-02-17
5388
 
alter table t11
5389
 
reorganize partition s1 into
5390
 
(partition p0 values less than (15),
5391
 
partition p1 values less than maxvalue);
5392
 
select * from t11 order by col1;
5393
 
col1
5394
 
2006-02-05
5395
 
2006-02-17
5396
3397
alter table t55
5397
 
partition by list(colint)
5398
 
subpartition by hash(dayofweek(col1)) subpartitions 5 
5399
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
5400
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
5401
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
5402
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
5403
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
5404
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3398
partition by list(colint) 
 
3399
subpartition by hash(dayofweek(col1)) subpartitions 4 
 
3400
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3401
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
5405
3402
);
5406
3403
show create table t55;
5407
3404
Table   Create Table
5408
3405
t55     CREATE TABLE `t55` (
5409
3406
  `colint` int(11) DEFAULT NULL,
5410
3407
  `col1` date DEFAULT NULL
5411
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
3408
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofweek(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
5412
3409
select * from t55 order by colint;
5413
3410
colint  col1
5414
3411
1       2006-02-03
5415
3412
2       2006-01-17
5416
3413
3       2006-01-25
5417
3414
4       2006-02-05
5418
 
alter table t66
5419
 
reorganize partition p0,p1 into
5420
 
(partition s1 values less than maxvalue);
5421
 
select * from t66 order by colint;
5422
 
colint  col1
5423
 
1       2006-02-03
5424
 
2       2006-01-17
5425
 
3       2006-01-25
5426
 
4       2006-02-05
5427
 
alter table t66
5428
 
reorganize partition s1 into
5429
 
(partition p0 values less than (dayofweek('2006-12-24')),
5430
 
partition p1 values less than maxvalue);
5431
 
select * from t66 order by colint;
5432
 
colint  col1
5433
 
1       2006-02-03
5434
 
2       2006-01-17
5435
 
3       2006-01-25
5436
 
4       2006-02-05
5437
 
alter table t66
5438
 
reorganize partition p0,p1 into
5439
 
(partition s1 values less than maxvalue);
5440
 
select * from t66 order by colint;
5441
 
colint  col1
5442
 
1       2006-02-03
5443
 
2       2006-01-17
5444
 
3       2006-01-25
5445
 
4       2006-02-05
5446
 
alter table t66
5447
 
reorganize partition s1 into
5448
 
(partition p0 values less than (dayofweek('2006-12-24')),
5449
 
partition p1 values less than maxvalue);
5450
 
select * from t66 order by colint;
5451
 
colint  col1
5452
 
1       2006-02-03
5453
 
2       2006-01-17
5454
 
3       2006-01-25
5455
 
4       2006-02-05
5456
3415
-------------------------------------------------------------------------
5457
3416
---  Delete rows and partitions of tables with dayofweek(col1)
5458
3417
-------------------------------------------------------------------------
5526
3485
3       2006-01-25
5527
3486
4       2006-02-05
5528
3487
60      2006-02-17
5529
 
alter table t1 drop partition p0;
5530
 
alter table t2 drop partition p0;
5531
 
alter table t4 drop partition p0;
5532
 
alter table t5 drop partition p0;
5533
 
alter table t6 drop partition p0;
5534
 
select * from t1 order by col1;
5535
 
col1
5536
 
select * from t2 order by col1;
5537
 
col1
5538
 
select * from t3 order by col1;
5539
 
col1
5540
 
2006-01-25
5541
 
2006-02-05
5542
 
2006-02-17
5543
 
select * from t4 order by colint;
5544
 
colint  col1
5545
 
60      2006-02-17
5546
 
select * from t5 order by colint;
5547
 
colint  col1
5548
 
60      2006-02-17
5549
 
select * from t6 order by colint;
5550
 
colint  col1
5551
 
1       2006-02-03
5552
 
2       2006-01-17
5553
 
3       2006-01-25
5554
 
4       2006-02-05
5555
 
60      2006-02-17
5556
3488
-------------------------------------------------------------------------
5557
3489
---  Delete rows and partitions of tables with dayofweek(col1)
5558
3490
-------------------------------------------------------------------------
5626
3558
3       2006-01-25
5627
3559
4       2006-02-05
5628
3560
60      2006-02-17
5629
 
alter table t11 drop partition p0;
5630
 
alter table t22 drop partition p0;
5631
 
alter table t44 drop partition p0;
5632
 
alter table t55 drop partition p0;
5633
 
alter table t66 drop partition p0;
5634
 
select * from t11 order by col1;
5635
 
col1
5636
 
select * from t22 order by col1;
5637
 
col1
5638
 
select * from t33 order by col1;
5639
 
col1
5640
 
2006-01-25
5641
 
2006-02-05
5642
 
2006-02-17
5643
 
select * from t44 order by colint;
5644
 
colint  col1
5645
 
60      2006-02-17
5646
 
select * from t55 order by colint;
5647
 
colint  col1
5648
 
60      2006-02-17
5649
 
select * from t66 order by colint;
5650
 
colint  col1
5651
 
1       2006-02-03
5652
 
2       2006-01-17
5653
 
3       2006-01-25
5654
 
4       2006-02-05
5655
 
60      2006-02-17
5656
3561
-------------------------
5657
3562
---- some alter table end
5658
3563
-------------------------
5701
3606
(partition p0 values less than (15),
5702
3607
partition p1 values less than maxvalue);
5703
3608
create table t5 (colint int, col1 date) engine='NDB' 
5704
 
partition by list(colint)
 
3609
partition by list(colint) 
5705
3610
subpartition by hash(dayofyear(col1)) subpartitions 2 
5706
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
5707
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
5708
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
5709
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
5710
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
5711
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3611
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
3612
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3613
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
3614
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
5712
3615
);
5713
3616
create table t6 (colint int, col1 date) engine='NDB' 
5714
3617
partition by range(colint) 
5725
3628
insert into t3 values ('2006-01-03');
5726
3629
insert into t3 values ('2006-01-17');
5727
3630
insert into t3 values ('2006-02-25');
5728
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
5729
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
5730
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
3631
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
3632
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
3633
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
5731
3634
select dayofyear(col1) from t1 order by col1;
5732
3635
dayofyear(col1)
5733
3636
3
5838
3741
(partition p0 values less than (15),
5839
3742
partition p1 values less than maxvalue);
5840
3743
alter table t55
5841
 
partition by list(colint)
 
3744
partition by list(colint) 
5842
3745
subpartition by hash(dayofyear(col1)) subpartitions 2 
5843
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
5844
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
5845
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
5846
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
5847
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
5848
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3746
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
3747
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3748
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
3749
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
5849
3750
);
5850
3751
alter table t66
5851
3752
partition by range(colint) 
5886
3787
---------------------------
5887
3788
---- some alter table begin
5888
3789
---------------------------
5889
 
alter table t11
5890
 
reorganize partition p0,p1 into
5891
 
(partition s1 values less than maxvalue);
5892
 
select * from t11 order by col1;
5893
 
col1
5894
 
2006-01-17
5895
 
2006-02-05
5896
 
alter table t11
5897
 
reorganize partition s1 into
5898
 
(partition p0 values less than (15),
5899
 
partition p1 values less than maxvalue);
5900
 
select * from t11 order by col1;
5901
 
col1
5902
 
2006-01-17
5903
 
2006-02-05
5904
3790
alter table t55
5905
 
partition by list(colint)
5906
 
subpartition by hash(dayofyear(col1)) subpartitions 5 
5907
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
5908
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
5909
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
5910
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
5911
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
5912
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3791
partition by list(colint) 
 
3792
subpartition by hash(dayofyear(col1)) subpartitions 4 
 
3793
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3794
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
5913
3795
);
5914
3796
show create table t55;
5915
3797
Table   Create Table
5916
3798
t55     CREATE TABLE `t55` (
5917
3799
  `colint` int(11) DEFAULT NULL,
5918
3800
  `col1` date DEFAULT NULL
5919
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
3801
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
5920
3802
select * from t55 order by colint;
5921
3803
colint  col1
5922
3804
1       2006-02-03
5923
3805
2       2006-01-17
5924
3806
3       2006-01-25
5925
3807
4       2006-02-05
5926
 
alter table t66
5927
 
reorganize partition p0,p1 into
5928
 
(partition s1 values less than maxvalue);
5929
 
select * from t66 order by colint;
5930
 
colint  col1
5931
 
1       2006-02-03
5932
 
2       2006-01-17
5933
 
3       2006-01-25
5934
 
4       2006-02-05
5935
 
alter table t66
5936
 
reorganize partition s1 into
5937
 
(partition p0 values less than (dayofyear('2006-12-25')),
5938
 
partition p1 values less than maxvalue);
5939
 
select * from t66 order by colint;
5940
 
colint  col1
5941
 
1       2006-02-03
5942
 
2       2006-01-17
5943
 
3       2006-01-25
5944
 
4       2006-02-05
5945
 
alter table t66
5946
 
reorganize partition p0,p1 into
5947
 
(partition s1 values less than maxvalue);
5948
 
select * from t66 order by colint;
5949
 
colint  col1
5950
 
1       2006-02-03
5951
 
2       2006-01-17
5952
 
3       2006-01-25
5953
 
4       2006-02-05
5954
 
alter table t66
5955
 
reorganize partition s1 into
5956
 
(partition p0 values less than (dayofyear('2006-12-25')),
5957
 
partition p1 values less than maxvalue);
5958
 
select * from t66 order by colint;
5959
 
colint  col1
5960
 
1       2006-02-03
5961
 
2       2006-01-17
5962
 
3       2006-01-25
5963
 
4       2006-02-05
5964
3808
-------------------------------------------------------------------------
5965
3809
---  Delete rows and partitions of tables with dayofyear(col1)
5966
3810
-------------------------------------------------------------------------
6029
3873
3       2006-01-25
6030
3874
4       2006-02-05
6031
3875
60      2006-01-17
6032
 
alter table t1 drop partition p0;
6033
 
alter table t2 drop partition p0;
6034
 
alter table t4 drop partition p0;
6035
 
alter table t5 drop partition p0;
6036
 
alter table t6 drop partition p0;
6037
 
select * from t1 order by col1;
6038
 
col1
6039
 
2006-01-17
6040
 
2006-02-05
6041
 
select * from t2 order by col1;
6042
 
col1
6043
 
2006-01-17
6044
 
2006-02-05
6045
 
2006-02-25
6046
 
select * from t3 order by col1;
6047
 
col1
6048
 
2006-01-17
6049
 
2006-02-05
6050
 
2006-02-25
6051
 
select * from t4 order by colint;
6052
 
colint  col1
6053
 
60      2006-01-17
6054
 
select * from t5 order by colint;
6055
 
colint  col1
6056
 
60      2006-01-17
6057
 
select * from t6 order by colint;
6058
 
colint  col1
6059
3876
-------------------------------------------------------------------------
6060
3877
---  Delete rows and partitions of tables with dayofyear(col1)
6061
3878
-------------------------------------------------------------------------
6124
3941
3       2006-01-25
6125
3942
4       2006-02-05
6126
3943
60      2006-01-17
6127
 
alter table t11 drop partition p0;
6128
 
alter table t22 drop partition p0;
6129
 
alter table t44 drop partition p0;
6130
 
alter table t55 drop partition p0;
6131
 
alter table t66 drop partition p0;
6132
 
select * from t11 order by col1;
6133
 
col1
6134
 
2006-01-17
6135
 
2006-02-05
6136
 
select * from t22 order by col1;
6137
 
col1
6138
 
2006-01-17
6139
 
2006-02-05
6140
 
2006-02-25
6141
 
select * from t33 order by col1;
6142
 
col1
6143
 
2006-01-17
6144
 
2006-02-05
6145
 
2006-02-25
6146
 
select * from t44 order by colint;
6147
 
colint  col1
6148
 
60      2006-01-17
6149
 
select * from t55 order by colint;
6150
 
colint  col1
6151
 
60      2006-01-17
6152
 
select * from t66 order by colint;
6153
 
colint  col1
6154
3944
-------------------------
6155
3945
---- some alter table end
6156
3946
-------------------------
6199
3989
(partition p0 values less than (15),
6200
3990
partition p1 values less than maxvalue);
6201
3991
create table t5 (colint int, col1 char(30)) engine='NDB' 
6202
 
partition by list(colint)
 
3992
partition by list(colint) 
6203
3993
subpartition by hash(dayofyear(col1)) subpartitions 2 
6204
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
6205
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
6206
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
6207
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
6208
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
6209
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
3994
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
3995
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
3996
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
3997
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
6210
3998
);
6211
3999
create table t6 (colint int, col1 char(30)) engine='NDB' 
6212
4000
partition by range(colint) 
6223
4011
insert into t3 values ('2006-01-03');
6224
4012
insert into t3 values ('2006-01-17');
6225
4013
insert into t3 values ('2006-02-25');
6226
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
6227
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
6228
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
4014
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
4015
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
4016
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
6229
4017
select dayofyear(col1) from t1 order by col1;
6230
4018
dayofyear(col1)
6231
4019
3
6336
4124
(partition p0 values less than (15),
6337
4125
partition p1 values less than maxvalue);
6338
4126
alter table t55
6339
 
partition by list(colint)
 
4127
partition by list(colint) 
6340
4128
subpartition by hash(dayofyear(col1)) subpartitions 2 
6341
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
6342
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
6343
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
6344
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
6345
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
6346
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4129
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
4130
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4131
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
4132
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
6347
4133
);
6348
4134
alter table t66
6349
4135
partition by range(colint) 
6384
4170
---------------------------
6385
4171
---- some alter table begin
6386
4172
---------------------------
6387
 
alter table t11
6388
 
reorganize partition p0,p1 into
6389
 
(partition s1 values less than maxvalue);
6390
 
select * from t11 order by col1;
6391
 
col1
6392
 
2006-01-17
6393
 
2006-02-05
6394
 
alter table t11
6395
 
reorganize partition s1 into
6396
 
(partition p0 values less than (15),
6397
 
partition p1 values less than maxvalue);
6398
 
select * from t11 order by col1;
6399
 
col1
6400
 
2006-01-17
6401
 
2006-02-05
6402
4173
alter table t55
6403
 
partition by list(colint)
6404
 
subpartition by hash(dayofyear(col1)) subpartitions 5 
6405
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
6406
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
6407
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
6408
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
6409
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
6410
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4174
partition by list(colint) 
 
4175
subpartition by hash(dayofyear(col1)) subpartitions 4 
 
4176
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4177
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
6411
4178
);
6412
4179
show create table t55;
6413
4180
Table   Create Table
6414
4181
t55     CREATE TABLE `t55` (
6415
4182
  `colint` int(11) DEFAULT NULL,
6416
4183
  `col1` char(30) DEFAULT NULL
6417
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
4184
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (dayofyear(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
6418
4185
select * from t55 order by colint;
6419
4186
colint  col1
6420
4187
1       2006-02-03
6421
4188
2       2006-01-17
6422
4189
3       2006-01-25
6423
4190
4       2006-02-05
6424
 
alter table t66
6425
 
reorganize partition p0,p1 into
6426
 
(partition s1 values less than maxvalue);
6427
 
select * from t66 order by colint;
6428
 
colint  col1
6429
 
1       2006-02-03
6430
 
2       2006-01-17
6431
 
3       2006-01-25
6432
 
4       2006-02-05
6433
 
alter table t66
6434
 
reorganize partition s1 into
6435
 
(partition p0 values less than (dayofyear('2006-12-25')),
6436
 
partition p1 values less than maxvalue);
6437
 
select * from t66 order by colint;
6438
 
colint  col1
6439
 
1       2006-02-03
6440
 
2       2006-01-17
6441
 
3       2006-01-25
6442
 
4       2006-02-05
6443
 
alter table t66
6444
 
reorganize partition p0,p1 into
6445
 
(partition s1 values less than maxvalue);
6446
 
select * from t66 order by colint;
6447
 
colint  col1
6448
 
1       2006-02-03
6449
 
2       2006-01-17
6450
 
3       2006-01-25
6451
 
4       2006-02-05
6452
 
alter table t66
6453
 
reorganize partition s1 into
6454
 
(partition p0 values less than (dayofyear('2006-12-25')),
6455
 
partition p1 values less than maxvalue);
6456
 
select * from t66 order by colint;
6457
 
colint  col1
6458
 
1       2006-02-03
6459
 
2       2006-01-17
6460
 
3       2006-01-25
6461
 
4       2006-02-05
6462
4191
-------------------------------------------------------------------------
6463
4192
---  Delete rows and partitions of tables with dayofyear(col1)
6464
4193
-------------------------------------------------------------------------
6527
4256
3       2006-01-25
6528
4257
4       2006-02-05
6529
4258
60      2006-01-17
6530
 
alter table t1 drop partition p0;
6531
 
alter table t2 drop partition p0;
6532
 
alter table t4 drop partition p0;
6533
 
alter table t5 drop partition p0;
6534
 
alter table t6 drop partition p0;
6535
 
select * from t1 order by col1;
6536
 
col1
6537
 
2006-01-17
6538
 
2006-02-05
6539
 
select * from t2 order by col1;
6540
 
col1
6541
 
2006-01-17
6542
 
2006-02-05
6543
 
2006-02-25
6544
 
select * from t3 order by col1;
6545
 
col1
6546
 
2006-01-17
6547
 
2006-02-05
6548
 
2006-02-25
6549
 
select * from t4 order by colint;
6550
 
colint  col1
6551
 
60      2006-01-17
6552
 
select * from t5 order by colint;
6553
 
colint  col1
6554
 
60      2006-01-17
6555
 
select * from t6 order by colint;
6556
 
colint  col1
6557
4259
-------------------------------------------------------------------------
6558
4260
---  Delete rows and partitions of tables with dayofyear(col1)
6559
4261
-------------------------------------------------------------------------
6622
4324
3       2006-01-25
6623
4325
4       2006-02-05
6624
4326
60      2006-01-17
6625
 
alter table t11 drop partition p0;
6626
 
alter table t22 drop partition p0;
6627
 
alter table t44 drop partition p0;
6628
 
alter table t55 drop partition p0;
6629
 
alter table t66 drop partition p0;
6630
 
select * from t11 order by col1;
6631
 
col1
6632
 
2006-01-17
6633
 
2006-02-05
6634
 
select * from t22 order by col1;
6635
 
col1
6636
 
2006-01-17
6637
 
2006-02-05
6638
 
2006-02-25
6639
 
select * from t33 order by col1;
6640
 
col1
6641
 
2006-01-17
6642
 
2006-02-05
6643
 
2006-02-25
6644
 
select * from t44 order by colint;
6645
 
colint  col1
6646
 
60      2006-01-17
6647
 
select * from t55 order by colint;
6648
 
colint  col1
6649
 
60      2006-01-17
6650
 
select * from t66 order by colint;
6651
 
colint  col1
6652
4327
-------------------------
6653
4328
---- some alter table end
6654
4329
-------------------------
6697
4372
(partition p0 values less than (15),
6698
4373
partition p1 values less than maxvalue);
6699
4374
create table t5 (colint int, col1 date) engine='NDB' 
6700
 
partition by list(colint)
 
4375
partition by list(colint) 
6701
4376
subpartition by hash(extract(month from col1)) subpartitions 2 
6702
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
6703
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
6704
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
6705
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
6706
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
6707
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4377
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
4378
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4379
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
4380
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
6708
4381
);
6709
4382
create table t6 (colint int, col1 date) engine='NDB' 
6710
4383
partition by range(colint) 
6721
4394
insert into t3 values ('2006-01-03');
6722
4395
insert into t3 values ('2006-02-17');
6723
4396
insert into t3 values ('2006-01-25');
6724
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
6725
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
6726
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
4397
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
4398
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
4399
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
6727
4400
select extract(month from col1) from t1 order by col1;
6728
4401
extract(month from col1)
6729
4402
1
6834
4507
(partition p0 values less than (15),
6835
4508
partition p1 values less than maxvalue);
6836
4509
alter table t55
6837
 
partition by list(colint)
 
4510
partition by list(colint) 
6838
4511
subpartition by hash(extract(month from col1)) subpartitions 2 
6839
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
6840
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
6841
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
6842
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
6843
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
6844
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4512
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
4513
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4514
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
4515
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
6845
4516
);
6846
4517
alter table t66
6847
4518
partition by range(colint) 
6882
4553
---------------------------
6883
4554
---- some alter table begin
6884
4555
---------------------------
6885
 
alter table t11
6886
 
reorganize partition p0,p1 into
6887
 
(partition s1 values less than maxvalue);
6888
 
select * from t11 order by col1;
6889
 
col1
6890
 
2006-02-05
6891
 
2006-02-17
6892
 
alter table t11
6893
 
reorganize partition s1 into
6894
 
(partition p0 values less than (15),
6895
 
partition p1 values less than maxvalue);
6896
 
select * from t11 order by col1;
6897
 
col1
6898
 
2006-02-05
6899
 
2006-02-17
6900
4556
alter table t55
6901
 
partition by list(colint)
6902
 
subpartition by hash(extract(month from col1)) subpartitions 5 
6903
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
6904
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
6905
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
6906
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
6907
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
6908
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4557
partition by list(colint) 
 
4558
subpartition by hash(extract(month from col1)) subpartitions 4 
 
4559
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4560
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
6909
4561
);
6910
4562
show create table t55;
6911
4563
Table   Create Table
6912
4564
t55     CREATE TABLE `t55` (
6913
4565
  `colint` int(11) DEFAULT NULL,
6914
4566
  `col1` date DEFAULT NULL
6915
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
4567
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (extract(month from col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
6916
4568
select * from t55 order by colint;
6917
4569
colint  col1
6918
4570
1       2006-02-03
6919
4571
2       2006-01-17
6920
4572
3       2006-01-25
6921
4573
4       2006-02-05
6922
 
alter table t66
6923
 
reorganize partition p0,p1 into
6924
 
(partition s1 values less than maxvalue);
6925
 
select * from t66 order by colint;
6926
 
colint  col1
6927
 
1       2006-02-03
6928
 
2       2006-01-17
6929
 
3       2006-01-25
6930
 
4       2006-02-05
6931
 
alter table t66
6932
 
reorganize partition s1 into
6933
 
(partition p0 values less than (extract(year from '1998-11-23')),
6934
 
partition p1 values less than maxvalue);
6935
 
select * from t66 order by colint;
6936
 
colint  col1
6937
 
1       2006-02-03
6938
 
2       2006-01-17
6939
 
3       2006-01-25
6940
 
4       2006-02-05
6941
 
alter table t66
6942
 
reorganize partition p0,p1 into
6943
 
(partition s1 values less than maxvalue);
6944
 
select * from t66 order by colint;
6945
 
colint  col1
6946
 
1       2006-02-03
6947
 
2       2006-01-17
6948
 
3       2006-01-25
6949
 
4       2006-02-05
6950
 
alter table t66
6951
 
reorganize partition s1 into
6952
 
(partition p0 values less than (extract(year from '1998-11-23')),
6953
 
partition p1 values less than maxvalue);
6954
 
select * from t66 order by colint;
6955
 
colint  col1
6956
 
1       2006-02-03
6957
 
2       2006-01-17
6958
 
3       2006-01-25
6959
 
4       2006-02-05
6960
4574
-------------------------------------------------------------------------
6961
4575
---  Delete rows and partitions of tables with extract(month from col1)
6962
4576
-------------------------------------------------------------------------
7030
4644
3       2006-01-25
7031
4645
4       2006-02-05
7032
4646
60      2006-02-17
7033
 
alter table t1 drop partition p0;
7034
 
alter table t2 drop partition p0;
7035
 
alter table t4 drop partition p0;
7036
 
alter table t5 drop partition p0;
7037
 
alter table t6 drop partition p0;
7038
 
select * from t1 order by col1;
7039
 
col1
7040
 
select * from t2 order by col1;
7041
 
col1
7042
 
select * from t3 order by col1;
7043
 
col1
7044
 
2006-01-25
7045
 
2006-02-05
7046
 
2006-02-17
7047
 
select * from t4 order by colint;
7048
 
colint  col1
7049
 
60      2006-02-17
7050
 
select * from t5 order by colint;
7051
 
colint  col1
7052
 
60      2006-02-17
7053
 
select * from t6 order by colint;
7054
 
colint  col1
7055
4647
-------------------------------------------------------------------------
7056
4648
---  Delete rows and partitions of tables with extract(month from col1)
7057
4649
-------------------------------------------------------------------------
7125
4717
3       2006-01-25
7126
4718
4       2006-02-05
7127
4719
60      2006-02-17
7128
 
alter table t11 drop partition p0;
7129
 
alter table t22 drop partition p0;
7130
 
alter table t44 drop partition p0;
7131
 
alter table t55 drop partition p0;
7132
 
alter table t66 drop partition p0;
7133
 
select * from t11 order by col1;
7134
 
col1
7135
 
select * from t22 order by col1;
7136
 
col1
7137
 
select * from t33 order by col1;
7138
 
col1
7139
 
2006-01-25
7140
 
2006-02-05
7141
 
2006-02-17
7142
 
select * from t44 order by colint;
7143
 
colint  col1
7144
 
60      2006-02-17
7145
 
select * from t55 order by colint;
7146
 
colint  col1
7147
 
60      2006-02-17
7148
 
select * from t66 order by colint;
7149
 
colint  col1
7150
4720
-------------------------
7151
4721
---- some alter table end
7152
4722
-------------------------
7195
4765
(partition p0 values less than (15),
7196
4766
partition p1 values less than maxvalue);
7197
4767
create table t5 (colint int, col1 time) engine='NDB' 
7198
 
partition by list(colint)
 
4768
partition by list(colint) 
7199
4769
subpartition by hash(hour(col1)) subpartitions 2 
7200
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
7201
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
7202
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
7203
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
7204
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
7205
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4770
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
4771
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4772
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
4773
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
7206
4774
);
7207
4775
create table t6 (colint int, col1 time) engine='NDB' 
7208
4776
partition by range(colint) 
7219
4787
insert into t3 values ('09:09');
7220
4788
insert into t3 values ('14:30');
7221
4789
insert into t3 values ('21:59');
7222
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4;
7223
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5;
7224
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6;
 
4790
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
 
4791
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
 
4792
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
7225
4793
select hour(col1) from t1 order by col1;
7226
4794
hour(col1)
7227
4795
9
7332
4900
(partition p0 values less than (15),
7333
4901
partition p1 values less than maxvalue);
7334
4902
alter table t55
7335
 
partition by list(colint)
 
4903
partition by list(colint) 
7336
4904
subpartition by hash(hour(col1)) subpartitions 2 
7337
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
7338
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
7339
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
7340
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
7341
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
7342
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4905
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
4906
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4907
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
4908
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
7343
4909
);
7344
4910
alter table t66
7345
4911
partition by range(colint) 
7380
4946
---------------------------
7381
4947
---- some alter table begin
7382
4948
---------------------------
7383
 
alter table t11
7384
 
reorganize partition p0,p1 into
7385
 
(partition s1 values less than maxvalue);
7386
 
select * from t11 order by col1;
7387
 
col1
7388
 
10:30:00
7389
 
14:30:00
7390
 
alter table t11
7391
 
reorganize partition s1 into
7392
 
(partition p0 values less than (15),
7393
 
partition p1 values less than maxvalue);
7394
 
select * from t11 order by col1;
7395
 
col1
7396
 
10:30:00
7397
 
14:30:00
7398
4949
alter table t55
7399
 
partition by list(colint)
7400
 
subpartition by hash(hour(col1)) subpartitions 5 
7401
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
7402
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
7403
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
7404
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
7405
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
7406
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
4950
partition by list(colint) 
 
4951
subpartition by hash(hour(col1)) subpartitions 4 
 
4952
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
4953
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
7407
4954
);
7408
4955
show create table t55;
7409
4956
Table   Create Table
7410
4957
t55     CREATE TABLE `t55` (
7411
4958
  `colint` int(11) DEFAULT NULL,
7412
4959
  `col1` time DEFAULT NULL
7413
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
4960
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (hour(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
7414
4961
select * from t55 order by colint;
7415
4962
colint  col1
7416
4963
1       09:09:15
7417
4964
2       04:30:01
7418
4965
3       00:59:22
7419
4966
4       05:30:34
7420
 
alter table t66
7421
 
reorganize partition p0,p1 into
7422
 
(partition s1 values less than maxvalue);
7423
 
select * from t66 order by colint;
7424
 
colint  col1
7425
 
1       09:09:15
7426
 
2       04:30:01
7427
 
3       00:59:22
7428
 
4       05:30:34
7429
 
alter table t66
7430
 
reorganize partition s1 into
7431
 
(partition p0 values less than (hour('18:30')),
7432
 
partition p1 values less than maxvalue);
7433
 
select * from t66 order by colint;
7434
 
colint  col1
7435
 
1       09:09:15
7436
 
2       04:30:01
7437
 
3       00:59:22
7438
 
4       05:30:34
7439
 
alter table t66
7440
 
reorganize partition p0,p1 into
7441
 
(partition s1 values less than maxvalue);
7442
 
select * from t66 order by colint;
7443
 
colint  col1
7444
 
1       09:09:15
7445
 
2       04:30:01
7446
 
3       00:59:22
7447
 
4       05:30:34
7448
 
alter table t66
7449
 
reorganize partition s1 into
7450
 
(partition p0 values less than (hour('18:30')),
7451
 
partition p1 values less than maxvalue);
7452
 
select * from t66 order by colint;
7453
 
colint  col1
7454
 
1       09:09:15
7455
 
2       04:30:01
7456
 
3       00:59:22
7457
 
4       05:30:34
7458
4967
-------------------------------------------------------------------------
7459
4968
---  Delete rows and partitions of tables with hour(col1)
7460
4969
-------------------------------------------------------------------------
7528
5037
3       00:59:22
7529
5038
4       05:30:34
7530
5039
60      14:30:00
7531
 
alter table t1 drop partition p0;
7532
 
alter table t2 drop partition p0;
7533
 
alter table t4 drop partition p0;
7534
 
alter table t5 drop partition p0;
7535
 
alter table t6 drop partition p0;
7536
 
select * from t1 order by col1;
7537
 
col1
7538
 
select * from t2 order by col1;
7539
 
col1
7540
 
14:30:00
7541
 
21:59:00
7542
 
select * from t3 order by col1;
7543
 
col1
7544
 
10:30:00
7545
 
14:30:00
7546
 
21:59:00
7547
 
select * from t4 order by colint;
7548
 
colint  col1
7549
 
60      14:30:00
7550
 
select * from t5 order by colint;
7551
 
colint  col1
7552
 
60      14:30:00
7553
 
select * from t6 order by colint;
7554
 
colint  col1
7555
 
60      14:30:00
7556
5040
-------------------------------------------------------------------------
7557
5041
---  Delete rows and partitions of tables with hour(col1)
7558
5042
-------------------------------------------------------------------------
7626
5110
3       00:59:22
7627
5111
4       05:30:34
7628
5112
60      14:30:00
7629
 
alter table t11 drop partition p0;
7630
 
alter table t22 drop partition p0;
7631
 
alter table t44 drop partition p0;
7632
 
alter table t55 drop partition p0;
7633
 
alter table t66 drop partition p0;
7634
 
select * from t11 order by col1;
7635
 
col1
7636
 
select * from t22 order by col1;
7637
 
col1
7638
 
14:30:00
7639
 
21:59:00
7640
 
select * from t33 order by col1;
7641
 
col1
7642
 
10:30:00
7643
 
14:30:00
7644
 
21:59:00
7645
 
select * from t44 order by colint;
7646
 
colint  col1
7647
 
60      14:30:00
7648
 
select * from t55 order by colint;
7649
 
colint  col1
7650
 
60      14:30:00
7651
 
select * from t66 order by colint;
7652
 
colint  col1
7653
 
60      14:30:00
7654
5113
-------------------------
7655
5114
---- some alter table end
7656
5115
-------------------------
7699
5158
(partition p0 values less than (15),
7700
5159
partition p1 values less than maxvalue);
7701
5160
create table t5 (colint int, col1 time) engine='NDB' 
7702
 
partition by list(colint)
 
5161
partition by list(colint) 
7703
5162
subpartition by hash(microsecond(col1)) subpartitions 2 
7704
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
7705
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
7706
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
7707
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
7708
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
7709
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5163
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
5164
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5165
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
5166
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
7710
5167
);
7711
5168
create table t6 (colint int, col1 time) engine='NDB' 
7712
5169
partition by range(colint) 
7723
5180
insert into t3 values ('09:09:15.000002');
7724
5181
insert into t3 values ('04:30:01.000018');
7725
5182
insert into t3 values ('00:59:22.000024');
7726
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4;
7727
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5;
7728
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6;
 
5183
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
 
5184
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
 
5185
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
7729
5186
select microsecond(col1) from t1 order by col1;
7730
5187
microsecond(col1)
7731
5188
0
7836
5293
(partition p0 values less than (15),
7837
5294
partition p1 values less than maxvalue);
7838
5295
alter table t55
7839
 
partition by list(colint)
 
5296
partition by list(colint) 
7840
5297
subpartition by hash(microsecond(col1)) subpartitions 2 
7841
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
7842
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
7843
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
7844
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
7845
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
7846
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5298
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
5299
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5300
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
5301
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
7847
5302
);
7848
5303
alter table t66
7849
5304
partition by range(colint) 
7884
5339
---------------------------
7885
5340
---- some alter table begin
7886
5341
---------------------------
7887
 
alter table t11
7888
 
reorganize partition p0,p1 into
7889
 
(partition s1 values less than maxvalue);
7890
 
select * from t11 order by col1;
7891
 
col1
7892
 
04:30:01
7893
 
05:30:34
7894
 
alter table t11
7895
 
reorganize partition s1 into
7896
 
(partition p0 values less than (15),
7897
 
partition p1 values less than maxvalue);
7898
 
select * from t11 order by col1;
7899
 
col1
7900
 
04:30:01
7901
 
05:30:34
7902
5342
alter table t55
7903
 
partition by list(colint)
7904
 
subpartition by hash(microsecond(col1)) subpartitions 5 
7905
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
7906
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
7907
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
7908
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
7909
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
7910
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5343
partition by list(colint) 
 
5344
subpartition by hash(microsecond(col1)) subpartitions 4 
 
5345
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5346
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
7911
5347
);
7912
5348
show create table t55;
7913
5349
Table   Create Table
7914
5350
t55     CREATE TABLE `t55` (
7915
5351
  `colint` int(11) DEFAULT NULL,
7916
5352
  `col1` time DEFAULT NULL
7917
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
5353
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (microsecond(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
7918
5354
select * from t55 order by colint;
7919
5355
colint  col1
7920
5356
1       05:30:34
7921
5357
2       04:30:01
7922
5358
3       00:59:22
7923
5359
4       05:30:34
7924
 
alter table t66
7925
 
reorganize partition p0,p1 into
7926
 
(partition s1 values less than maxvalue);
7927
 
select * from t66 order by colint;
7928
 
colint  col1
7929
 
1       05:30:34
7930
 
2       04:30:01
7931
 
3       00:59:22
7932
 
4       05:30:34
7933
 
alter table t66
7934
 
reorganize partition s1 into
7935
 
(partition p0 values less than (microsecond('10:30:10.000010')),
7936
 
partition p1 values less than maxvalue);
7937
 
select * from t66 order by colint;
7938
 
colint  col1
7939
 
1       05:30:34
7940
 
2       04:30:01
7941
 
3       00:59:22
7942
 
4       05:30:34
7943
 
alter table t66
7944
 
reorganize partition p0,p1 into
7945
 
(partition s1 values less than maxvalue);
7946
 
select * from t66 order by colint;
7947
 
colint  col1
7948
 
1       05:30:34
7949
 
2       04:30:01
7950
 
3       00:59:22
7951
 
4       05:30:34
7952
 
alter table t66
7953
 
reorganize partition s1 into
7954
 
(partition p0 values less than (microsecond('10:30:10.000010')),
7955
 
partition p1 values less than maxvalue);
7956
 
select * from t66 order by colint;
7957
 
colint  col1
7958
 
1       05:30:34
7959
 
2       04:30:01
7960
 
3       00:59:22
7961
 
4       05:30:34
7962
5360
-------------------------------------------------------------------------
7963
5361
---  Delete rows and partitions of tables with microsecond(col1)
7964
5362
-------------------------------------------------------------------------
8027
5425
3       00:59:22
8028
5426
4       05:30:34
8029
5427
60      04:30:01
8030
 
alter table t1 drop partition p0;
8031
 
alter table t2 drop partition p0;
8032
 
alter table t4 drop partition p0;
8033
 
alter table t5 drop partition p0;
8034
 
alter table t6 drop partition p0;
8035
 
select * from t1 order by col1;
8036
 
col1
8037
 
select * from t2 order by col1;
8038
 
col1
8039
 
select * from t3 order by col1;
8040
 
col1
8041
 
00:59:22
8042
 
04:30:01
8043
 
05:30:34
8044
 
select * from t4 order by colint;
8045
 
colint  col1
8046
 
60      04:30:01
8047
 
select * from t5 order by colint;
8048
 
colint  col1
8049
 
60      04:30:01
8050
 
select * from t6 order by colint;
8051
 
colint  col1
8052
 
60      04:30:01
8053
5428
-------------------------------------------------------------------------
8054
5429
---  Delete rows and partitions of tables with microsecond(col1)
8055
5430
-------------------------------------------------------------------------
8118
5493
3       00:59:22
8119
5494
4       05:30:34
8120
5495
60      04:30:01
8121
 
alter table t11 drop partition p0;
8122
 
alter table t22 drop partition p0;
8123
 
alter table t44 drop partition p0;
8124
 
alter table t55 drop partition p0;
8125
 
alter table t66 drop partition p0;
8126
 
select * from t11 order by col1;
8127
 
col1
8128
 
select * from t22 order by col1;
8129
 
col1
8130
 
select * from t33 order by col1;
8131
 
col1
8132
 
00:59:22
8133
 
04:30:01
8134
 
05:30:34
8135
 
select * from t44 order by colint;
8136
 
colint  col1
8137
 
60      04:30:01
8138
 
select * from t55 order by colint;
8139
 
colint  col1
8140
 
60      04:30:01
8141
 
select * from t66 order by colint;
8142
 
colint  col1
8143
 
60      04:30:01
8144
5496
-------------------------
8145
5497
---- some alter table end
8146
5498
-------------------------
8189
5541
(partition p0 values less than (15),
8190
5542
partition p1 values less than maxvalue);
8191
5543
create table t5 (colint int, col1 time) engine='NDB' 
8192
 
partition by list(colint)
 
5544
partition by list(colint) 
8193
5545
subpartition by hash(minute(col1)) subpartitions 2 
8194
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
8195
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
8196
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
8197
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
8198
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
8199
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5546
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
5547
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5548
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
5549
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
8200
5550
);
8201
5551
create table t6 (colint int, col1 time) engine='NDB' 
8202
5552
partition by range(colint) 
8213
5563
insert into t3 values ('09:09:15');
8214
5564
insert into t3 values ('14:30:45');
8215
5565
insert into t3 values ('21:59:22');
8216
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4;
8217
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5;
8218
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6;
 
5566
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
 
5567
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
 
5568
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
8219
5569
select minute(col1) from t1 order by col1;
8220
5570
minute(col1)
8221
5571
9
8326
5676
(partition p0 values less than (15),
8327
5677
partition p1 values less than maxvalue);
8328
5678
alter table t55
8329
 
partition by list(colint)
 
5679
partition by list(colint) 
8330
5680
subpartition by hash(minute(col1)) subpartitions 2 
8331
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
8332
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
8333
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
8334
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
8335
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
8336
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5681
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
5682
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5683
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
5684
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
8337
5685
);
8338
5686
alter table t66
8339
5687
partition by range(colint) 
8374
5722
---------------------------
8375
5723
---- some alter table begin
8376
5724
---------------------------
8377
 
alter table t11
8378
 
reorganize partition p0,p1 into
8379
 
(partition s1 values less than maxvalue);
8380
 
select * from t11 order by col1;
8381
 
col1
8382
 
10:24:23
8383
 
14:30:45
8384
 
alter table t11
8385
 
reorganize partition s1 into
8386
 
(partition p0 values less than (15),
8387
 
partition p1 values less than maxvalue);
8388
 
select * from t11 order by col1;
8389
 
col1
8390
 
10:24:23
8391
 
14:30:45
8392
5725
alter table t55
8393
 
partition by list(colint)
8394
 
subpartition by hash(minute(col1)) subpartitions 5 
8395
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
8396
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
8397
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
8398
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
8399
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
8400
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5726
partition by list(colint) 
 
5727
subpartition by hash(minute(col1)) subpartitions 4 
 
5728
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5729
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
8401
5730
);
8402
5731
show create table t55;
8403
5732
Table   Create Table
8404
5733
t55     CREATE TABLE `t55` (
8405
5734
  `colint` int(11) DEFAULT NULL,
8406
5735
  `col1` time DEFAULT NULL
8407
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
5736
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (minute(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
8408
5737
select * from t55 order by colint;
8409
5738
colint  col1
8410
5739
1       10:24:23
8411
5740
2       04:30:01
8412
5741
3       00:59:22
8413
5742
4       05:30:34
8414
 
alter table t66
8415
 
reorganize partition p0,p1 into
8416
 
(partition s1 values less than maxvalue);
8417
 
select * from t66 order by colint;
8418
 
colint  col1
8419
 
1       10:24:23
8420
 
2       04:30:01
8421
 
3       00:59:22
8422
 
4       05:30:34
8423
 
alter table t66
8424
 
reorganize partition s1 into
8425
 
(partition p0 values less than (minute('18:30')),
8426
 
partition p1 values less than maxvalue);
8427
 
select * from t66 order by colint;
8428
 
colint  col1
8429
 
1       10:24:23
8430
 
2       04:30:01
8431
 
3       00:59:22
8432
 
4       05:30:34
8433
 
alter table t66
8434
 
reorganize partition p0,p1 into
8435
 
(partition s1 values less than maxvalue);
8436
 
select * from t66 order by colint;
8437
 
colint  col1
8438
 
1       10:24:23
8439
 
2       04:30:01
8440
 
3       00:59:22
8441
 
4       05:30:34
8442
 
alter table t66
8443
 
reorganize partition s1 into
8444
 
(partition p0 values less than (minute('18:30')),
8445
 
partition p1 values less than maxvalue);
8446
 
select * from t66 order by colint;
8447
 
colint  col1
8448
 
1       10:24:23
8449
 
2       04:30:01
8450
 
3       00:59:22
8451
 
4       05:30:34
8452
5743
-------------------------------------------------------------------------
8453
5744
---  Delete rows and partitions of tables with minute(col1)
8454
5745
-------------------------------------------------------------------------
8522
5813
3       00:59:22
8523
5814
4       05:30:34
8524
5815
60      14:30:45
8525
 
alter table t1 drop partition p0;
8526
 
alter table t2 drop partition p0;
8527
 
alter table t4 drop partition p0;
8528
 
alter table t5 drop partition p0;
8529
 
alter table t6 drop partition p0;
8530
 
select * from t1 order by col1;
8531
 
col1
8532
 
10:24:23
8533
 
14:30:45
8534
 
select * from t2 order by col1;
8535
 
col1
8536
 
10:24:23
8537
 
14:30:45
8538
 
21:59:22
8539
 
select * from t3 order by col1;
8540
 
col1
8541
 
10:24:23
8542
 
14:30:45
8543
 
21:59:22
8544
 
select * from t4 order by colint;
8545
 
colint  col1
8546
 
60      14:30:45
8547
 
select * from t5 order by colint;
8548
 
colint  col1
8549
 
60      14:30:45
8550
 
select * from t6 order by colint;
8551
 
colint  col1
8552
 
60      14:30:45
8553
5816
-------------------------------------------------------------------------
8554
5817
---  Delete rows and partitions of tables with minute(col1)
8555
5818
-------------------------------------------------------------------------
8623
5886
3       00:59:22
8624
5887
4       05:30:34
8625
5888
60      14:30:45
8626
 
alter table t11 drop partition p0;
8627
 
alter table t22 drop partition p0;
8628
 
alter table t44 drop partition p0;
8629
 
alter table t55 drop partition p0;
8630
 
alter table t66 drop partition p0;
8631
 
select * from t11 order by col1;
8632
 
col1
8633
 
10:24:23
8634
 
14:30:45
8635
 
select * from t22 order by col1;
8636
 
col1
8637
 
10:24:23
8638
 
14:30:45
8639
 
21:59:22
8640
 
select * from t33 order by col1;
8641
 
col1
8642
 
10:24:23
8643
 
14:30:45
8644
 
21:59:22
8645
 
select * from t44 order by colint;
8646
 
colint  col1
8647
 
60      14:30:45
8648
 
select * from t55 order by colint;
8649
 
colint  col1
8650
 
60      14:30:45
8651
 
select * from t66 order by colint;
8652
 
colint  col1
8653
 
60      14:30:45
8654
5889
-------------------------
8655
5890
---- some alter table end
8656
5891
-------------------------
8699
5934
(partition p0 values less than (15),
8700
5935
partition p1 values less than maxvalue);
8701
5936
create table t5 (colint int, col1 time) engine='NDB' 
8702
 
partition by list(colint)
 
5937
partition by list(colint) 
8703
5938
subpartition by hash(second(col1)) subpartitions 2 
8704
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
8705
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
8706
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
8707
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
8708
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
8709
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
5939
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
5940
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
5941
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
5942
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
8710
5943
);
8711
5944
create table t6 (colint int, col1 time) engine='NDB' 
8712
5945
partition by range(colint) 
8723
5956
insert into t3 values ('09:09:09');
8724
5957
insert into t3 values ('14:30:20');
8725
5958
insert into t3 values ('21:59:22');
8726
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4;
8727
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5;
8728
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6;
 
5959
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
 
5960
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
 
5961
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
8729
5962
select second(col1) from t1 order by col1;
8730
5963
second(col1)
8731
5964
9
8836
6069
(partition p0 values less than (15),
8837
6070
partition p1 values less than maxvalue);
8838
6071
alter table t55
8839
 
partition by list(colint)
 
6072
partition by list(colint) 
8840
6073
subpartition by hash(second(col1)) subpartitions 2 
8841
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
8842
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
8843
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
8844
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
8845
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
8846
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6074
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
6075
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6076
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
6077
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
8847
6078
);
8848
6079
alter table t66
8849
6080
partition by range(colint) 
8884
6115
---------------------------
8885
6116
---- some alter table begin
8886
6117
---------------------------
8887
 
alter table t11
8888
 
reorganize partition p0,p1 into
8889
 
(partition s1 values less than maxvalue);
8890
 
select * from t11 order by col1;
8891
 
col1
8892
 
10:22:33
8893
 
14:30:20
8894
 
alter table t11
8895
 
reorganize partition s1 into
8896
 
(partition p0 values less than (15),
8897
 
partition p1 values less than maxvalue);
8898
 
select * from t11 order by col1;
8899
 
col1
8900
 
10:22:33
8901
 
14:30:20
8902
6118
alter table t55
8903
 
partition by list(colint)
8904
 
subpartition by hash(second(col1)) subpartitions 5 
8905
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
8906
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
8907
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
8908
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
8909
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
8910
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6119
partition by list(colint) 
 
6120
subpartition by hash(second(col1)) subpartitions 4 
 
6121
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6122
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
8911
6123
);
8912
6124
show create table t55;
8913
6125
Table   Create Table
8914
6126
t55     CREATE TABLE `t55` (
8915
6127
  `colint` int(11) DEFAULT NULL,
8916
6128
  `col1` time DEFAULT NULL
8917
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
6129
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
8918
6130
select * from t55 order by colint;
8919
6131
colint  col1
8920
6132
1       09:09:15
8921
6133
2       04:30:01
8922
6134
3       00:59:22
8923
6135
4       05:30:34
8924
 
alter table t66
8925
 
reorganize partition p0,p1 into
8926
 
(partition s1 values less than maxvalue);
8927
 
select * from t66 order by colint;
8928
 
colint  col1
8929
 
1       09:09:15
8930
 
2       04:30:01
8931
 
3       00:59:22
8932
 
4       05:30:34
8933
 
alter table t66
8934
 
reorganize partition s1 into
8935
 
(partition p0 values less than (second('18:30:14')),
8936
 
partition p1 values less than maxvalue);
8937
 
select * from t66 order by colint;
8938
 
colint  col1
8939
 
1       09:09:15
8940
 
2       04:30:01
8941
 
3       00:59:22
8942
 
4       05:30:34
8943
 
alter table t66
8944
 
reorganize partition p0,p1 into
8945
 
(partition s1 values less than maxvalue);
8946
 
select * from t66 order by colint;
8947
 
colint  col1
8948
 
1       09:09:15
8949
 
2       04:30:01
8950
 
3       00:59:22
8951
 
4       05:30:34
8952
 
alter table t66
8953
 
reorganize partition s1 into
8954
 
(partition p0 values less than (second('18:30:14')),
8955
 
partition p1 values less than maxvalue);
8956
 
select * from t66 order by colint;
8957
 
colint  col1
8958
 
1       09:09:15
8959
 
2       04:30:01
8960
 
3       00:59:22
8961
 
4       05:30:34
8962
6136
-------------------------------------------------------------------------
8963
6137
---  Delete rows and partitions of tables with second(col1)
8964
6138
-------------------------------------------------------------------------
9032
6206
3       00:59:22
9033
6207
4       05:30:34
9034
6208
60      14:30:20
9035
 
alter table t1 drop partition p0;
9036
 
alter table t2 drop partition p0;
9037
 
alter table t4 drop partition p0;
9038
 
alter table t5 drop partition p0;
9039
 
alter table t6 drop partition p0;
9040
 
select * from t1 order by col1;
9041
 
col1
9042
 
10:22:33
9043
 
14:30:20
9044
 
select * from t2 order by col1;
9045
 
col1
9046
 
10:22:33
9047
 
14:30:20
9048
 
21:59:22
9049
 
select * from t3 order by col1;
9050
 
col1
9051
 
10:22:33
9052
 
14:30:20
9053
 
21:59:22
9054
 
select * from t4 order by colint;
9055
 
colint  col1
9056
 
60      14:30:20
9057
 
select * from t5 order by colint;
9058
 
colint  col1
9059
 
60      14:30:20
9060
 
select * from t6 order by colint;
9061
 
colint  col1
9062
 
60      14:30:20
9063
6209
-------------------------------------------------------------------------
9064
6210
---  Delete rows and partitions of tables with second(col1)
9065
6211
-------------------------------------------------------------------------
9133
6279
3       00:59:22
9134
6280
4       05:30:34
9135
6281
60      14:30:20
9136
 
alter table t11 drop partition p0;
9137
 
alter table t22 drop partition p0;
9138
 
alter table t44 drop partition p0;
9139
 
alter table t55 drop partition p0;
9140
 
alter table t66 drop partition p0;
9141
 
select * from t11 order by col1;
9142
 
col1
9143
 
10:22:33
9144
 
14:30:20
9145
 
select * from t22 order by col1;
9146
 
col1
9147
 
10:22:33
9148
 
14:30:20
9149
 
21:59:22
9150
 
select * from t33 order by col1;
9151
 
col1
9152
 
10:22:33
9153
 
14:30:20
9154
 
21:59:22
9155
 
select * from t44 order by colint;
9156
 
colint  col1
9157
 
60      14:30:20
9158
 
select * from t55 order by colint;
9159
 
colint  col1
9160
 
60      14:30:20
9161
 
select * from t66 order by colint;
9162
 
colint  col1
9163
 
60      14:30:20
9164
6282
-------------------------
9165
6283
---- some alter table end
9166
6284
-------------------------
9209
6327
(partition p0 values less than (15),
9210
6328
partition p1 values less than maxvalue);
9211
6329
create table t5 (colint int, col1 char(30)) engine='NDB' 
9212
 
partition by list(colint)
 
6330
partition by list(colint) 
9213
6331
subpartition by hash(second(col1)) subpartitions 2 
9214
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
9215
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
9216
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
9217
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
9218
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
9219
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6332
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
6333
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6334
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
6335
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
9220
6336
);
9221
6337
create table t6 (colint int, col1 char(30)) engine='NDB' 
9222
6338
partition by range(colint) 
9233
6349
insert into t3 values ('09:09:09');
9234
6350
insert into t3 values ('14:30:20');
9235
6351
insert into t3 values ('21:59:22');
9236
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4;
9237
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5;
9238
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6;
 
6352
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
 
6353
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
 
6354
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
9239
6355
select second(col1) from t1 order by col1;
9240
6356
second(col1)
9241
6357
9
9346
6462
(partition p0 values less than (15),
9347
6463
partition p1 values less than maxvalue);
9348
6464
alter table t55
9349
 
partition by list(colint)
 
6465
partition by list(colint) 
9350
6466
subpartition by hash(second(col1)) subpartitions 2 
9351
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
9352
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
9353
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
9354
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
9355
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
9356
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6467
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
6468
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6469
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
6470
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
9357
6471
);
9358
6472
alter table t66
9359
6473
partition by range(colint) 
9394
6508
---------------------------
9395
6509
---- some alter table begin
9396
6510
---------------------------
9397
 
alter table t11
9398
 
reorganize partition p0,p1 into
9399
 
(partition s1 values less than maxvalue);
9400
 
select * from t11 order by col1;
9401
 
col1
9402
 
10:22:33
9403
 
14:30:20
9404
 
alter table t11
9405
 
reorganize partition s1 into
9406
 
(partition p0 values less than (15),
9407
 
partition p1 values less than maxvalue);
9408
 
select * from t11 order by col1;
9409
 
col1
9410
 
10:22:33
9411
 
14:30:20
9412
6511
alter table t55
9413
 
partition by list(colint)
9414
 
subpartition by hash(second(col1)) subpartitions 5 
9415
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
9416
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
9417
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
9418
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
9419
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
9420
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6512
partition by list(colint) 
 
6513
subpartition by hash(second(col1)) subpartitions 4 
 
6514
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6515
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
9421
6516
);
9422
6517
show create table t55;
9423
6518
Table   Create Table
9424
6519
t55     CREATE TABLE `t55` (
9425
6520
  `colint` int(11) DEFAULT NULL,
9426
6521
  `col1` char(30) DEFAULT NULL
9427
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
6522
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (second(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
9428
6523
select * from t55 order by colint;
9429
6524
colint  col1
9430
6525
1       09:09:15.000002
9431
6526
2       04:30:01.000018
9432
6527
3       00:59:22.000024
9433
6528
4       05:30:34.000037
9434
 
alter table t66
9435
 
reorganize partition p0,p1 into
9436
 
(partition s1 values less than maxvalue);
9437
 
select * from t66 order by colint;
9438
 
colint  col1
9439
 
1       09:09:15.000002
9440
 
2       04:30:01.000018
9441
 
3       00:59:22.000024
9442
 
4       05:30:34.000037
9443
 
alter table t66
9444
 
reorganize partition s1 into
9445
 
(partition p0 values less than (second('18:30:14')),
9446
 
partition p1 values less than maxvalue);
9447
 
select * from t66 order by colint;
9448
 
colint  col1
9449
 
1       09:09:15.000002
9450
 
2       04:30:01.000018
9451
 
3       00:59:22.000024
9452
 
4       05:30:34.000037
9453
 
alter table t66
9454
 
reorganize partition p0,p1 into
9455
 
(partition s1 values less than maxvalue);
9456
 
select * from t66 order by colint;
9457
 
colint  col1
9458
 
1       09:09:15.000002
9459
 
2       04:30:01.000018
9460
 
3       00:59:22.000024
9461
 
4       05:30:34.000037
9462
 
alter table t66
9463
 
reorganize partition s1 into
9464
 
(partition p0 values less than (second('18:30:14')),
9465
 
partition p1 values less than maxvalue);
9466
 
select * from t66 order by colint;
9467
 
colint  col1
9468
 
1       09:09:15.000002
9469
 
2       04:30:01.000018
9470
 
3       00:59:22.000024
9471
 
4       05:30:34.000037
9472
6529
-------------------------------------------------------------------------
9473
6530
---  Delete rows and partitions of tables with second(col1)
9474
6531
-------------------------------------------------------------------------
9542
6599
3       00:59:22.000024
9543
6600
4       05:30:34.000037
9544
6601
60      14:30:20
9545
 
alter table t1 drop partition p0;
9546
 
alter table t2 drop partition p0;
9547
 
alter table t4 drop partition p0;
9548
 
alter table t5 drop partition p0;
9549
 
alter table t6 drop partition p0;
9550
 
select * from t1 order by col1;
9551
 
col1
9552
 
10:22:33
9553
 
14:30:20
9554
 
select * from t2 order by col1;
9555
 
col1
9556
 
10:22:33
9557
 
14:30:20
9558
 
21:59:22
9559
 
select * from t3 order by col1;
9560
 
col1
9561
 
10:22:33
9562
 
14:30:20
9563
 
21:59:22
9564
 
select * from t4 order by colint;
9565
 
colint  col1
9566
 
60      14:30:20
9567
 
select * from t5 order by colint;
9568
 
colint  col1
9569
 
60      14:30:20
9570
 
select * from t6 order by colint;
9571
 
colint  col1
9572
 
60      14:30:20
9573
6602
-------------------------------------------------------------------------
9574
6603
---  Delete rows and partitions of tables with second(col1)
9575
6604
-------------------------------------------------------------------------
9643
6672
3       00:59:22.000024
9644
6673
4       05:30:34.000037
9645
6674
60      14:30:20
9646
 
alter table t11 drop partition p0;
9647
 
alter table t22 drop partition p0;
9648
 
alter table t44 drop partition p0;
9649
 
alter table t55 drop partition p0;
9650
 
alter table t66 drop partition p0;
9651
 
select * from t11 order by col1;
9652
 
col1
9653
 
10:22:33
9654
 
14:30:20
9655
 
select * from t22 order by col1;
9656
 
col1
9657
 
10:22:33
9658
 
14:30:20
9659
 
21:59:22
9660
 
select * from t33 order by col1;
9661
 
col1
9662
 
10:22:33
9663
 
14:30:20
9664
 
21:59:22
9665
 
select * from t44 order by colint;
9666
 
colint  col1
9667
 
60      14:30:20
9668
 
select * from t55 order by colint;
9669
 
colint  col1
9670
 
60      14:30:20
9671
 
select * from t66 order by colint;
9672
 
colint  col1
9673
 
60      14:30:20
9674
6675
-------------------------
9675
6676
---- some alter table end
9676
6677
-------------------------
9719
6720
(partition p0 values less than (15),
9720
6721
partition p1 values less than maxvalue);
9721
6722
create table t5 (colint int, col1 date) engine='NDB' 
9722
 
partition by list(colint)
 
6723
partition by list(colint) 
9723
6724
subpartition by hash(month(col1)) subpartitions 2 
9724
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
9725
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
9726
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
9727
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
9728
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
9729
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6725
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
6726
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6727
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
6728
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
9730
6729
);
9731
6730
create table t6 (colint int, col1 date) engine='NDB' 
9732
6731
partition by range(colint) 
9743
6742
insert into t3 values ('2006-01-03');
9744
6743
insert into t3 values ('2006-12-17');
9745
6744
insert into t3 values ('2006-05-25');
9746
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
9747
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
9748
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
6745
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
6746
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
6747
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
9749
6748
select month(col1) from t1 order by col1;
9750
6749
month(col1)
9751
6750
1
9856
6855
(partition p0 values less than (15),
9857
6856
partition p1 values less than maxvalue);
9858
6857
alter table t55
9859
 
partition by list(colint)
 
6858
partition by list(colint) 
9860
6859
subpartition by hash(month(col1)) subpartitions 2 
9861
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
9862
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
9863
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
9864
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
9865
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
9866
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6860
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
6861
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6862
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
6863
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
9867
6864
);
9868
6865
alter table t66
9869
6866
partition by range(colint) 
9904
6901
---------------------------
9905
6902
---- some alter table begin
9906
6903
---------------------------
9907
 
alter table t11
9908
 
reorganize partition p0,p1 into
9909
 
(partition s1 values less than maxvalue);
9910
 
select * from t11 order by col1;
9911
 
col1
9912
 
2006-11-06
9913
 
2006-12-17
9914
 
alter table t11
9915
 
reorganize partition s1 into
9916
 
(partition p0 values less than (15),
9917
 
partition p1 values less than maxvalue);
9918
 
select * from t11 order by col1;
9919
 
col1
9920
 
2006-11-06
9921
 
2006-12-17
9922
6904
alter table t55
9923
 
partition by list(colint)
9924
 
subpartition by hash(month(col1)) subpartitions 5 
9925
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
9926
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
9927
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
9928
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
9929
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
9930
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
6905
partition by list(colint) 
 
6906
subpartition by hash(month(col1)) subpartitions 4 
 
6907
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
6908
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
9931
6909
);
9932
6910
show create table t55;
9933
6911
Table   Create Table
9934
6912
t55     CREATE TABLE `t55` (
9935
6913
  `colint` int(11) DEFAULT NULL,
9936
6914
  `col1` date DEFAULT NULL
9937
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
6915
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (month(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
9938
6916
select * from t55 order by colint;
9939
6917
colint  col1
9940
6918
1       2006-02-03
9941
6919
2       2006-01-17
9942
6920
3       2006-01-25
9943
6921
4       2006-02-05
9944
 
alter table t66
9945
 
reorganize partition p0,p1 into
9946
 
(partition s1 values less than maxvalue);
9947
 
select * from t66 order by colint;
9948
 
colint  col1
9949
 
1       2006-02-03
9950
 
2       2006-01-17
9951
 
3       2006-01-25
9952
 
4       2006-02-05
9953
 
alter table t66
9954
 
reorganize partition s1 into
9955
 
(partition p0 values less than (month('2006-10-14')),
9956
 
partition p1 values less than maxvalue);
9957
 
select * from t66 order by colint;
9958
 
colint  col1
9959
 
1       2006-02-03
9960
 
2       2006-01-17
9961
 
3       2006-01-25
9962
 
4       2006-02-05
9963
 
alter table t66
9964
 
reorganize partition p0,p1 into
9965
 
(partition s1 values less than maxvalue);
9966
 
select * from t66 order by colint;
9967
 
colint  col1
9968
 
1       2006-02-03
9969
 
2       2006-01-17
9970
 
3       2006-01-25
9971
 
4       2006-02-05
9972
 
alter table t66
9973
 
reorganize partition s1 into
9974
 
(partition p0 values less than (month('2006-10-14')),
9975
 
partition p1 values less than maxvalue);
9976
 
select * from t66 order by colint;
9977
 
colint  col1
9978
 
1       2006-02-03
9979
 
2       2006-01-17
9980
 
3       2006-01-25
9981
 
4       2006-02-05
9982
6922
-------------------------------------------------------------------------
9983
6923
---  Delete rows and partitions of tables with month(col1)
9984
6924
-------------------------------------------------------------------------
10052
6992
3       2006-01-25
10053
6993
4       2006-02-05
10054
6994
60      2006-12-17
10055
 
alter table t1 drop partition p0;
10056
 
alter table t2 drop partition p0;
10057
 
alter table t4 drop partition p0;
10058
 
alter table t5 drop partition p0;
10059
 
alter table t6 drop partition p0;
10060
 
select * from t1 order by col1;
10061
 
col1
10062
 
select * from t2 order by col1;
10063
 
col1
10064
 
2006-11-06
10065
 
2006-12-17
10066
 
select * from t3 order by col1;
10067
 
col1
10068
 
2006-05-25
10069
 
2006-11-06
10070
 
2006-12-17
10071
 
select * from t4 order by colint;
10072
 
colint  col1
10073
 
60      2006-12-17
10074
 
select * from t5 order by colint;
10075
 
colint  col1
10076
 
60      2006-12-17
10077
 
select * from t6 order by colint;
10078
 
colint  col1
10079
 
60      2006-12-17
10080
6995
-------------------------------------------------------------------------
10081
6996
---  Delete rows and partitions of tables with month(col1)
10082
6997
-------------------------------------------------------------------------
10150
7065
3       2006-01-25
10151
7066
4       2006-02-05
10152
7067
60      2006-12-17
10153
 
alter table t11 drop partition p0;
10154
 
alter table t22 drop partition p0;
10155
 
alter table t44 drop partition p0;
10156
 
alter table t55 drop partition p0;
10157
 
alter table t66 drop partition p0;
10158
 
select * from t11 order by col1;
10159
 
col1
10160
 
select * from t22 order by col1;
10161
 
col1
10162
 
2006-11-06
10163
 
2006-12-17
10164
 
select * from t33 order by col1;
10165
 
col1
10166
 
2006-05-25
10167
 
2006-11-06
10168
 
2006-12-17
10169
 
select * from t44 order by colint;
10170
 
colint  col1
10171
 
60      2006-12-17
10172
 
select * from t55 order by colint;
10173
 
colint  col1
10174
 
60      2006-12-17
10175
 
select * from t66 order by colint;
10176
 
colint  col1
10177
 
60      2006-12-17
10178
7068
-------------------------
10179
7069
---- some alter table end
10180
7070
-------------------------
10223
7113
(partition p0 values less than (15),
10224
7114
partition p1 values less than maxvalue);
10225
7115
create table t5 (colint int, col1 date) engine='NDB' 
10226
 
partition by list(colint)
 
7116
partition by list(colint) 
10227
7117
subpartition by hash(quarter(col1)) subpartitions 2 
10228
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
10229
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
10230
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
10231
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
10232
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
10233
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7118
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
7119
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7120
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
7121
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
10234
7122
);
10235
7123
create table t6 (colint int, col1 date) engine='NDB' 
10236
7124
partition by range(colint) 
10247
7135
insert into t3 values ('2006-01-03');
10248
7136
insert into t3 values ('2006-12-17');
10249
7137
insert into t3 values ('2006-09-25');
10250
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
10251
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
10252
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
7138
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
7139
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
7140
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
10253
7141
select quarter(col1) from t1 order by col1;
10254
7142
quarter(col1)
10255
7143
1
10360
7248
(partition p0 values less than (15),
10361
7249
partition p1 values less than maxvalue);
10362
7250
alter table t55
10363
 
partition by list(colint)
 
7251
partition by list(colint) 
10364
7252
subpartition by hash(quarter(col1)) subpartitions 2 
10365
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
10366
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
10367
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
10368
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
10369
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
10370
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7253
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
7254
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7255
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
7256
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
10371
7257
);
10372
7258
alter table t66
10373
7259
partition by range(colint) 
10408
7294
---------------------------
10409
7295
---- some alter table begin
10410
7296
---------------------------
10411
 
alter table t11
10412
 
reorganize partition p0,p1 into
10413
 
(partition s1 values less than maxvalue);
10414
 
select * from t11 order by col1;
10415
 
col1
10416
 
2006-07-30
10417
 
2006-12-17
10418
 
alter table t11
10419
 
reorganize partition s1 into
10420
 
(partition p0 values less than (15),
10421
 
partition p1 values less than maxvalue);
10422
 
select * from t11 order by col1;
10423
 
col1
10424
 
2006-07-30
10425
 
2006-12-17
10426
7297
alter table t55
10427
 
partition by list(colint)
10428
 
subpartition by hash(quarter(col1)) subpartitions 5 
10429
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
10430
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
10431
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
10432
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
10433
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
10434
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7298
partition by list(colint) 
 
7299
subpartition by hash(quarter(col1)) subpartitions 4 
 
7300
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7301
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
10435
7302
);
10436
7303
show create table t55;
10437
7304
Table   Create Table
10438
7305
t55     CREATE TABLE `t55` (
10439
7306
  `colint` int(11) DEFAULT NULL,
10440
7307
  `col1` date DEFAULT NULL
10441
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
7308
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (quarter(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
10442
7309
select * from t55 order by colint;
10443
7310
colint  col1
10444
7311
1       2006-02-03
10445
7312
2       2006-01-17
10446
7313
3       2006-01-25
10447
7314
4       2006-02-05
10448
 
alter table t66
10449
 
reorganize partition p0,p1 into
10450
 
(partition s1 values less than maxvalue);
10451
 
select * from t66 order by colint;
10452
 
colint  col1
10453
 
1       2006-02-03
10454
 
2       2006-01-17
10455
 
3       2006-01-25
10456
 
4       2006-02-05
10457
 
alter table t66
10458
 
reorganize partition s1 into
10459
 
(partition p0 values less than (quarter('2006-10-14')),
10460
 
partition p1 values less than maxvalue);
10461
 
select * from t66 order by colint;
10462
 
colint  col1
10463
 
1       2006-02-03
10464
 
2       2006-01-17
10465
 
3       2006-01-25
10466
 
4       2006-02-05
10467
 
alter table t66
10468
 
reorganize partition p0,p1 into
10469
 
(partition s1 values less than maxvalue);
10470
 
select * from t66 order by colint;
10471
 
colint  col1
10472
 
1       2006-02-03
10473
 
2       2006-01-17
10474
 
3       2006-01-25
10475
 
4       2006-02-05
10476
 
alter table t66
10477
 
reorganize partition s1 into
10478
 
(partition p0 values less than (quarter('2006-10-14')),
10479
 
partition p1 values less than maxvalue);
10480
 
select * from t66 order by colint;
10481
 
colint  col1
10482
 
1       2006-02-03
10483
 
2       2006-01-17
10484
 
3       2006-01-25
10485
 
4       2006-02-05
10486
7315
-------------------------------------------------------------------------
10487
7316
---  Delete rows and partitions of tables with quarter(col1)
10488
7317
-------------------------------------------------------------------------
10556
7385
3       2006-01-25
10557
7386
4       2006-02-05
10558
7387
60      2006-12-17
10559
 
alter table t1 drop partition p0;
10560
 
alter table t2 drop partition p0;
10561
 
alter table t4 drop partition p0;
10562
 
alter table t5 drop partition p0;
10563
 
alter table t6 drop partition p0;
10564
 
select * from t1 order by col1;
10565
 
col1
10566
 
select * from t2 order by col1;
10567
 
col1
10568
 
select * from t3 order by col1;
10569
 
col1
10570
 
2006-07-30
10571
 
2006-09-25
10572
 
2006-12-17
10573
 
select * from t4 order by colint;
10574
 
colint  col1
10575
 
60      2006-12-17
10576
 
select * from t5 order by colint;
10577
 
colint  col1
10578
 
60      2006-12-17
10579
 
select * from t6 order by colint;
10580
 
colint  col1
10581
 
4       2006-02-05
10582
 
60      2006-12-17
10583
7388
-------------------------------------------------------------------------
10584
7389
---  Delete rows and partitions of tables with quarter(col1)
10585
7390
-------------------------------------------------------------------------
10653
7458
3       2006-01-25
10654
7459
4       2006-02-05
10655
7460
60      2006-12-17
10656
 
alter table t11 drop partition p0;
10657
 
alter table t22 drop partition p0;
10658
 
alter table t44 drop partition p0;
10659
 
alter table t55 drop partition p0;
10660
 
alter table t66 drop partition p0;
10661
 
select * from t11 order by col1;
10662
 
col1
10663
 
select * from t22 order by col1;
10664
 
col1
10665
 
select * from t33 order by col1;
10666
 
col1
10667
 
2006-07-30
10668
 
2006-09-25
10669
 
2006-12-17
10670
 
select * from t44 order by colint;
10671
 
colint  col1
10672
 
60      2006-12-17
10673
 
select * from t55 order by colint;
10674
 
colint  col1
10675
 
60      2006-12-17
10676
 
select * from t66 order by colint;
10677
 
colint  col1
10678
 
4       2006-02-05
10679
 
60      2006-12-17
10680
7461
-------------------------
10681
7462
---- some alter table end
10682
7463
-------------------------
10725
7506
(partition p0 values less than (15),
10726
7507
partition p1 values less than maxvalue);
10727
7508
create table t5 (colint int, col1 time) engine='NDB' 
10728
 
partition by list(colint)
 
7509
partition by list(colint) 
10729
7510
subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 
10730
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
10731
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
10732
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
10733
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
10734
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
10735
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7511
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
7512
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7513
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
7514
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
10736
7515
);
10737
7516
create table t6 (colint int, col1 time) engine='NDB' 
10738
7517
partition by range(colint) 
10749
7528
insert into t3 values ('09:09:15');
10750
7529
insert into t3 values ('14:30:45');
10751
7530
insert into t3 values ('21:59:22');
10752
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t4;
10753
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t5;
10754
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_time.in' into table t6;
 
7531
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t4;
 
7532
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t5;
 
7533
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_time.inc' into table t6;
10755
7534
select time_to_sec(col1)-(time_to_sec(col1)-20) from t1 order by col1;
10756
7535
time_to_sec(col1)-(time_to_sec(col1)-20)
10757
7536
20
10862
7641
(partition p0 values less than (15),
10863
7642
partition p1 values less than maxvalue);
10864
7643
alter table t55
10865
 
partition by list(colint)
 
7644
partition by list(colint) 
10866
7645
subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 2 
10867
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
10868
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
10869
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
10870
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
10871
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
10872
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7646
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
7647
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7648
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
7649
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
10873
7650
);
10874
7651
alter table t66
10875
7652
partition by range(colint) 
10910
7687
---------------------------
10911
7688
---- some alter table begin
10912
7689
---------------------------
10913
 
alter table t11
10914
 
reorganize partition p0,p1 into
10915
 
(partition s1 values less than maxvalue);
10916
 
select * from t11 order by col1;
10917
 
col1
10918
 
10:33:11
10919
 
14:30:45
10920
 
alter table t11
10921
 
reorganize partition s1 into
10922
 
(partition p0 values less than (15),
10923
 
partition p1 values less than maxvalue);
10924
 
select * from t11 order by col1;
10925
 
col1
10926
 
10:33:11
10927
 
14:30:45
10928
7690
alter table t55
10929
 
partition by list(colint)
10930
 
subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 5 
10931
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
10932
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
10933
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
10934
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
10935
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
10936
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7691
partition by list(colint) 
 
7692
subpartition by hash(time_to_sec(col1)-(time_to_sec(col1)-20)) subpartitions 4 
 
7693
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7694
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
10937
7695
);
10938
7696
show create table t55;
10939
7697
Table   Create Table
10940
7698
t55     CREATE TABLE `t55` (
10941
7699
  `colint` int(11) DEFAULT NULL,
10942
7700
  `col1` time DEFAULT NULL
10943
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
7701
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (time_to_sec(col1)-(time_to_sec(col1)-20)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
10944
7702
select * from t55 order by colint;
10945
7703
colint  col1
10946
7704
1       10:33:11
10947
7705
2       04:30:01
10948
7706
3       00:59:22
10949
7707
4       05:30:34
10950
 
alter table t66
10951
 
reorganize partition p0,p1 into
10952
 
(partition s1 values less than maxvalue);
10953
 
select * from t66 order by colint;
10954
 
colint  col1
10955
 
1       10:33:11
10956
 
2       04:30:01
10957
 
3       00:59:22
10958
 
4       05:30:34
10959
 
alter table t66
10960
 
reorganize partition s1 into
10961
 
(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))),
10962
 
partition p1 values less than maxvalue);
10963
 
select * from t66 order by colint;
10964
 
colint  col1
10965
 
1       10:33:11
10966
 
2       04:30:01
10967
 
3       00:59:22
10968
 
4       05:30:34
10969
 
alter table t66
10970
 
reorganize partition p0,p1 into
10971
 
(partition s1 values less than maxvalue);
10972
 
select * from t66 order by colint;
10973
 
colint  col1
10974
 
1       10:33:11
10975
 
2       04:30:01
10976
 
3       00:59:22
10977
 
4       05:30:34
10978
 
alter table t66
10979
 
reorganize partition s1 into
10980
 
(partition p0 values less than (time_to_sec('18:30:14')-(time_to_sec('17:59:59'))),
10981
 
partition p1 values less than maxvalue);
10982
 
select * from t66 order by colint;
10983
 
colint  col1
10984
 
1       10:33:11
10985
 
2       04:30:01
10986
 
3       00:59:22
10987
 
4       05:30:34
10988
7708
-------------------------------------------------------------------------
10989
7709
---  Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20)
10990
7710
-------------------------------------------------------------------------
11058
7778
3       00:59:22
11059
7779
4       05:30:34
11060
7780
60      14:30:45
11061
 
alter table t1 drop partition p0;
11062
 
alter table t2 drop partition p0;
11063
 
alter table t4 drop partition p0;
11064
 
alter table t5 drop partition p0;
11065
 
alter table t6 drop partition p0;
11066
 
select * from t1 order by col1;
11067
 
col1
11068
 
10:33:11
11069
 
14:30:45
11070
 
select * from t2 order by col1;
11071
 
col1
11072
 
10:33:11
11073
 
14:30:45
11074
 
21:59:22
11075
 
select * from t3 order by col1;
11076
 
col1
11077
 
10:33:11
11078
 
14:30:45
11079
 
21:59:22
11080
 
select * from t4 order by colint;
11081
 
colint  col1
11082
 
60      14:30:45
11083
 
select * from t5 order by colint;
11084
 
colint  col1
11085
 
60      14:30:45
11086
 
select * from t6 order by colint;
11087
 
colint  col1
11088
7781
-------------------------------------------------------------------------
11089
7782
---  Delete rows and partitions of tables with time_to_sec(col1)-(time_to_sec(col1)-20)
11090
7783
-------------------------------------------------------------------------
11158
7851
3       00:59:22
11159
7852
4       05:30:34
11160
7853
60      14:30:45
11161
 
alter table t11 drop partition p0;
11162
 
alter table t22 drop partition p0;
11163
 
alter table t44 drop partition p0;
11164
 
alter table t55 drop partition p0;
11165
 
alter table t66 drop partition p0;
11166
 
select * from t11 order by col1;
11167
 
col1
11168
 
10:33:11
11169
 
14:30:45
11170
 
select * from t22 order by col1;
11171
 
col1
11172
 
10:33:11
11173
 
14:30:45
11174
 
21:59:22
11175
 
select * from t33 order by col1;
11176
 
col1
11177
 
10:33:11
11178
 
14:30:45
11179
 
21:59:22
11180
 
select * from t44 order by colint;
11181
 
colint  col1
11182
 
60      14:30:45
11183
 
select * from t55 order by colint;
11184
 
colint  col1
11185
 
60      14:30:45
11186
 
select * from t66 order by colint;
11187
 
colint  col1
11188
7854
-------------------------
11189
7855
---- some alter table end
11190
7856
-------------------------
11233
7899
(partition p0 values less than (15),
11234
7900
partition p1 values less than maxvalue);
11235
7901
create table t5 (colint int, col1 date) engine='NDB' 
11236
 
partition by list(colint)
 
7902
partition by list(colint) 
11237
7903
subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 
11238
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
11239
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
11240
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
11241
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
11242
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
11243
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
7904
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
7905
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
7906
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
7907
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
11244
7908
);
11245
7909
create table t6 (colint int, col1 date) engine='NDB' 
11246
7910
partition by range(colint) 
11257
7921
insert into t3 values ('2006-02-03');
11258
7922
insert into t3 values ('2006-01-17');
11259
7923
insert into t3 values ('2006-01-25');
11260
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
11261
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
11262
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
7924
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
7925
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
7926
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
11263
7927
select to_days(col1)-to_days('2006-01-01') from t1 order by col1;
11264
7928
to_days(col1)-to_days('2006-01-01')
11265
7929
16
11370
8034
(partition p0 values less than (15),
11371
8035
partition p1 values less than maxvalue);
11372
8036
alter table t55
11373
 
partition by list(colint)
 
8037
partition by list(colint) 
11374
8038
subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 2 
11375
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
11376
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
11377
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
11378
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
11379
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
11380
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
11381
 
);
11382
 
alter table t66
11383
 
partition by range(colint) 
11384
 
(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
11385
 
partition p1 values less than maxvalue);
11386
 
select * from t11 order by col1;
11387
 
col1
11388
 
2006-01-17
11389
 
2006-02-06
11390
 
select * from t22 order by col1;
11391
 
col1
11392
 
2006-01-17
11393
 
2006-01-25
11394
 
2006-02-06
11395
 
select * from t33 order by col1;
11396
 
col1
11397
 
2006-01-17
11398
 
2006-01-25
11399
 
2006-02-06
11400
 
select * from t44 order by colint;
11401
 
colint  col1
11402
 
1       2006-02-06
11403
 
2       2006-01-17
11404
 
3       2006-01-25
11405
 
4       2006-02-05
11406
 
select * from t55 order by colint;
11407
 
colint  col1
11408
 
1       2006-02-06
11409
 
2       2006-01-17
11410
 
3       2006-01-25
11411
 
4       2006-02-05
11412
 
select * from t66 order by colint;
11413
 
colint  col1
11414
 
1       2006-02-06
11415
 
2       2006-01-17
11416
 
3       2006-01-25
11417
 
4       2006-02-05
11418
 
---------------------------
11419
 
---- some alter table begin
11420
 
---------------------------
11421
 
alter table t11
11422
 
reorganize partition p0,p1 into
11423
 
(partition s1 values less than maxvalue);
11424
 
select * from t11 order by col1;
11425
 
col1
11426
 
2006-01-17
11427
 
2006-02-06
11428
 
alter table t11
11429
 
reorganize partition s1 into
11430
 
(partition p0 values less than (15),
11431
 
partition p1 values less than maxvalue);
11432
 
select * from t11 order by col1;
11433
 
col1
11434
 
2006-01-17
11435
 
2006-02-06
11436
 
alter table t55
11437
 
partition by list(colint)
11438
 
subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 5 
11439
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
11440
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
11441
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
11442
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
11443
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
11444
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
11445
 
);
11446
 
show create table t55;
11447
 
Table   Create Table
11448
 
t55     CREATE TABLE `t55` (
11449
 
  `colint` int(11) DEFAULT NULL,
11450
 
  `col1` date DEFAULT NULL
11451
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
11452
 
select * from t55 order by colint;
11453
 
colint  col1
11454
 
1       2006-02-06
11455
 
2       2006-01-17
11456
 
3       2006-01-25
11457
 
4       2006-02-05
11458
 
alter table t66
11459
 
reorganize partition p0,p1 into
11460
 
(partition s1 values less than maxvalue);
11461
 
select * from t66 order by colint;
11462
 
colint  col1
11463
 
1       2006-02-06
11464
 
2       2006-01-17
11465
 
3       2006-01-25
11466
 
4       2006-02-05
11467
 
alter table t66
11468
 
reorganize partition s1 into
11469
 
(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
11470
 
partition p1 values less than maxvalue);
11471
 
select * from t66 order by colint;
11472
 
colint  col1
11473
 
1       2006-02-06
11474
 
2       2006-01-17
11475
 
3       2006-01-25
11476
 
4       2006-02-05
11477
 
alter table t66
11478
 
reorganize partition p0,p1 into
11479
 
(partition s1 values less than maxvalue);
11480
 
select * from t66 order by colint;
11481
 
colint  col1
11482
 
1       2006-02-06
11483
 
2       2006-01-17
11484
 
3       2006-01-25
11485
 
4       2006-02-05
11486
 
alter table t66
11487
 
reorganize partition s1 into
11488
 
(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
11489
 
partition p1 values less than maxvalue);
11490
 
select * from t66 order by colint;
11491
 
colint  col1
11492
 
1       2006-02-06
11493
 
2       2006-01-17
11494
 
3       2006-01-25
11495
 
4       2006-02-05
11496
 
-------------------------------------------------------------------------
11497
 
---  Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
11498
 
-------------------------------------------------------------------------
11499
 
delete from t1 where col1='2006-01-17';
11500
 
delete from t2 where col1='2006-01-17';
11501
 
delete from t3 where col1='2006-01-17';
11502
 
delete from t4 where col1='2006-01-17';
11503
 
delete from t5 where col1='2006-01-17';
11504
 
delete from t6 where col1='2006-01-17';
11505
 
select * from t1 order by col1;
11506
 
col1
11507
 
2006-02-06
11508
 
select * from t2 order by col1;
11509
 
col1
11510
 
2006-01-25
11511
 
2006-02-06
11512
 
select * from t3 order by col1;
11513
 
col1
11514
 
2006-01-25
11515
 
2006-02-06
11516
 
select * from t4 order by colint;
11517
 
colint  col1
11518
 
1       2006-02-06
11519
 
3       2006-01-25
11520
 
4       2006-02-05
11521
 
select * from t5 order by colint;
11522
 
colint  col1
11523
 
1       2006-02-06
11524
 
3       2006-01-25
11525
 
4       2006-02-05
11526
 
insert into t1 values ('2006-01-17');
11527
 
insert into t2 values ('2006-01-17');
11528
 
insert into t3 values ('2006-01-17');
11529
 
insert into t4 values (60,'2006-01-17');
11530
 
insert into t5 values (60,'2006-01-17');
11531
 
insert into t6 values (60,'2006-01-17');
11532
 
select * from t1 order by col1;
11533
 
col1
11534
 
2006-01-17
11535
 
2006-02-06
11536
 
select * from t2 order by col1;
11537
 
col1
11538
 
2006-01-17
11539
 
2006-01-25
11540
 
2006-02-06
11541
 
select * from t3 order by col1;
11542
 
col1
11543
 
2006-01-17
11544
 
2006-01-25
11545
 
2006-02-06
11546
 
select * from t4 order by colint;
11547
 
colint  col1
11548
 
1       2006-02-06
11549
 
3       2006-01-25
11550
 
4       2006-02-05
11551
 
60      2006-01-17
11552
 
select * from t5 order by colint;
11553
 
colint  col1
11554
 
1       2006-02-06
11555
 
3       2006-01-25
11556
 
4       2006-02-05
11557
 
60      2006-01-17
11558
 
select * from t6 order by colint;
11559
 
colint  col1
11560
 
1       2006-02-06
11561
 
3       2006-01-25
11562
 
4       2006-02-05
11563
 
60      2006-01-17
11564
 
alter table t1 drop partition p0;
11565
 
alter table t2 drop partition p0;
11566
 
alter table t4 drop partition p0;
11567
 
alter table t5 drop partition p0;
11568
 
alter table t6 drop partition p0;
11569
 
select * from t1 order by col1;
11570
 
col1
11571
 
2006-01-17
11572
 
2006-02-06
11573
 
select * from t2 order by col1;
11574
 
col1
11575
 
2006-01-17
11576
 
2006-01-25
11577
 
2006-02-06
11578
 
select * from t3 order by col1;
11579
 
col1
11580
 
2006-01-17
11581
 
2006-01-25
11582
 
2006-02-06
11583
 
select * from t4 order by colint;
11584
 
colint  col1
11585
 
60      2006-01-17
11586
 
select * from t5 order by colint;
11587
 
colint  col1
11588
 
60      2006-01-17
11589
 
select * from t6 order by colint;
11590
 
colint  col1
11591
 
60      2006-01-17
11592
 
-------------------------------------------------------------------------
11593
 
---  Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
11594
 
-------------------------------------------------------------------------
11595
 
delete from t11 where col1='2006-01-17';
11596
 
delete from t22 where col1='2006-01-17';
11597
 
delete from t33 where col1='2006-01-17';
11598
 
delete from t44 where col1='2006-01-17';
11599
 
delete from t55 where col1='2006-01-17';
11600
 
delete from t66 where col1='2006-01-17';
11601
 
select * from t11 order by col1;
11602
 
col1
11603
 
2006-02-06
11604
 
select * from t22 order by col1;
11605
 
col1
11606
 
2006-01-25
11607
 
2006-02-06
11608
 
select * from t33 order by col1;
11609
 
col1
11610
 
2006-01-25
11611
 
2006-02-06
11612
 
select * from t44 order by colint;
11613
 
colint  col1
11614
 
1       2006-02-06
11615
 
3       2006-01-25
11616
 
4       2006-02-05
11617
 
select * from t55 order by colint;
11618
 
colint  col1
11619
 
1       2006-02-06
11620
 
3       2006-01-25
11621
 
4       2006-02-05
11622
 
insert into t11 values ('2006-01-17');
11623
 
insert into t22 values ('2006-01-17');
11624
 
insert into t33 values ('2006-01-17');
11625
 
insert into t44 values (60,'2006-01-17');
11626
 
insert into t55 values (60,'2006-01-17');
11627
 
insert into t66 values (60,'2006-01-17');
11628
 
select * from t11 order by col1;
11629
 
col1
11630
 
2006-01-17
11631
 
2006-02-06
11632
 
select * from t22 order by col1;
11633
 
col1
11634
 
2006-01-17
11635
 
2006-01-25
11636
 
2006-02-06
11637
 
select * from t33 order by col1;
11638
 
col1
11639
 
2006-01-17
11640
 
2006-01-25
11641
 
2006-02-06
11642
 
select * from t44 order by colint;
11643
 
colint  col1
11644
 
1       2006-02-06
11645
 
3       2006-01-25
11646
 
4       2006-02-05
11647
 
60      2006-01-17
11648
 
select * from t55 order by colint;
11649
 
colint  col1
11650
 
1       2006-02-06
11651
 
3       2006-01-25
11652
 
4       2006-02-05
11653
 
60      2006-01-17
11654
 
select * from t66 order by colint;
11655
 
colint  col1
11656
 
1       2006-02-06
11657
 
3       2006-01-25
11658
 
4       2006-02-05
11659
 
60      2006-01-17
11660
 
alter table t11 drop partition p0;
11661
 
alter table t22 drop partition p0;
11662
 
alter table t44 drop partition p0;
11663
 
alter table t55 drop partition p0;
11664
 
alter table t66 drop partition p0;
11665
 
select * from t11 order by col1;
11666
 
col1
11667
 
2006-01-17
11668
 
2006-02-06
11669
 
select * from t22 order by col1;
11670
 
col1
11671
 
2006-01-17
11672
 
2006-01-25
11673
 
2006-02-06
11674
 
select * from t33 order by col1;
11675
 
col1
11676
 
2006-01-17
11677
 
2006-01-25
11678
 
2006-02-06
11679
 
select * from t44 order by colint;
11680
 
colint  col1
11681
 
60      2006-01-17
11682
 
select * from t55 order by colint;
11683
 
colint  col1
11684
 
60      2006-01-17
11685
 
select * from t66 order by colint;
11686
 
colint  col1
 
8039
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
8040
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8041
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
8042
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
 
8043
);
 
8044
alter table t66
 
8045
partition by range(colint) 
 
8046
(partition p0 values less than (to_days('2006-02-02')-to_days('2006-01-01')),
 
8047
partition p1 values less than maxvalue);
 
8048
select * from t11 order by col1;
 
8049
col1
 
8050
2006-01-17
 
8051
2006-02-06
 
8052
select * from t22 order by col1;
 
8053
col1
 
8054
2006-01-17
 
8055
2006-01-25
 
8056
2006-02-06
 
8057
select * from t33 order by col1;
 
8058
col1
 
8059
2006-01-17
 
8060
2006-01-25
 
8061
2006-02-06
 
8062
select * from t44 order by colint;
 
8063
colint  col1
 
8064
1       2006-02-06
 
8065
2       2006-01-17
 
8066
3       2006-01-25
 
8067
4       2006-02-05
 
8068
select * from t55 order by colint;
 
8069
colint  col1
 
8070
1       2006-02-06
 
8071
2       2006-01-17
 
8072
3       2006-01-25
 
8073
4       2006-02-05
 
8074
select * from t66 order by colint;
 
8075
colint  col1
 
8076
1       2006-02-06
 
8077
2       2006-01-17
 
8078
3       2006-01-25
 
8079
4       2006-02-05
 
8080
---------------------------
 
8081
---- some alter table begin
 
8082
---------------------------
 
8083
alter table t55
 
8084
partition by list(colint) 
 
8085
subpartition by hash(to_days(col1)-to_days('2006-01-01')) subpartitions 4 
 
8086
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8087
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
 
8088
);
 
8089
show create table t55;
 
8090
Table   Create Table
 
8091
t55     CREATE TABLE `t55` (
 
8092
  `colint` int(11) DEFAULT NULL,
 
8093
  `col1` date DEFAULT NULL
 
8094
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (to_days(col1)-to_days('2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
 
8095
select * from t55 order by colint;
 
8096
colint  col1
 
8097
1       2006-02-06
 
8098
2       2006-01-17
 
8099
3       2006-01-25
 
8100
4       2006-02-05
 
8101
-------------------------------------------------------------------------
 
8102
---  Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
 
8103
-------------------------------------------------------------------------
 
8104
delete from t1 where col1='2006-01-17';
 
8105
delete from t2 where col1='2006-01-17';
 
8106
delete from t3 where col1='2006-01-17';
 
8107
delete from t4 where col1='2006-01-17';
 
8108
delete from t5 where col1='2006-01-17';
 
8109
delete from t6 where col1='2006-01-17';
 
8110
select * from t1 order by col1;
 
8111
col1
 
8112
2006-02-06
 
8113
select * from t2 order by col1;
 
8114
col1
 
8115
2006-01-25
 
8116
2006-02-06
 
8117
select * from t3 order by col1;
 
8118
col1
 
8119
2006-01-25
 
8120
2006-02-06
 
8121
select * from t4 order by colint;
 
8122
colint  col1
 
8123
1       2006-02-06
 
8124
3       2006-01-25
 
8125
4       2006-02-05
 
8126
select * from t5 order by colint;
 
8127
colint  col1
 
8128
1       2006-02-06
 
8129
3       2006-01-25
 
8130
4       2006-02-05
 
8131
insert into t1 values ('2006-01-17');
 
8132
insert into t2 values ('2006-01-17');
 
8133
insert into t3 values ('2006-01-17');
 
8134
insert into t4 values (60,'2006-01-17');
 
8135
insert into t5 values (60,'2006-01-17');
 
8136
insert into t6 values (60,'2006-01-17');
 
8137
select * from t1 order by col1;
 
8138
col1
 
8139
2006-01-17
 
8140
2006-02-06
 
8141
select * from t2 order by col1;
 
8142
col1
 
8143
2006-01-17
 
8144
2006-01-25
 
8145
2006-02-06
 
8146
select * from t3 order by col1;
 
8147
col1
 
8148
2006-01-17
 
8149
2006-01-25
 
8150
2006-02-06
 
8151
select * from t4 order by colint;
 
8152
colint  col1
 
8153
1       2006-02-06
 
8154
3       2006-01-25
 
8155
4       2006-02-05
 
8156
60      2006-01-17
 
8157
select * from t5 order by colint;
 
8158
colint  col1
 
8159
1       2006-02-06
 
8160
3       2006-01-25
 
8161
4       2006-02-05
 
8162
60      2006-01-17
 
8163
select * from t6 order by colint;
 
8164
colint  col1
 
8165
1       2006-02-06
 
8166
3       2006-01-25
 
8167
4       2006-02-05
 
8168
60      2006-01-17
 
8169
-------------------------------------------------------------------------
 
8170
---  Delete rows and partitions of tables with to_days(col1)-to_days('2006-01-01')
 
8171
-------------------------------------------------------------------------
 
8172
delete from t11 where col1='2006-01-17';
 
8173
delete from t22 where col1='2006-01-17';
 
8174
delete from t33 where col1='2006-01-17';
 
8175
delete from t44 where col1='2006-01-17';
 
8176
delete from t55 where col1='2006-01-17';
 
8177
delete from t66 where col1='2006-01-17';
 
8178
select * from t11 order by col1;
 
8179
col1
 
8180
2006-02-06
 
8181
select * from t22 order by col1;
 
8182
col1
 
8183
2006-01-25
 
8184
2006-02-06
 
8185
select * from t33 order by col1;
 
8186
col1
 
8187
2006-01-25
 
8188
2006-02-06
 
8189
select * from t44 order by colint;
 
8190
colint  col1
 
8191
1       2006-02-06
 
8192
3       2006-01-25
 
8193
4       2006-02-05
 
8194
select * from t55 order by colint;
 
8195
colint  col1
 
8196
1       2006-02-06
 
8197
3       2006-01-25
 
8198
4       2006-02-05
 
8199
insert into t11 values ('2006-01-17');
 
8200
insert into t22 values ('2006-01-17');
 
8201
insert into t33 values ('2006-01-17');
 
8202
insert into t44 values (60,'2006-01-17');
 
8203
insert into t55 values (60,'2006-01-17');
 
8204
insert into t66 values (60,'2006-01-17');
 
8205
select * from t11 order by col1;
 
8206
col1
 
8207
2006-01-17
 
8208
2006-02-06
 
8209
select * from t22 order by col1;
 
8210
col1
 
8211
2006-01-17
 
8212
2006-01-25
 
8213
2006-02-06
 
8214
select * from t33 order by col1;
 
8215
col1
 
8216
2006-01-17
 
8217
2006-01-25
 
8218
2006-02-06
 
8219
select * from t44 order by colint;
 
8220
colint  col1
 
8221
1       2006-02-06
 
8222
3       2006-01-25
 
8223
4       2006-02-05
 
8224
60      2006-01-17
 
8225
select * from t55 order by colint;
 
8226
colint  col1
 
8227
1       2006-02-06
 
8228
3       2006-01-25
 
8229
4       2006-02-05
 
8230
60      2006-01-17
 
8231
select * from t66 order by colint;
 
8232
colint  col1
 
8233
1       2006-02-06
 
8234
3       2006-01-25
 
8235
4       2006-02-05
 
8236
60      2006-01-17
 
8237
-------------------------
 
8238
---- some alter table end
 
8239
-------------------------
 
8240
drop table if exists t1 ;
 
8241
drop table if exists t2 ;
 
8242
drop table if exists t3 ;
 
8243
drop table if exists t4 ;
 
8244
drop table if exists t5 ;
 
8245
drop table if exists t6 ;
 
8246
drop table if exists t11 ;
 
8247
drop table if exists t22 ;
 
8248
drop table if exists t33 ;
 
8249
drop table if exists t44 ;
 
8250
drop table if exists t55 ;
 
8251
drop table if exists t66 ;
 
8252
-------------------------------------------------------------------------
 
8253
---  datediff(col1, '2006-01-01')  in partition with coltype  date
 
8254
-------------------------------------------------------------------------
 
8255
drop table if exists t1 ;
 
8256
drop table if exists t2 ;
 
8257
drop table if exists t3 ;
 
8258
drop table if exists t4 ;
 
8259
drop table if exists t5 ;
 
8260
drop table if exists t6 ;
 
8261
-------------------------------------------------------------------------
 
8262
---  Create tables with datediff(col1, '2006-01-01')
 
8263
-------------------------------------------------------------------------
 
8264
create table t1 (col1 date) engine='NDB' 
 
8265
partition by range(datediff(col1, '2006-01-01')) 
 
8266
(partition p0 values less than (15),
 
8267
partition p1 values less than maxvalue);
 
8268
create table t2 (col1 date) engine='NDB' 
 
8269
partition by list(datediff(col1, '2006-01-01')) 
 
8270
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
 
8271
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 
8272
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
 
8273
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
 
8274
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
 
8275
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
8276
);
 
8277
create table t3 (col1 date) engine='NDB' 
 
8278
partition by hash(datediff(col1, '2006-01-01'));
 
8279
create table t4 (colint int, col1 date) engine='NDB' 
 
8280
partition by range(colint) 
 
8281
subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 
 
8282
(partition p0 values less than (15),
 
8283
partition p1 values less than maxvalue);
 
8284
create table t5 (colint int, col1 date) engine='NDB' 
 
8285
partition by list(colint) 
 
8286
subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 
 
8287
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
8288
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8289
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
8290
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
 
8291
);
 
8292
create table t6 (colint int, col1 date) engine='NDB' 
 
8293
partition by range(colint) 
 
8294
(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
 
8295
partition p1 values less than maxvalue);
 
8296
-------------------------------------------------------------------------
 
8297
---  Access tables with datediff(col1, '2006-01-01') 
 
8298
-------------------------------------------------------------------------
 
8299
insert into t1 values ('2006-02-03');
 
8300
insert into t1 values ('2006-01-17');
 
8301
insert into t2 values ('2006-02-03');
 
8302
insert into t2 values ('2006-01-17');
 
8303
insert into t2 values ('2006-01-25');
 
8304
insert into t3 values ('2006-02-03');
 
8305
insert into t3 values ('2006-01-17');
 
8306
insert into t3 values ('2006-01-25');
 
8307
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
8308
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
8309
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
 
8310
select datediff(col1, '2006-01-01') from t1 order by col1;
 
8311
datediff(col1, '2006-01-01')
 
8312
16
 
8313
33
 
8314
select * from t1 order by col1;
 
8315
col1
 
8316
2006-01-17
 
8317
2006-02-03
 
8318
select * from t2 order by col1;
 
8319
col1
 
8320
2006-01-17
 
8321
2006-01-25
 
8322
2006-02-03
 
8323
select * from t3 order by col1;
 
8324
col1
 
8325
2006-01-17
 
8326
2006-01-25
 
8327
2006-02-03
 
8328
select * from t4 order by colint;
 
8329
colint  col1
 
8330
1       2006-02-03
 
8331
2       2006-01-17
 
8332
3       2006-01-25
 
8333
4       2006-02-05
 
8334
select * from t5 order by colint;
 
8335
colint  col1
 
8336
1       2006-02-03
 
8337
2       2006-01-17
 
8338
3       2006-01-25
 
8339
4       2006-02-05
 
8340
select * from t6 order by colint;
 
8341
colint  col1
 
8342
1       2006-02-03
 
8343
2       2006-01-17
 
8344
3       2006-01-25
 
8345
4       2006-02-05
 
8346
update t1 set col1='2006-02-06' where col1='2006-02-03';
 
8347
update t2 set col1='2006-02-06' where col1='2006-02-03';
 
8348
update t3 set col1='2006-02-06' where col1='2006-02-03';
 
8349
update t4 set col1='2006-02-06' where col1='2006-02-03';
 
8350
update t5 set col1='2006-02-06' where col1='2006-02-03';
 
8351
update t6 set col1='2006-02-06' where col1='2006-02-03';
 
8352
select * from t1 order by col1;
 
8353
col1
 
8354
2006-01-17
 
8355
2006-02-06
 
8356
select * from t2 order by col1;
 
8357
col1
 
8358
2006-01-17
 
8359
2006-01-25
 
8360
2006-02-06
 
8361
select * from t3 order by col1;
 
8362
col1
 
8363
2006-01-17
 
8364
2006-01-25
 
8365
2006-02-06
 
8366
select * from t4 order by colint;
 
8367
colint  col1
 
8368
1       2006-02-06
 
8369
2       2006-01-17
 
8370
3       2006-01-25
 
8371
4       2006-02-05
 
8372
select * from t5 order by colint;
 
8373
colint  col1
 
8374
1       2006-02-06
 
8375
2       2006-01-17
 
8376
3       2006-01-25
 
8377
4       2006-02-05
 
8378
select * from t6 order by colint;
 
8379
colint  col1
 
8380
1       2006-02-06
 
8381
2       2006-01-17
 
8382
3       2006-01-25
 
8383
4       2006-02-05
 
8384
-------------------------------------------------------------------------
 
8385
---  Alter tables with datediff(col1, '2006-01-01')
 
8386
-------------------------------------------------------------------------
 
8387
drop table if exists t11 ;
 
8388
drop table if exists t22 ;
 
8389
drop table if exists t33 ;
 
8390
drop table if exists t44 ;
 
8391
drop table if exists t55 ;
 
8392
drop table if exists t66 ;
 
8393
create table t11 engine='NDB' as select * from t1;
 
8394
create table t22 engine='NDB' as select * from t2;
 
8395
create table t33 engine='NDB' as select * from t3;
 
8396
create table t44 engine='NDB' as select * from t4;
 
8397
create table t55 engine='NDB' as select * from t5;
 
8398
create table t66 engine='NDB' as select * from t6;
 
8399
alter table t11
 
8400
partition by range(datediff(col1, '2006-01-01')) 
 
8401
(partition p0 values less than (15),
 
8402
partition p1 values less than maxvalue);
 
8403
alter table t22
 
8404
partition by list(datediff(col1, '2006-01-01')) 
 
8405
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
 
8406
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
 
8407
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
 
8408
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
 
8409
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
 
8410
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
8411
);
 
8412
alter table t33
 
8413
partition by hash(datediff(col1, '2006-01-01'));
 
8414
alter table t44
 
8415
partition by range(colint) 
 
8416
subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 
 
8417
(partition p0 values less than (15),
 
8418
partition p1 values less than maxvalue);
 
8419
alter table t55
 
8420
partition by list(colint) 
 
8421
subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 2 
 
8422
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
8423
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8424
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
8425
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
 
8426
);
 
8427
alter table t66
 
8428
partition by range(colint) 
 
8429
(partition p0 values less than (datediff('2006-02-02', '2006-01-01')),
 
8430
partition p1 values less than maxvalue);
 
8431
select * from t11 order by col1;
 
8432
col1
 
8433
2006-01-17
 
8434
2006-02-06
 
8435
select * from t22 order by col1;
 
8436
col1
 
8437
2006-01-17
 
8438
2006-01-25
 
8439
2006-02-06
 
8440
select * from t33 order by col1;
 
8441
col1
 
8442
2006-01-17
 
8443
2006-01-25
 
8444
2006-02-06
 
8445
select * from t44 order by colint;
 
8446
colint  col1
 
8447
1       2006-02-06
 
8448
2       2006-01-17
 
8449
3       2006-01-25
 
8450
4       2006-02-05
 
8451
select * from t55 order by colint;
 
8452
colint  col1
 
8453
1       2006-02-06
 
8454
2       2006-01-17
 
8455
3       2006-01-25
 
8456
4       2006-02-05
 
8457
select * from t66 order by colint;
 
8458
colint  col1
 
8459
1       2006-02-06
 
8460
2       2006-01-17
 
8461
3       2006-01-25
 
8462
4       2006-02-05
 
8463
---------------------------
 
8464
---- some alter table begin
 
8465
---------------------------
 
8466
alter table t55
 
8467
partition by list(colint) 
 
8468
subpartition by hash(datediff(col1, '2006-01-01')) subpartitions 4 
 
8469
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8470
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
 
8471
);
 
8472
show create table t55;
 
8473
Table   Create Table
 
8474
t55     CREATE TABLE `t55` (
 
8475
  `colint` int(11) DEFAULT NULL,
 
8476
  `col1` date DEFAULT NULL
 
8477
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (datediff(col1, '2006-01-01')) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
 
8478
select * from t55 order by colint;
 
8479
colint  col1
 
8480
1       2006-02-06
 
8481
2       2006-01-17
 
8482
3       2006-01-25
 
8483
4       2006-02-05
 
8484
-------------------------------------------------------------------------
 
8485
---  Delete rows and partitions of tables with datediff(col1, '2006-01-01')
 
8486
-------------------------------------------------------------------------
 
8487
delete from t1 where col1='2006-01-17';
 
8488
delete from t2 where col1='2006-01-17';
 
8489
delete from t3 where col1='2006-01-17';
 
8490
delete from t4 where col1='2006-01-17';
 
8491
delete from t5 where col1='2006-01-17';
 
8492
delete from t6 where col1='2006-01-17';
 
8493
select * from t1 order by col1;
 
8494
col1
 
8495
2006-02-06
 
8496
select * from t2 order by col1;
 
8497
col1
 
8498
2006-01-25
 
8499
2006-02-06
 
8500
select * from t3 order by col1;
 
8501
col1
 
8502
2006-01-25
 
8503
2006-02-06
 
8504
select * from t4 order by colint;
 
8505
colint  col1
 
8506
1       2006-02-06
 
8507
3       2006-01-25
 
8508
4       2006-02-05
 
8509
select * from t5 order by colint;
 
8510
colint  col1
 
8511
1       2006-02-06
 
8512
3       2006-01-25
 
8513
4       2006-02-05
 
8514
insert into t1 values ('2006-01-17');
 
8515
insert into t2 values ('2006-01-17');
 
8516
insert into t3 values ('2006-01-17');
 
8517
insert into t4 values (60,'2006-01-17');
 
8518
insert into t5 values (60,'2006-01-17');
 
8519
insert into t6 values (60,'2006-01-17');
 
8520
select * from t1 order by col1;
 
8521
col1
 
8522
2006-01-17
 
8523
2006-02-06
 
8524
select * from t2 order by col1;
 
8525
col1
 
8526
2006-01-17
 
8527
2006-01-25
 
8528
2006-02-06
 
8529
select * from t3 order by col1;
 
8530
col1
 
8531
2006-01-17
 
8532
2006-01-25
 
8533
2006-02-06
 
8534
select * from t4 order by colint;
 
8535
colint  col1
 
8536
1       2006-02-06
 
8537
3       2006-01-25
 
8538
4       2006-02-05
 
8539
60      2006-01-17
 
8540
select * from t5 order by colint;
 
8541
colint  col1
 
8542
1       2006-02-06
 
8543
3       2006-01-25
 
8544
4       2006-02-05
 
8545
60      2006-01-17
 
8546
select * from t6 order by colint;
 
8547
colint  col1
 
8548
1       2006-02-06
 
8549
3       2006-01-25
 
8550
4       2006-02-05
 
8551
60      2006-01-17
 
8552
-------------------------------------------------------------------------
 
8553
---  Delete rows and partitions of tables with datediff(col1, '2006-01-01')
 
8554
-------------------------------------------------------------------------
 
8555
delete from t11 where col1='2006-01-17';
 
8556
delete from t22 where col1='2006-01-17';
 
8557
delete from t33 where col1='2006-01-17';
 
8558
delete from t44 where col1='2006-01-17';
 
8559
delete from t55 where col1='2006-01-17';
 
8560
delete from t66 where col1='2006-01-17';
 
8561
select * from t11 order by col1;
 
8562
col1
 
8563
2006-02-06
 
8564
select * from t22 order by col1;
 
8565
col1
 
8566
2006-01-25
 
8567
2006-02-06
 
8568
select * from t33 order by col1;
 
8569
col1
 
8570
2006-01-25
 
8571
2006-02-06
 
8572
select * from t44 order by colint;
 
8573
colint  col1
 
8574
1       2006-02-06
 
8575
3       2006-01-25
 
8576
4       2006-02-05
 
8577
select * from t55 order by colint;
 
8578
colint  col1
 
8579
1       2006-02-06
 
8580
3       2006-01-25
 
8581
4       2006-02-05
 
8582
insert into t11 values ('2006-01-17');
 
8583
insert into t22 values ('2006-01-17');
 
8584
insert into t33 values ('2006-01-17');
 
8585
insert into t44 values (60,'2006-01-17');
 
8586
insert into t55 values (60,'2006-01-17');
 
8587
insert into t66 values (60,'2006-01-17');
 
8588
select * from t11 order by col1;
 
8589
col1
 
8590
2006-01-17
 
8591
2006-02-06
 
8592
select * from t22 order by col1;
 
8593
col1
 
8594
2006-01-17
 
8595
2006-01-25
 
8596
2006-02-06
 
8597
select * from t33 order by col1;
 
8598
col1
 
8599
2006-01-17
 
8600
2006-01-25
 
8601
2006-02-06
 
8602
select * from t44 order by colint;
 
8603
colint  col1
 
8604
1       2006-02-06
 
8605
3       2006-01-25
 
8606
4       2006-02-05
 
8607
60      2006-01-17
 
8608
select * from t55 order by colint;
 
8609
colint  col1
 
8610
1       2006-02-06
 
8611
3       2006-01-25
 
8612
4       2006-02-05
 
8613
60      2006-01-17
 
8614
select * from t66 order by colint;
 
8615
colint  col1
 
8616
1       2006-02-06
 
8617
3       2006-01-25
 
8618
4       2006-02-05
11687
8619
60      2006-01-17
11688
8620
-------------------------
11689
8621
---- some alter table end
11733
8665
(partition p0 values less than (15),
11734
8666
partition p1 values less than maxvalue);
11735
8667
create table t5 (colint int, col1 date) engine='NDB' 
11736
 
partition by list(colint)
 
8668
partition by list(colint) 
11737
8669
subpartition by hash(weekday(col1)) subpartitions 2 
11738
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
11739
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
11740
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
11741
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
11742
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
11743
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
8670
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
8671
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8672
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
8673
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
11744
8674
);
11745
8675
create table t6 (colint int, col1 date) engine='NDB' 
11746
8676
partition by range(colint) 
11757
8687
insert into t3 values ('2006-12-03');
11758
8688
insert into t3 values ('2006-11-17');
11759
8689
insert into t3 values ('2006-05-25');
11760
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
11761
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
11762
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
8690
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
8691
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
8692
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
11763
8693
select weekday(col1) from t1 order by col1;
11764
8694
weekday(col1)
11765
8695
4
11870
8800
(partition p0 values less than (15),
11871
8801
partition p1 values less than maxvalue);
11872
8802
alter table t55
11873
 
partition by list(colint)
 
8803
partition by list(colint) 
11874
8804
subpartition by hash(weekday(col1)) subpartitions 2 
11875
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
11876
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
11877
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
11878
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
11879
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
11880
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
8805
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
8806
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8807
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
8808
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
11881
8809
);
11882
8810
alter table t66
11883
8811
partition by range(colint) 
11918
8846
---------------------------
11919
8847
---- some alter table begin
11920
8848
---------------------------
11921
 
alter table t11
11922
 
reorganize partition p0,p1 into
11923
 
(partition s1 values less than maxvalue);
11924
 
select * from t11 order by col1;
11925
 
col1
11926
 
2006-02-06
11927
 
2006-11-17
11928
 
alter table t11
11929
 
reorganize partition s1 into
11930
 
(partition p0 values less than (15),
11931
 
partition p1 values less than maxvalue);
11932
 
select * from t11 order by col1;
11933
 
col1
11934
 
2006-02-06
11935
 
2006-11-17
11936
8849
alter table t55
11937
 
partition by list(colint)
11938
 
subpartition by hash(weekday(col1)) subpartitions 5 
11939
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
11940
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
11941
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
11942
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
11943
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
11944
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
8850
partition by list(colint) 
 
8851
subpartition by hash(weekday(col1)) subpartitions 4 
 
8852
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
8853
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
11945
8854
);
11946
8855
show create table t55;
11947
8856
Table   Create Table
11948
8857
t55     CREATE TABLE `t55` (
11949
8858
  `colint` int(11) DEFAULT NULL,
11950
8859
  `col1` date DEFAULT NULL
11951
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
8860
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekday(col1)) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
11952
8861
select * from t55 order by colint;
11953
8862
colint  col1
11954
8863
1       2006-02-03
11955
8864
2       2006-01-17
11956
8865
3       2006-01-25
11957
8866
4       2006-02-05
11958
 
alter table t66
11959
 
reorganize partition p0,p1 into
11960
 
(partition s1 values less than maxvalue);
11961
 
select * from t66 order by colint;
11962
 
colint  col1
11963
 
1       2006-02-03
11964
 
2       2006-01-17
11965
 
3       2006-01-25
11966
 
4       2006-02-05
11967
 
alter table t66
11968
 
reorganize partition s1 into
11969
 
(partition p0 values less than (weekday('2006-10-14')),
11970
 
partition p1 values less than maxvalue);
11971
 
select * from t66 order by colint;
11972
 
colint  col1
11973
 
1       2006-02-03
11974
 
2       2006-01-17
11975
 
3       2006-01-25
11976
 
4       2006-02-05
11977
 
alter table t66
11978
 
reorganize partition p0,p1 into
11979
 
(partition s1 values less than maxvalue);
11980
 
select * from t66 order by colint;
11981
 
colint  col1
11982
 
1       2006-02-03
11983
 
2       2006-01-17
11984
 
3       2006-01-25
11985
 
4       2006-02-05
11986
 
alter table t66
11987
 
reorganize partition s1 into
11988
 
(partition p0 values less than (weekday('2006-10-14')),
11989
 
partition p1 values less than maxvalue);
11990
 
select * from t66 order by colint;
11991
 
colint  col1
11992
 
1       2006-02-03
11993
 
2       2006-01-17
11994
 
3       2006-01-25
11995
 
4       2006-02-05
11996
8867
-------------------------------------------------------------------------
11997
8868
---  Delete rows and partitions of tables with weekday(col1)
11998
8869
-------------------------------------------------------------------------
12066
8937
3       2006-01-25
12067
8938
4       2006-02-05
12068
8939
60      2006-11-17
12069
 
alter table t1 drop partition p0;
12070
 
alter table t2 drop partition p0;
12071
 
alter table t4 drop partition p0;
12072
 
alter table t5 drop partition p0;
12073
 
alter table t6 drop partition p0;
12074
 
select * from t1 order by col1;
12075
 
col1
12076
 
select * from t2 order by col1;
12077
 
col1
12078
 
select * from t3 order by col1;
12079
 
col1
12080
 
2006-02-06
12081
 
2006-05-25
12082
 
2006-11-17
12083
 
select * from t4 order by colint;
12084
 
colint  col1
12085
 
60      2006-11-17
12086
 
select * from t5 order by colint;
12087
 
colint  col1
12088
 
60      2006-11-17
12089
 
select * from t6 order by colint;
12090
 
colint  col1
12091
 
60      2006-11-17
12092
8940
-------------------------------------------------------------------------
12093
8941
---  Delete rows and partitions of tables with weekday(col1)
12094
8942
-------------------------------------------------------------------------
12162
9010
3       2006-01-25
12163
9011
4       2006-02-05
12164
9012
60      2006-11-17
12165
 
alter table t11 drop partition p0;
12166
 
alter table t22 drop partition p0;
12167
 
alter table t44 drop partition p0;
12168
 
alter table t55 drop partition p0;
12169
 
alter table t66 drop partition p0;
12170
 
select * from t11 order by col1;
12171
 
col1
12172
 
select * from t22 order by col1;
12173
 
col1
12174
 
select * from t33 order by col1;
12175
 
col1
12176
 
2006-02-06
12177
 
2006-05-25
12178
 
2006-11-17
12179
 
select * from t44 order by colint;
12180
 
colint  col1
12181
 
60      2006-11-17
12182
 
select * from t55 order by colint;
12183
 
colint  col1
12184
 
60      2006-11-17
12185
 
select * from t66 order by colint;
12186
 
colint  col1
12187
 
60      2006-11-17
12188
 
-------------------------
12189
 
---- some alter table end
12190
 
-------------------------
12191
 
drop table if exists t1 ;
12192
 
drop table if exists t2 ;
12193
 
drop table if exists t3 ;
12194
 
drop table if exists t4 ;
12195
 
drop table if exists t5 ;
12196
 
drop table if exists t6 ;
12197
 
drop table if exists t11 ;
12198
 
drop table if exists t22 ;
12199
 
drop table if exists t33 ;
12200
 
drop table if exists t44 ;
12201
 
drop table if exists t55 ;
12202
 
drop table if exists t66 ;
12203
 
-------------------------------------------------------------------------
12204
 
---  weekofyear(col1)  in partition with coltype  date
12205
 
-------------------------------------------------------------------------
12206
 
drop table if exists t1 ;
12207
 
drop table if exists t2 ;
12208
 
drop table if exists t3 ;
12209
 
drop table if exists t4 ;
12210
 
drop table if exists t5 ;
12211
 
drop table if exists t6 ;
12212
 
-------------------------------------------------------------------------
12213
 
---  Create tables with weekofyear(col1)
12214
 
-------------------------------------------------------------------------
12215
 
create table t1 (col1 date) engine='NDB' 
12216
 
partition by range(weekofyear(col1)) 
12217
 
(partition p0 values less than (15),
12218
 
partition p1 values less than maxvalue);
12219
 
create table t2 (col1 date) engine='NDB' 
12220
 
partition by list(weekofyear(col1)) 
12221
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
12222
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12223
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12224
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12225
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12226
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
12227
 
);
12228
 
create table t3 (col1 date) engine='NDB' 
12229
 
partition by hash(weekofyear(col1));
12230
 
create table t4 (colint int, col1 date) engine='NDB' 
12231
 
partition by range(colint) 
12232
 
subpartition by hash(weekofyear(col1)) subpartitions 2 
12233
 
(partition p0 values less than (15),
12234
 
partition p1 values less than maxvalue);
12235
 
create table t5 (colint int, col1 date) engine='NDB' 
12236
 
partition by list(colint)
12237
 
subpartition by hash(weekofyear(col1)) subpartitions 2 
12238
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
12239
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12240
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12241
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12242
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12243
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
12244
 
);
12245
 
create table t6 (colint int, col1 date) engine='NDB' 
12246
 
partition by range(colint) 
12247
 
(partition p0 values less than (weekofyear('2006-02-14')),
12248
 
partition p1 values less than maxvalue);
12249
 
-------------------------------------------------------------------------
12250
 
---  Access tables with weekofyear(col1) 
12251
 
-------------------------------------------------------------------------
12252
 
insert into t1 values ('2006-01-03');
12253
 
insert into t1 values ('2006-03-17');
12254
 
insert into t2 values ('2006-01-03');
12255
 
insert into t2 values ('2006-03-17');
12256
 
insert into t2 values ('2006-05-25');
12257
 
insert into t3 values ('2006-01-03');
12258
 
insert into t3 values ('2006-03-17');
12259
 
insert into t3 values ('2006-05-25');
12260
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
12261
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
12262
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
12263
 
select weekofyear(col1) from t1 order by col1;
12264
 
weekofyear(col1)
12265
 
1
12266
 
11
12267
 
select * from t1 order by col1;
12268
 
col1
12269
 
2006-01-03
12270
 
2006-03-17
12271
 
select * from t2 order by col1;
12272
 
col1
12273
 
2006-01-03
12274
 
2006-03-17
12275
 
2006-05-25
12276
 
select * from t3 order by col1;
12277
 
col1
12278
 
2006-01-03
12279
 
2006-03-17
12280
 
2006-05-25
12281
 
select * from t4 order by colint;
12282
 
colint  col1
12283
 
1       2006-02-03
12284
 
2       2006-01-17
12285
 
3       2006-01-25
12286
 
4       2006-02-05
12287
 
select * from t5 order by colint;
12288
 
colint  col1
12289
 
1       2006-02-03
12290
 
2       2006-01-17
12291
 
3       2006-01-25
12292
 
4       2006-02-05
12293
 
select * from t6 order by colint;
12294
 
colint  col1
12295
 
1       2006-02-03
12296
 
2       2006-01-17
12297
 
3       2006-01-25
12298
 
4       2006-02-05
12299
 
update t1 set col1='2006-09-06' where col1='2006-01-03';
12300
 
update t2 set col1='2006-09-06' where col1='2006-01-03';
12301
 
update t3 set col1='2006-09-06' where col1='2006-01-03';
12302
 
update t4 set col1='2006-09-06' where col1='2006-01-03';
12303
 
update t5 set col1='2006-09-06' where col1='2006-01-03';
12304
 
update t6 set col1='2006-09-06' where col1='2006-01-03';
12305
 
select * from t1 order by col1;
12306
 
col1
12307
 
2006-03-17
12308
 
2006-09-06
12309
 
select * from t2 order by col1;
12310
 
col1
12311
 
2006-03-17
12312
 
2006-05-25
12313
 
2006-09-06
12314
 
select * from t3 order by col1;
12315
 
col1
12316
 
2006-03-17
12317
 
2006-05-25
12318
 
2006-09-06
12319
 
select * from t4 order by colint;
12320
 
colint  col1
12321
 
1       2006-02-03
12322
 
2       2006-01-17
12323
 
3       2006-01-25
12324
 
4       2006-02-05
12325
 
select * from t5 order by colint;
12326
 
colint  col1
12327
 
1       2006-02-03
12328
 
2       2006-01-17
12329
 
3       2006-01-25
12330
 
4       2006-02-05
12331
 
select * from t6 order by colint;
12332
 
colint  col1
12333
 
1       2006-02-03
12334
 
2       2006-01-17
12335
 
3       2006-01-25
12336
 
4       2006-02-05
12337
 
-------------------------------------------------------------------------
12338
 
---  Alter tables with weekofyear(col1)
12339
 
-------------------------------------------------------------------------
12340
 
drop table if exists t11 ;
12341
 
drop table if exists t22 ;
12342
 
drop table if exists t33 ;
12343
 
drop table if exists t44 ;
12344
 
drop table if exists t55 ;
12345
 
drop table if exists t66 ;
12346
 
create table t11 engine='NDB' as select * from t1;
12347
 
create table t22 engine='NDB' as select * from t2;
12348
 
create table t33 engine='NDB' as select * from t3;
12349
 
create table t44 engine='NDB' as select * from t4;
12350
 
create table t55 engine='NDB' as select * from t5;
12351
 
create table t66 engine='NDB' as select * from t6;
12352
 
alter table t11
12353
 
partition by range(weekofyear(col1)) 
12354
 
(partition p0 values less than (15),
12355
 
partition p1 values less than maxvalue);
12356
 
alter table t22
12357
 
partition by list(weekofyear(col1)) 
12358
 
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10),
12359
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12360
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12361
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12362
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12363
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
12364
 
);
12365
 
alter table t33
12366
 
partition by hash(weekofyear(col1));
12367
 
alter table t44
12368
 
partition by range(colint) 
12369
 
subpartition by hash(weekofyear(col1)) subpartitions 2 
12370
 
(partition p0 values less than (15),
12371
 
partition p1 values less than maxvalue);
12372
 
alter table t55
12373
 
partition by list(colint)
12374
 
subpartition by hash(weekofyear(col1)) subpartitions 2 
12375
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
12376
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12377
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12378
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12379
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12380
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
12381
 
);
12382
 
alter table t66
12383
 
partition by range(colint) 
12384
 
(partition p0 values less than (weekofyear('2006-02-14')),
12385
 
partition p1 values less than maxvalue);
12386
 
select * from t11 order by col1;
12387
 
col1
12388
 
2006-03-17
12389
 
2006-09-06
12390
 
select * from t22 order by col1;
12391
 
col1
12392
 
2006-03-17
12393
 
2006-05-25
12394
 
2006-09-06
12395
 
select * from t33 order by col1;
12396
 
col1
12397
 
2006-03-17
12398
 
2006-05-25
12399
 
2006-09-06
12400
 
select * from t44 order by colint;
12401
 
colint  col1
12402
 
1       2006-02-03
12403
 
2       2006-01-17
12404
 
3       2006-01-25
12405
 
4       2006-02-05
12406
 
select * from t55 order by colint;
12407
 
colint  col1
12408
 
1       2006-02-03
12409
 
2       2006-01-17
12410
 
3       2006-01-25
12411
 
4       2006-02-05
12412
 
select * from t66 order by colint;
12413
 
colint  col1
12414
 
1       2006-02-03
12415
 
2       2006-01-17
12416
 
3       2006-01-25
12417
 
4       2006-02-05
12418
 
---------------------------
12419
 
---- some alter table begin
12420
 
---------------------------
12421
 
alter table t11
12422
 
reorganize partition p0,p1 into
12423
 
(partition s1 values less than maxvalue);
12424
 
select * from t11 order by col1;
12425
 
col1
12426
 
2006-03-17
12427
 
2006-09-06
12428
 
alter table t11
12429
 
reorganize partition s1 into
12430
 
(partition p0 values less than (15),
12431
 
partition p1 values less than maxvalue);
12432
 
select * from t11 order by col1;
12433
 
col1
12434
 
2006-03-17
12435
 
2006-09-06
12436
 
alter table t55
12437
 
partition by list(colint)
12438
 
subpartition by hash(weekofyear(col1)) subpartitions 5 
12439
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
12440
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12441
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12442
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12443
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12444
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
12445
 
);
12446
 
show create table t55;
12447
 
Table   Create Table
12448
 
t55     CREATE TABLE `t55` (
12449
 
  `colint` int(11) DEFAULT NULL,
12450
 
  `col1` date DEFAULT NULL
12451
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (weekofyear(col1)) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
12452
 
select * from t55 order by colint;
12453
 
colint  col1
12454
 
1       2006-02-03
12455
 
2       2006-01-17
12456
 
3       2006-01-25
12457
 
4       2006-02-05
12458
 
alter table t66
12459
 
reorganize partition p0,p1 into
12460
 
(partition s1 values less than maxvalue);
12461
 
select * from t66 order by colint;
12462
 
colint  col1
12463
 
1       2006-02-03
12464
 
2       2006-01-17
12465
 
3       2006-01-25
12466
 
4       2006-02-05
12467
 
alter table t66
12468
 
reorganize partition s1 into
12469
 
(partition p0 values less than (weekofyear('2006-02-14')),
12470
 
partition p1 values less than maxvalue);
12471
 
select * from t66 order by colint;
12472
 
colint  col1
12473
 
1       2006-02-03
12474
 
2       2006-01-17
12475
 
3       2006-01-25
12476
 
4       2006-02-05
12477
 
alter table t66
12478
 
reorganize partition p0,p1 into
12479
 
(partition s1 values less than maxvalue);
12480
 
select * from t66 order by colint;
12481
 
colint  col1
12482
 
1       2006-02-03
12483
 
2       2006-01-17
12484
 
3       2006-01-25
12485
 
4       2006-02-05
12486
 
alter table t66
12487
 
reorganize partition s1 into
12488
 
(partition p0 values less than (weekofyear('2006-02-14')),
12489
 
partition p1 values less than maxvalue);
12490
 
select * from t66 order by colint;
12491
 
colint  col1
12492
 
1       2006-02-03
12493
 
2       2006-01-17
12494
 
3       2006-01-25
12495
 
4       2006-02-05
12496
 
-------------------------------------------------------------------------
12497
 
---  Delete rows and partitions of tables with weekofyear(col1)
12498
 
-------------------------------------------------------------------------
12499
 
delete from t1 where col1='2006-03-17';
12500
 
delete from t2 where col1='2006-03-17';
12501
 
delete from t3 where col1='2006-03-17';
12502
 
delete from t4 where col1='2006-03-17';
12503
 
delete from t5 where col1='2006-03-17';
12504
 
delete from t6 where col1='2006-03-17';
12505
 
select * from t1 order by col1;
12506
 
col1
12507
 
2006-09-06
12508
 
select * from t2 order by col1;
12509
 
col1
12510
 
2006-05-25
12511
 
2006-09-06
12512
 
select * from t3 order by col1;
12513
 
col1
12514
 
2006-05-25
12515
 
2006-09-06
12516
 
select * from t4 order by colint;
12517
 
colint  col1
12518
 
1       2006-02-03
12519
 
2       2006-01-17
12520
 
3       2006-01-25
12521
 
4       2006-02-05
12522
 
select * from t5 order by colint;
12523
 
colint  col1
12524
 
1       2006-02-03
12525
 
2       2006-01-17
12526
 
3       2006-01-25
12527
 
4       2006-02-05
12528
 
insert into t1 values ('2006-03-17');
12529
 
insert into t2 values ('2006-03-17');
12530
 
insert into t3 values ('2006-03-17');
12531
 
insert into t4 values (60,'2006-03-17');
12532
 
insert into t5 values (60,'2006-03-17');
12533
 
insert into t6 values (60,'2006-03-17');
12534
 
select * from t1 order by col1;
12535
 
col1
12536
 
2006-03-17
12537
 
2006-09-06
12538
 
select * from t2 order by col1;
12539
 
col1
12540
 
2006-03-17
12541
 
2006-05-25
12542
 
2006-09-06
12543
 
select * from t3 order by col1;
12544
 
col1
12545
 
2006-03-17
12546
 
2006-05-25
12547
 
2006-09-06
12548
 
select * from t4 order by colint;
12549
 
colint  col1
12550
 
1       2006-02-03
12551
 
2       2006-01-17
12552
 
3       2006-01-25
12553
 
4       2006-02-05
12554
 
60      2006-03-17
12555
 
select * from t5 order by colint;
12556
 
colint  col1
12557
 
1       2006-02-03
12558
 
2       2006-01-17
12559
 
3       2006-01-25
12560
 
4       2006-02-05
12561
 
60      2006-03-17
12562
 
select * from t6 order by colint;
12563
 
colint  col1
12564
 
1       2006-02-03
12565
 
2       2006-01-17
12566
 
3       2006-01-25
12567
 
4       2006-02-05
12568
 
60      2006-03-17
12569
 
alter table t1 drop partition p0;
12570
 
alter table t2 drop partition p0;
12571
 
alter table t4 drop partition p0;
12572
 
alter table t5 drop partition p0;
12573
 
alter table t6 drop partition p0;
12574
 
select * from t1 order by col1;
12575
 
col1
12576
 
2006-09-06
12577
 
select * from t2 order by col1;
12578
 
col1
12579
 
2006-03-17
12580
 
2006-05-25
12581
 
2006-09-06
12582
 
select * from t3 order by col1;
12583
 
col1
12584
 
2006-03-17
12585
 
2006-05-25
12586
 
2006-09-06
12587
 
select * from t4 order by colint;
12588
 
colint  col1
12589
 
60      2006-03-17
12590
 
select * from t5 order by colint;
12591
 
colint  col1
12592
 
60      2006-03-17
12593
 
select * from t6 order by colint;
12594
 
colint  col1
12595
 
60      2006-03-17
12596
 
-------------------------------------------------------------------------
12597
 
---  Delete rows and partitions of tables with weekofyear(col1)
12598
 
-------------------------------------------------------------------------
12599
 
delete from t11 where col1='2006-03-17';
12600
 
delete from t22 where col1='2006-03-17';
12601
 
delete from t33 where col1='2006-03-17';
12602
 
delete from t44 where col1='2006-03-17';
12603
 
delete from t55 where col1='2006-03-17';
12604
 
delete from t66 where col1='2006-03-17';
12605
 
select * from t11 order by col1;
12606
 
col1
12607
 
2006-09-06
12608
 
select * from t22 order by col1;
12609
 
col1
12610
 
2006-05-25
12611
 
2006-09-06
12612
 
select * from t33 order by col1;
12613
 
col1
12614
 
2006-05-25
12615
 
2006-09-06
12616
 
select * from t44 order by colint;
12617
 
colint  col1
12618
 
1       2006-02-03
12619
 
2       2006-01-17
12620
 
3       2006-01-25
12621
 
4       2006-02-05
12622
 
select * from t55 order by colint;
12623
 
colint  col1
12624
 
1       2006-02-03
12625
 
2       2006-01-17
12626
 
3       2006-01-25
12627
 
4       2006-02-05
12628
 
insert into t11 values ('2006-03-17');
12629
 
insert into t22 values ('2006-03-17');
12630
 
insert into t33 values ('2006-03-17');
12631
 
insert into t44 values (60,'2006-03-17');
12632
 
insert into t55 values (60,'2006-03-17');
12633
 
insert into t66 values (60,'2006-03-17');
12634
 
select * from t11 order by col1;
12635
 
col1
12636
 
2006-03-17
12637
 
2006-09-06
12638
 
select * from t22 order by col1;
12639
 
col1
12640
 
2006-03-17
12641
 
2006-05-25
12642
 
2006-09-06
12643
 
select * from t33 order by col1;
12644
 
col1
12645
 
2006-03-17
12646
 
2006-05-25
12647
 
2006-09-06
12648
 
select * from t44 order by colint;
12649
 
colint  col1
12650
 
1       2006-02-03
12651
 
2       2006-01-17
12652
 
3       2006-01-25
12653
 
4       2006-02-05
12654
 
60      2006-03-17
12655
 
select * from t55 order by colint;
12656
 
colint  col1
12657
 
1       2006-02-03
12658
 
2       2006-01-17
12659
 
3       2006-01-25
12660
 
4       2006-02-05
12661
 
60      2006-03-17
12662
 
select * from t66 order by colint;
12663
 
colint  col1
12664
 
1       2006-02-03
12665
 
2       2006-01-17
12666
 
3       2006-01-25
12667
 
4       2006-02-05
12668
 
60      2006-03-17
12669
 
alter table t11 drop partition p0;
12670
 
alter table t22 drop partition p0;
12671
 
alter table t44 drop partition p0;
12672
 
alter table t55 drop partition p0;
12673
 
alter table t66 drop partition p0;
12674
 
select * from t11 order by col1;
12675
 
col1
12676
 
2006-09-06
12677
 
select * from t22 order by col1;
12678
 
col1
12679
 
2006-03-17
12680
 
2006-05-25
12681
 
2006-09-06
12682
 
select * from t33 order by col1;
12683
 
col1
12684
 
2006-03-17
12685
 
2006-05-25
12686
 
2006-09-06
12687
 
select * from t44 order by colint;
12688
 
colint  col1
12689
 
60      2006-03-17
12690
 
select * from t55 order by colint;
12691
 
colint  col1
12692
 
60      2006-03-17
12693
 
select * from t66 order by colint;
12694
 
colint  col1
12695
 
60      2006-03-17
12696
9013
-------------------------
12697
9014
---- some alter table end
12698
9015
-------------------------
12741
9058
(partition p0 values less than (15),
12742
9059
partition p1 values less than maxvalue);
12743
9060
create table t5 (colint int, col1 date) engine='NDB' 
12744
 
partition by list(colint)
 
9061
partition by list(colint) 
12745
9062
subpartition by hash(year(col1)-1990) subpartitions 2 
12746
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
12747
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12748
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12749
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12750
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12751
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
9063
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
9064
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
9065
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
9066
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
12752
9067
);
12753
9068
create table t6 (colint int, col1 date) engine='NDB' 
12754
9069
partition by range(colint) 
12765
9080
insert into t3 values ('1996-01-03');
12766
9081
insert into t3 values ('2000-02-17');
12767
9082
insert into t3 values ('2004-05-25');
12768
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
12769
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
12770
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
9083
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
9084
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
9085
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
12771
9086
select year(col1)-1990 from t1 order by col1;
12772
9087
year(col1)-1990
12773
9088
6
12878
9193
(partition p0 values less than (15),
12879
9194
partition p1 values less than maxvalue);
12880
9195
alter table t55
12881
 
partition by list(colint)
 
9196
partition by list(colint) 
12882
9197
subpartition by hash(year(col1)-1990) subpartitions 2 
12883
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
12884
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12885
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12886
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12887
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12888
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
9198
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
9199
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
9200
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
9201
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
12889
9202
);
12890
9203
alter table t66
12891
9204
partition by range(colint) 
12926
9239
---------------------------
12927
9240
---- some alter table begin
12928
9241
---------------------------
12929
 
alter table t11
12930
 
reorganize partition p0,p1 into
12931
 
(partition s1 values less than maxvalue);
12932
 
select * from t11 order by col1;
12933
 
col1
12934
 
2000-02-17
12935
 
2002-02-15
12936
 
alter table t11
12937
 
reorganize partition s1 into
12938
 
(partition p0 values less than (15),
12939
 
partition p1 values less than maxvalue);
12940
 
select * from t11 order by col1;
12941
 
col1
12942
 
2000-02-17
12943
 
2002-02-15
12944
9242
alter table t55
12945
 
partition by list(colint)
12946
 
subpartition by hash(year(col1)-1990) subpartitions 5 
12947
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
12948
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
12949
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
12950
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
12951
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
12952
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
9243
partition by list(colint) 
 
9244
subpartition by hash(year(col1)-1990) subpartitions 4 
 
9245
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
9246
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
12953
9247
);
12954
9248
show create table t55;
12955
9249
Table   Create Table
12956
9250
t55     CREATE TABLE `t55` (
12957
9251
  `colint` int(11) DEFAULT NULL,
12958
9252
  `col1` date DEFAULT NULL
12959
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
9253
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (year(col1)-1990) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
12960
9254
select * from t55 order by colint;
12961
9255
colint  col1
12962
9256
1       2006-02-03
12963
9257
2       2006-01-17
12964
9258
3       2006-01-25
12965
9259
4       2006-02-05
12966
 
alter table t66
12967
 
reorganize partition p0,p1 into
12968
 
(partition s1 values less than maxvalue);
12969
 
select * from t66 order by colint;
12970
 
colint  col1
12971
 
1       2006-02-03
12972
 
2       2006-01-17
12973
 
3       2006-01-25
12974
 
4       2006-02-05
12975
 
alter table t66
12976
 
reorganize partition s1 into
12977
 
(partition p0 values less than (year('2005-10-14')-1990),
12978
 
partition p1 values less than maxvalue);
12979
 
select * from t66 order by colint;
12980
 
colint  col1
12981
 
1       2006-02-03
12982
 
2       2006-01-17
12983
 
3       2006-01-25
12984
 
4       2006-02-05
12985
 
alter table t66
12986
 
reorganize partition p0,p1 into
12987
 
(partition s1 values less than maxvalue);
12988
 
select * from t66 order by colint;
12989
 
colint  col1
12990
 
1       2006-02-03
12991
 
2       2006-01-17
12992
 
3       2006-01-25
12993
 
4       2006-02-05
12994
 
alter table t66
12995
 
reorganize partition s1 into
12996
 
(partition p0 values less than (year('2005-10-14')-1990),
12997
 
partition p1 values less than maxvalue);
12998
 
select * from t66 order by colint;
12999
 
colint  col1
13000
 
1       2006-02-03
13001
 
2       2006-01-17
13002
 
3       2006-01-25
13003
 
4       2006-02-05
13004
9260
-------------------------------------------------------------------------
13005
9261
---  Delete rows and partitions of tables with year(col1)-1990
13006
9262
-------------------------------------------------------------------------
13074
9330
3       2006-01-25
13075
9331
4       2006-02-05
13076
9332
60      2000-02-17
13077
 
alter table t1 drop partition p0;
13078
 
alter table t2 drop partition p0;
13079
 
alter table t4 drop partition p0;
13080
 
alter table t5 drop partition p0;
13081
 
alter table t6 drop partition p0;
13082
 
select * from t1 order by col1;
13083
 
col1
13084
 
select * from t2 order by col1;
13085
 
col1
13086
 
2002-02-15
13087
 
2004-05-25
13088
 
select * from t3 order by col1;
13089
 
col1
13090
 
2000-02-17
13091
 
2002-02-15
13092
 
2004-05-25
13093
 
select * from t4 order by colint;
13094
 
colint  col1
13095
 
60      2000-02-17
13096
 
select * from t5 order by colint;
13097
 
colint  col1
13098
 
60      2000-02-17
13099
 
select * from t6 order by colint;
13100
 
colint  col1
13101
 
60      2000-02-17
13102
9333
-------------------------------------------------------------------------
13103
9334
---  Delete rows and partitions of tables with year(col1)-1990
13104
9335
-------------------------------------------------------------------------
13172
9403
3       2006-01-25
13173
9404
4       2006-02-05
13174
9405
60      2000-02-17
13175
 
alter table t11 drop partition p0;
13176
 
alter table t22 drop partition p0;
13177
 
alter table t44 drop partition p0;
13178
 
alter table t55 drop partition p0;
13179
 
alter table t66 drop partition p0;
13180
 
select * from t11 order by col1;
13181
 
col1
13182
 
select * from t22 order by col1;
13183
 
col1
13184
 
2002-02-15
13185
 
2004-05-25
13186
 
select * from t33 order by col1;
13187
 
col1
13188
 
2000-02-17
13189
 
2002-02-15
13190
 
2004-05-25
13191
 
select * from t44 order by colint;
13192
 
colint  col1
13193
 
60      2000-02-17
13194
 
select * from t55 order by colint;
13195
 
colint  col1
13196
 
60      2000-02-17
13197
 
select * from t66 order by colint;
13198
 
colint  col1
13199
 
60      2000-02-17
13200
9406
-------------------------
13201
9407
---- some alter table end
13202
9408
-------------------------
13245
9451
(partition p0 values less than (15),
13246
9452
partition p1 values less than maxvalue);
13247
9453
create table t5 (colint int, col1 date) engine='NDB' 
13248
 
partition by list(colint)
 
9454
partition by list(colint) 
13249
9455
subpartition by hash(yearweek(col1)-200600) subpartitions 2 
13250
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
13251
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
13252
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
13253
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
13254
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
13255
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
9456
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
9457
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
9458
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
9459
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
13256
9460
);
13257
9461
create table t6 (colint int, col1 date) engine='NDB' 
13258
9462
partition by range(colint) 
13269
9473
insert into t3 values ('2006-01-03');
13270
9474
insert into t3 values ('2006-08-17');
13271
9475
insert into t3 values ('2006-03-25');
13272
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t4;
13273
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t5;
13274
 
load data infile 'MYSQL_TEST_DIR/suite/partitions/include/partition_supported_sql_funcs_int_date.in' into table t6;
 
9476
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t4;
 
9477
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t5;
 
9478
load data infile '../std_data_ln/parts/part_supported_sql_funcs_int_date.inc' into table t6;
13275
9479
select yearweek(col1)-200600 from t1 order by col1;
13276
9480
yearweek(col1)-200600
13277
9481
1
13382
9586
(partition p0 values less than (15),
13383
9587
partition p1 values less than maxvalue);
13384
9588
alter table t55
13385
 
partition by list(colint)
 
9589
partition by list(colint) 
13386
9590
subpartition by hash(yearweek(col1)-200600) subpartitions 2 
13387
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
13388
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
13389
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
13390
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
13391
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
13392
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
9591
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15),
 
9592
partition p1 values in (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
9593
partition p2 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45),
 
9594
partition p3 values in (46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
13393
9595
);
13394
9596
alter table t66
13395
9597
partition by range(colint) 
13430
9632
---------------------------
13431
9633
---- some alter table begin
13432
9634
---------------------------
13433
 
alter table t11
13434
 
reorganize partition p0,p1 into
13435
 
(partition s1 values less than maxvalue);
13436
 
select * from t11 order by col1;
13437
 
col1
13438
 
2006-08-17
13439
 
2006-11-15
13440
 
alter table t11
13441
 
reorganize partition s1 into
13442
 
(partition p0 values less than (15),
13443
 
partition p1 values less than maxvalue);
13444
 
select * from t11 order by col1;
13445
 
col1
13446
 
2006-08-17
13447
 
2006-11-15
13448
9635
alter table t55
13449
 
partition by list(colint)
13450
 
subpartition by hash(yearweek(col1)-200600) subpartitions 5 
13451
 
(partition p0 values in (1,2,3,4,5,6,7,8,9,10),
13452
 
partition p1 values in (11,12,13,14,15,16,17,18,19,20),
13453
 
partition p2 values in (21,22,23,24,25,26,27,28,29,30),
13454
 
partition p3 values in (31,32,33,34,35,36,37,38,39,40),
13455
 
partition p4 values in (41,42,43,44,45,46,47,48,49,50),
13456
 
partition p5 values in (51,52,53,54,55,56,57,58,59,60)
 
9636
partition by list(colint) 
 
9637
subpartition by hash(yearweek(col1)-200600) subpartitions 4 
 
9638
(partition p0 values in (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30),
 
9639
partition p1 values in (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60)
13457
9640
);
13458
9641
show create table t55;
13459
9642
Table   Create Table
13460
9643
t55     CREATE TABLE `t55` (
13461
9644
  `colint` int(11) DEFAULT NULL,
13462
9645
  `col1` date DEFAULT NULL
13463
 
) ENGINE=NDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 5 (PARTITION p0 VALUES IN (1,2,3,4,5,6,7,8,9,10) ENGINE = NDB, PARTITION p1 VALUES IN (11,12,13,14,15,16,17,18,19,20) ENGINE = NDB, PARTITION p2 VALUES IN (21,22,23,24,25,26,27,28,29,30) ENGINE = NDB, PARTITION p3 VALUES IN (31,32,33,34,35,36,37,38,39,40) ENGINE = NDB, PARTITION p4 VALUES IN (41,42,43,44,45,46,47,48,49,50) ENGINE = NDB, PARTITION p5 VALUES IN (51,52,53,54,55,56,57,58,59,60) ENGINE = NDB) */
 
9646
) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (colint) SUBPARTITION BY HASH (yearweek(col1)-200600) SUBPARTITIONS 4 (PARTITION p0 VALUES IN (0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30) ENGINE = ndbcluster, PARTITION p1 VALUES IN (31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60) ENGINE = ndbcluster) */
13464
9647
select * from t55 order by colint;
13465
9648
colint  col1
13466
9649
1       2006-02-03
13467
9650
2       2006-01-17
13468
9651
3       2006-01-25
13469
9652
4       2006-02-05
13470
 
alter table t66
13471
 
reorganize partition p0,p1 into
13472
 
(partition s1 values less than maxvalue);
13473
 
select * from t66 order by colint;
13474
 
colint  col1
13475
 
1       2006-02-03
13476
 
2       2006-01-17
13477
 
3       2006-01-25
13478
 
4       2006-02-05
13479
 
alter table t66
13480
 
reorganize partition s1 into
13481
 
(partition p0 values less than (yearweek('2006-10-14')-200600),
13482
 
partition p1 values less than maxvalue);
13483
 
select * from t66 order by colint;
13484
 
colint  col1
13485
 
1       2006-02-03
13486
 
2       2006-01-17
13487
 
3       2006-01-25
13488
 
4       2006-02-05
13489
 
alter table t66
13490
 
reorganize partition p0,p1 into
13491
 
(partition s1 values less than maxvalue);
13492
 
select * from t66 order by colint;
13493
 
colint  col1
13494
 
1       2006-02-03
13495
 
2       2006-01-17
13496
 
3       2006-01-25
13497
 
4       2006-02-05
13498
 
alter table t66
13499
 
reorganize partition s1 into
13500
 
(partition p0 values less than (yearweek('2006-10-14')-200600),
13501
 
partition p1 values less than maxvalue);
13502
 
select * from t66 order by colint;
13503
 
colint  col1
13504
 
1       2006-02-03
13505
 
2       2006-01-17
13506
 
3       2006-01-25
13507
 
4       2006-02-05
13508
9653
-------------------------------------------------------------------------
13509
9654
---  Delete rows and partitions of tables with yearweek(col1)-200600
13510
9655
-------------------------------------------------------------------------
13578
9723
3       2006-01-25
13579
9724
4       2006-02-05
13580
9725
60      2006-08-17
13581
 
alter table t1 drop partition p0;
13582
 
alter table t2 drop partition p0;
13583
 
alter table t4 drop partition p0;
13584
 
alter table t5 drop partition p0;
13585
 
alter table t6 drop partition p0;
13586
 
select * from t1 order by col1;
13587
 
col1
13588
 
2006-08-17
13589
 
2006-11-15
13590
 
select * from t2 order by col1;
13591
 
col1
13592
 
2006-03-25
13593
 
2006-08-17
13594
 
2006-11-15
13595
 
select * from t3 order by col1;
13596
 
col1
13597
 
2006-03-25
13598
 
2006-08-17
13599
 
2006-11-15
13600
 
select * from t4 order by colint;
13601
 
colint  col1
13602
 
60      2006-08-17
13603
 
select * from t5 order by colint;
13604
 
colint  col1
13605
 
60      2006-08-17
13606
 
select * from t6 order by colint;
13607
 
colint  col1
13608
 
60      2006-08-17
13609
9726
-------------------------------------------------------------------------
13610
9727
---  Delete rows and partitions of tables with yearweek(col1)-200600
13611
9728
-------------------------------------------------------------------------
13679
9796
3       2006-01-25
13680
9797
4       2006-02-05
13681
9798
60      2006-08-17
13682
 
alter table t11 drop partition p0;
13683
 
alter table t22 drop partition p0;
13684
 
alter table t44 drop partition p0;
13685
 
alter table t55 drop partition p0;
13686
 
alter table t66 drop partition p0;
13687
 
select * from t11 order by col1;
13688
 
col1
13689
 
2006-08-17
13690
 
2006-11-15
13691
 
select * from t22 order by col1;
13692
 
col1
13693
 
2006-03-25
13694
 
2006-08-17
13695
 
2006-11-15
13696
 
select * from t33 order by col1;
13697
 
col1
13698
 
2006-03-25
13699
 
2006-08-17
13700
 
2006-11-15
13701
 
select * from t44 order by colint;
13702
 
colint  col1
13703
 
60      2006-08-17
13704
 
select * from t55 order by colint;
13705
 
colint  col1
13706
 
60      2006-08-17
13707
 
select * from t66 order by colint;
13708
 
colint  col1
13709
 
60      2006-08-17
13710
9799
-------------------------
13711
9800
---- some alter table end
13712
9801
-------------------------