MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
partition_blob.inc
1 --echo ---- Partitioning and blob data type
2 
3 --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
4 eval create table t1 (a blob not null, primary key(a(767))) engine=$engine
5 partition by key (a) (
6 partition pa1 max_rows=20 min_rows=2,
7 partition pa2 max_rows=30 min_rows=3,
8 partition pa3 max_rows=30 min_rows=4,
9 partition pa4 max_rows=40 min_rows=2);
10 
11 #show create table t1;
12 #insert into t1 values (repeat('a',1000)), ('b'), (repeat('a',500)), (repeat('b',64));
13 #select * from t1;
14 #select * from t1 where a='b';
15 #update t1 set a='bb' where a='b';
16 #delete from t1 where a='bb';
17 #select * from t1;
18 #drop table t1;
19 
20 --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
21 eval create table t2 (a blob not null, primary key(a(767))) engine=$engine
22 partition by key (a) partitions 30;
23 
24 --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
25 eval create table t2 (a tinyblob not null, primary key(a(767))) engine=$engine
26 partition by key (a) partitions 30;
27 
28 --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
29 eval create table t2 (a mediumblob not null, primary key(a(767))) engine=$engine
30 partition by key (a) partitions 30;
31 
32 --error ER_BLOB_FIELD_IN_PART_FUNC_ERROR
33 eval create table t2 (a longblob not null, primary key(a(767))) engine=$engine
34 partition by key (a) partitions 30;
35 
36 #show create table t2;
37 #let $count=30;
38 #let $letter=0;
39 #--echo $count inserts;
40 #--disable_query_log
41 #while ($count)
42 #{
43 #eval insert into t2 values (repeat(char(ascii('a')+$letter),$count*$count));
44 #dec $count;
45 #inc $letter;
46 #}
47 #select count(*) from t2;
48 #select * from t2;
49 #drop table t2;
50