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 
    7 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
    8 partition by key (a) partitions ;
 
   11 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   12 partition by key (a) partitions ten;
 
   15 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   16 partition by key (a) partitions 24.56;
 
   19 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   20 partition by key (a) partitions -1;
 
   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;
 
   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;
 
   31 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   32 partition by hash (a) partitions;
 
   35 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   36 partition by hash (a) partitions ten;
 
   39 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   40 partition by hash (a) partitions 24.56;
 
   43 eval create 
table t2 (a 
int not null, primary key(a)) engine=$engine
 
   44 partition by hash (a) partitions -1;
 
   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;
 
   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;
 
   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. 
   60    my $fname= 
"$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
 
   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++)
 
   68      my $pattern= 
"        PARTITION p$i VALUES LESS THAN ($j),\n";
 
   69      my $last_pattern= 
"        PARTITION p$i VALUES LESS THAN ($j)\n";
 
   72           push(@wrlines,$pattern);
 
   76           push(@wrlines,$last_pattern);
 
   80    push (@wrlines, 
"     );\n");
 
   81    open(FILE, 
">", $fname) or die;
 
   86 source $MYSQL_TMP_DIR/part_list_elem.inc;
 
   87 remove_file $MYSQL_TMP_DIR/part_list_elem.inc;
 
   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. 
   96    my $fname= 
"$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
 
   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++)
 
  106           my $pattern= 
"        PARTITION p$i VALUES IN (".$j++.
",".$j++.
",".$j++.
",".$j++.
"),\n";
 
  107           push(@wrlines,$pattern);
 
  111           my $last_pattern= 
"        PARTITION p$i VALUES IN (".$j++.
",".$j++.
",".$j++.
",".$j++.
")\n";
 
  112           push(@wrlines,$last_pattern);
 
  116    push (@wrlines, 
"     );\n");
 
  117    open(FILE, 
">", $fname) or die;
 
  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;