1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
call mtr.add_suppression("A long semaphore wait");
call mtr.add_suppression("Could not increase number of max_open_files");
create table t2 (a int not null, primary key(a)) engine='InnoDB'
partition by key (a) partitions 8192;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
`a` int NOT NULL,
PRIMARY KEY (`a`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
/*!50100 PARTITION BY KEY (a)
PARTITIONS 8192 */
65535 inserts;
select count(*) from t2;
count(*)
65535
select count(*) from t2 partition (p0);
count(*)
8
select count(*) from t2 partition (p10);
count(*)
0
select count(*) from t2 partition (p100);
count(*)
2
select count(*) from t2 partition (p1000);
count(*)
22
select count(*) from t2 partition (p4000);
count(*)
2
select count(*) from t2 partition (p8000);
count(*)
2
select count(*) from t2 partition (p8191);
count(*)
7
select * from t2 partition (p0);
a
35503
37977
38009
38108
38109
38140
38141
39061
select * from t2 partition (p10);
a
select * from t2 partition (p100);
a
14987
15903
select * from t2 partition (p1000);
a
9883
13835
20549
20581
20680
20681
20682
20683
20712
20713
20714
20715
28741
28773
28872
28873
28874
28875
28904
28905
28906
28907
select * from t2 partition (p4000);
a
18959
27151
select * from t2 partition (p8000);
a
10373
32379
select * from t2 partition (p8191);
a
690
1471
1503
4690
4722
7230
14597
delete from t2 partition (p8191);
select * from t2 partition (p8191);
a
insert into t2 partition (p8191) values (690), (1471);
select * from t2 partition (p8191);
a
690
1471
update t2 partition (p8191) set a=4690 where a= 690;
select * from t2 partition (p8191);
a
1471
4690
load data infile 'MYSQL_TMP_DIR/data01' into table t2 partition (p8191) fields terminated by ',';
select * from t2 partition (p8191);
a
1471
4690
7230
14597
drop table t2;
|