MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_bigint.inc
1 eval create table t1 (a bigint unsigned not null, primary key(a)) engine=$engine
2 partition by key (a) (
3 partition pa1 max_rows=20 min_rows=2,
4 partition pa2 max_rows=30 min_rows=3,
5 partition pa3 max_rows=30 min_rows=4,
6 partition pa4 max_rows=40 min_rows=2);
7 show create table t1;
8 insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612), (1), (2), (65535);
9 --sorted_result
10 select * from t1;
11 select * from t1 where a=-2;
12 delete from t1 where a=-2;
13 --sorted_result
14 select * from t1;
15 select * from t1 where a=18446744073709551615;
16 delete from t1 where a=18446744073709551615;
17 --sorted_result
18 select * from t1;
19 drop table t1;
20 
21 eval create table t2 (a bigint unsigned not null, primary key(a)) engine=$engine
22 partition by key (a) partitions 8;
23 show create table t2;
24 insert into t2 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612);
25 --sorted_result
26 select * from t2;
27 select * from t2 where a=18446744073709551615;
28 delete from t2 where a=18446744073709551615;
29 --sorted_result
30 select * from t2;
31 delete from t2;
32 let $count=$maxrows;
33 --echo $maxrows inserts;
34 --disable_query_log
35 while ($count)
36 {
37 eval insert into t2 values ($count);
38 dec $count;
39 }
40 --enable_query_log
41 select count(*) from t2;
42 drop table t2;
43 
44 eval create table t3 (a bigint not null, primary key(a)) engine=$engine
45 partition by key (a) partitions 7;
46 show create table t3;
47 insert into t3 values (9223372036854775807), (9223372036854775806), (9223372036854775805), (9223372036854775804), (-9223372036854775808), (-9223372036854775807), (1), (-1), (0);
48 --sorted_result
49 select * from t3;
50 select * from t3 where a=9223372036854775806;
51 delete from t3 where a=9223372036854775806;
52 --sorted_result
53 select * from t3;
54 drop table t3;