| 1 |
--echo ---- Partitioning and text data type |
| 2 |
|
| 3 |
--error ER_BLOB_FIELD_IN_PART_FUNC_ERROR |
| 4 |
eval create table t1 (a text 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 tinytext not null, primary key(a(255))) charset latin1 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 mediumtext 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 longtext not null, primary key(a(767))) engine=$engine |
| 30 |
partition by key (a) partitions 30; |
| 31 |
|
| 32 |
#show create table t2; |
| 33 |
#let $count=30; |
| 34 |
#let $letter=0; |
| 35 |
#--echo $count inserts; |
| 36 |
#--disable_query_log |
| 37 |
#while ($count) |
| 38 |
#{ |
| 39 |
#eval insert into t2 values (repeat(char(ascii('a')+$letter),$count*$count)); |
| 40 |
#dec $count; |
| 41 |
#inc $letter; |
| 42 |
#} |
| 43 |
#select count(*) from t2; |
| 44 |
#select * from t2; |
| 45 |
#drop table t2; |