File: partition_max_parts_inv.inc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (125 lines) | stat: -rw-r--r-- 3,974 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Need more as 16k open files per process (ulimit -n) on Unix systems.
--source include/have_partition_open_file_limit.inc
##### max rows to be inserted
let $maxrows=65535;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions ;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions ten;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions 24.56;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions -1;

error ER_NO_PARTS_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions 0;

error ER_TOO_MANY_PARTITIONS_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by key (a) partitions 8193;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by hash (a) partitions;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by hash (a) partitions ten;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by hash (a) partitions 24.56;

error ER_PARSE_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by hash (a) partitions -1;

error ER_NO_PARTS_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by hash (a) partitions 0;

error ER_TOO_MANY_PARTITIONS_ERROR;
eval create table t2 (a int not null, primary key(a)) engine=$engine
partition by hash (a) partitions 8193;

# Create a range partitioned table with 8193 partitions.
# The CREATE will be written into a temporary file ($MYSQL_TMP_DIR/part_list_elem.inc).
# After inserting the content of the file it will be removed.
perl;
   use strict;
   use warnings;
   my $fname= "$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
   my @wrlines;
   push (@wrlines, "error ER_TOO_MANY_PARTITIONS_ERROR;\n");
   push (@wrlines, "eval create table t2 (a int) engine=\$engine\n");
   push (@wrlines, "     partition by range (a) (\n");
   for(my $i=0; $i<8193; $i++)
   {
     my $j= ($i+1)* 8;
     my $pattern= "        PARTITION p$i VALUES LESS THAN ($j),\n";
     my $last_pattern= "        PARTITION p$i VALUES LESS THAN ($j)\n";
     if ($i<8192) 
        {
          push(@wrlines,$pattern);
        }
     else
        {
          push(@wrlines,$last_pattern);
        }
       
   }
   push (@wrlines, "     );\n");
   open(FILE, ">", $fname) or die;
   print FILE @wrlines;
   close FILE;
EOF

source $MYSQL_TMP_DIR/part_list_elem.inc;
remove_file $MYSQL_TMP_DIR/part_list_elem.inc;


# Create a range partitioned table with 8193 partitions.
# The CREATE will be written into a temporary file ($MYSQL_TMP_DIR/part_list_elem.inc).
# After inserting the content of the file it will be removed.
perl;
   use strict;
   use warnings;
   my $fname= "$ENV{'MYSQL_TMP_DIR'}/part_list_elem.inc";
   my @wrlines;
   push (@wrlines, "error ER_TOO_MANY_PARTITIONS_ERROR;\n");
   push (@wrlines, "eval create table t2 (a int) engine=\$engine\n");
   push (@wrlines, "     partition by list (a) (\n");
   for(my $i=0; $i<8193; $i++)
   {
     my $j= $i*4;
     if ($i<8192) 
        {
          my $pattern= "        PARTITION p$i VALUES IN (".$j++.",".$j++.",".$j++.",".$j++."),\n";
          push(@wrlines,$pattern);
        }
     else
        {
          my $last_pattern= "        PARTITION p$i VALUES IN (".$j++.",".$j++.",".$j++.",".$j++.")\n";
          push(@wrlines,$last_pattern);
        }
       
   }
   push (@wrlines, "     );\n");
   open(FILE, ">", $fname) or die;
   print FILE @wrlines;
   close FILE;
EOF

error ER_TOO_MANY_PARTITIONS_ERROR;
source $MYSQL_TMP_DIR/part_list_elem.inc;
remove_file $MYSQL_TMP_DIR/part_list_elem.inc;