1 --echo ---- Partitioning and
enum data
type
3 eval create
table t1 (a
enum(
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L') not null, primary key(a)) engine=$engine
5 partition pa1 max_rows=20 min_rows=2,
6 partition pa2 max_rows=30 min_rows=3,
7 partition pa3 max_rows=30 min_rows=4,
8 partition pa4 max_rows=40 min_rows=2);
10 insert into t1 values ('
A'),('D'),('L'),('G');
12 select * from t1 where a='A';
13 update t1 set a='
E' where a='L';
15 delete from t1 where a='
E';
19 eval create
table t2 (a enum (
20 '1','2','3','4','5','6','7','8','9','0',
21 'A','B','C','D','E','F','G','H','I','J','K','L',
22 'M','N','O','P','Q','R','S','T','
U','V','W','X',
24 ) not null, primary key(a)) engine=$engine
25 partition by key (a) partitions 27;
28 --echo $count inserts;
32 eval insert into t2 values (
char(ascii(
'A')+$letter));
35 insert into t2 values (
'1'),(
'2'),(
'3'),(
'4'),(
'5'),(
'6'),(
'7'),(
'8'),(
'9'),(
'0');
36 select count(*) from t2;
40 # mleich: Several partitioning functions are no more allowed.
43 eval create
table t3 (a
enum (
44 '1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'0',
45 'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
46 'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
48 ) not null, primary key(a)) engine=$engine
49 partition by range (a) subpartition by key (a) subpartitions 3 (
50 partition pa9 values less than (10),
51 partition pa18 values less than (19),
52 partition pa27 values less than (28),
53 partition pa36 values less than (37)
57 --echo $count inserts;
61 #eval insert into t3 values ($letter);
64 select count(*) from t3;
68 # End of tests with disallowed partitioning functions.