MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_max_parts_inv.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 error ER_PARSE_ERROR;
7 eval create table t2 (a int not null, primary key(a)) engine=$engine
8 partition by key (a) partitions ;
9 
10 error ER_PARSE_ERROR;
11 eval create table t2 (a int not null, primary key(a)) engine=$engine
12 partition by key (a) partitions ten;
13 
14 error ER_PARSE_ERROR;
15 eval create table t2 (a int not null, primary key(a)) engine=$engine
16 partition by key (a) partitions 24.56;
17 
18 error ER_PARSE_ERROR;
19 eval create table t2 (a int not null, primary key(a)) engine=$engine
20 partition by key (a) partitions -1;
21 
22 error ER_NO_PARTS_ERROR;
23 eval create table t2 (a int not null, primary key(a)) engine=$engine
24 partition by key (a) partitions 0;
25 
26 error ER_TOO_MANY_PARTITIONS_ERROR;
27 eval create table t2 (a int not null, primary key(a)) engine=$engine
28 partition by key (a) partitions 8193;
29 
30 error ER_PARSE_ERROR;
31 eval create table t2 (a int not null, primary key(a)) engine=$engine
32 partition by hash (a) partitions;
33 
34 error ER_PARSE_ERROR;
35 eval create table t2 (a int not null, primary key(a)) engine=$engine
36 partition by hash (a) partitions ten;
37 
38 error ER_PARSE_ERROR;
39 eval create table t2 (a int not null, primary key(a)) engine=$engine
40 partition by hash (a) partitions 24.56;
41 
42 error ER_PARSE_ERROR;
43 eval create table t2 (a int not null, primary key(a)) engine=$engine
44 partition by hash (a) partitions -1;
45 
46 error ER_NO_PARTS_ERROR;
47 eval create table t2 (a int not null, primary key(a)) engine=$engine
48 partition by hash (a) partitions 0;
49 
50 error ER_TOO_MANY_PARTITIONS_ERROR;
51 eval create table t2 (a int not null, primary key(a)) engine=$engine
52 partition by hash (a) partitions 8193;
53 
54 # Create a range partitioned table with 8193 partitions.
55 # The CREATE will be written into a temporary file ($MYSQL_TMP_DIR/part_list_elem.inc).
56 # After inserting the content of the file it will be removed.
57 perl;
58  use strict;
59  use warnings;
60  my $fname= "$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
61  my @wrlines;
62  push (@wrlines, "error ER_TOO_MANY_PARTITIONS_ERROR;\n");
63  push (@wrlines, "eval create table t2 (a int) engine=\$engine\n");
64  push (@wrlines, " partition by range (a) (\n");
65  for(my $i=0; $i<8193; $i++)
66  {
67  my $j= ($i+1)* 8;
68  my $pattern= " PARTITION p$i VALUES LESS THAN ($j),\n";
69  my $last_pattern= " PARTITION p$i VALUES LESS THAN ($j)\n";
70  if ($i<8192)
71  {
72  push(@wrlines,$pattern);
73  }
74  else
75  {
76  push(@wrlines,$last_pattern);
77  }
78 
79  }
80  push (@wrlines, " );\n");
81  open(FILE, ">", $fname) or die;
82  print FILE @wrlines;
83  close FILE;
84 EOF
85 
86 source $MYSQL_TMP_DIR/part_list_elem.inc;
87 remove_file $MYSQL_TMP_DIR/part_list_elem.inc;
88 
89 
90 # Create a range partitioned table with 8193 partitions.
91 # The CREATE will be written into a temporary file ($MYSQL_TMP_DIR/part_list_elem.inc).
92 # After inserting the content of the file it will be removed.
93 perl;
94  use strict;
95  use warnings;
96  my $fname= "$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
97  my @wrlines;
98  push (@wrlines, "error ER_TOO_MANY_PARTITIONS_ERROR;\n");
99  push (@wrlines, "eval create table t2 (a int) engine=\$engine\n");
100  push (@wrlines, " partition by list (a) (\n");
101  for(my $i=0; $i<8193; $i++)
102  {
103  my $j= $i*4;
104  if ($i<8192)
105  {
106  my $pattern= " PARTITION p$i VALUES IN (".$j++.",".$j++.",".$j++.",".$j++."),\n";
107  push(@wrlines,$pattern);
108  }
109  else
110  {
111  my $last_pattern= " PARTITION p$i VALUES IN (".$j++.",".$j++.",".$j++.",".$j++.")\n";
112  push(@wrlines,$last_pattern);
113  }
114 
115  }
116  push (@wrlines, " );\n");
117  open(FILE, ">", $fname) or die;
118  print FILE @wrlines;
119  close FILE;
120 EOF
121 
122 error ER_TOO_MANY_PARTITIONS_ERROR;
123 source $MYSQL_TMP_DIR/part_list_elem.inc;
124 remove_file $MYSQL_TMP_DIR/part_list_elem.inc;
125