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
6 # The CREATE will be written into a temporary file ($MYSQL_TMP_DIR/part_list_elem.inc).
7 # After inserting the content of the file it will be removed.
11 my $fname=
"$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
13 push (@wrlines,
"eval create table t2 (a int) engine=\$engine\n");
14 push (@wrlines,
" partition by range (a) \n");
15 push (@wrlines,
" subpartition by hash (a) \n");
16 push (@wrlines,
" subpartitions 2 (\n");
17 for(my $i=0; $i<4096; $i++)
20 my $pattern=
" PARTITION p$i VALUES LESS THAN ($j),\n";
21 my $last_pattern=
" PARTITION p$i VALUES LESS THAN ($j)\n";
24 push(@wrlines,$pattern);
28 push(@wrlines,$last_pattern);
32 push (@wrlines,
" );\n");
33 open(FILE,
">", $fname) or die;
38 source $MYSQL_TMP_DIR/part_list_elem.inc;
39 #remove_file $MYSQL_TMP_DIR/part_list_elem.inc;
42 --echo $count inserts;
46 eval insert into t2 values ($count);
50 select count(*) from t2;
51 select count(*) from t2 partition (p0);
52 select count(*) from t2 partition (p10);
53 select count(*) from t2 partition (p100);
54 select count(*) from t2 partition (p1000);
55 select count(*) from t2 partition (p4000);
56 select count(*) from t2 partition (p4095);
58 select * from t2 partition (p0);
59 select * from t2 partition (p10);
60 select * from t2 partition (p100);
61 select * from t2 partition (p1000);
62 select * from t2 partition (p4000);
63 select * from t2 partition (p4095);
65 delete from t2 partition (p4095);
66 select * from t2 partition (p4095);
67 insert into t2 partition (p4095) values (32766), (32767);
68 select * from t2 partition (p4095);
69 update t2 partition (p4095) set a=32765 where a= 32767;
70 select * from t2 partition (p4095);
72 write_file $MYSQL_TMP_DIR/data01;
76 replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR;
77 eval load data infile '$MYSQL_TMP_DIR/data01' into
table t2 partition (p4095) fields terminated by ',';
78 remove_file $MYSQL_TMP_DIR/data01;
79 select * from t2 partition (p4095);
81 error ER_TOO_MANY_PARTITIONS_ERROR;
82 alter
table t2 add partition (partition p4096 values less than (32775));