MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_max_parts_hash.inc
1 # Need more as 16k open files per process (ulimit -n) on Unix systems.
2 --source include/have_partition_open_file_limit.inc
3 ##### max rows to be inserted
4 let $maxrows=65535;
5 
6 eval create table t2 (a int not null, primary key(a)) engine=$engine
7 partition by hash (a) partitions 8192;
8 show create table t2;
9 let $count= $maxrows;
10 --echo $count inserts;
11 --disable_query_log
12 while ($count)
13 {
14 eval insert into t2 values ($count);
15 dec $count;
16 }
17 --enable_query_log
18 select count(*) from t2;
19 select count(*) from t2 partition (p0);
20 select count(*) from t2 partition (p10);
21 select count(*) from t2 partition (p100);
22 select count(*) from t2 partition (p1000);
23 select count(*) from t2 partition (p4000);
24 select count(*) from t2 partition (p8000);
25 select count(*) from t2 partition (p8191);
26 
27 select * from t2 partition (p0);
28 select * from t2 partition (p10);
29 select * from t2 partition (p100);
30 select * from t2 partition (p1000);
31 select * from t2 partition (p4000);
32 select * from t2 partition (p8000);
33 select * from t2 partition (p8191);
34 
35 delete from t2 partition (p8191);
36 select * from t2 partition (p8191);
37 insert into t2 partition (p8191) values (8191), (65535);
38 select * from t2 partition (p8191);
39 update t2 partition (p8191) set a=16383 where a= 8191;
40 select * from t2 partition (p8191);
41 
42 write_file $MYSQL_TMP_DIR/data01;
43 8191,
44 57343,
45 EOF
46 replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
47 eval load data infile '$MYSQL_TMP_DIR/data01' into table t2 partition (p8191) fields terminated by ',';
48 remove_file $MYSQL_TMP_DIR/data01;
49 select * from t2 partition (p8191);
50 
51 drop table t2;
52