| 1 |
# This testcase tries to put the InnoDB under stress of truncating and deleting |
| 2 |
# tablespaces, with a buffer pool eviction process run in parallel in some |
| 3 |
# cases. |
| 4 |
|
| 5 |
create table evict ( |
| 6 |
d mediumtext not null); |
| 7 |
create table t_temp ( |
| 8 |
d mediumtext not null); |
| 9 |
# Insert 1KB of data to t_temp |
| 10 |
insert into evict values (repeat('abcdefghij', 103)); |
| 11 |
let $i = 3; |
| 12 |
# Insert 8KB of data to t_temp |
| 13 |
while ($i > 0) |
| 14 |
{ |
| 15 |
insert into t_temp select * from t_temp; |
| 16 |
--dec $i |
| 17 |
} |
| 18 |
insert into evict select * from t_temp; |
| 19 |
# Insert 8MB of data to table evict, this should be higher than the |
| 20 |
# --innodb_buffer_pool_size specified in the .opt file |
| 21 |
let $i = 10; |
| 22 |
while ($i > 0) |
| 23 |
{ |
| 24 |
insert into evict select * from evict; |
| 25 |
--dec $i |
| 26 |
} |
| 27 |
|
| 28 |
|
| 29 |
let $i = 100; |
| 30 |
while ($i > 0) |
| 31 |
{ |
| 32 |
# Try to just insert data to tables and drop. |
| 33 |
create table t (d mediumtext not null); |
| 34 |
insert into t select * from t_temp; |
| 35 |
create temporary table t_t (d mediumtext not null); |
| 36 |
insert into t_t select * from t_temp; |
| 37 |
DROP TABLE t, t_t; |
| 38 |
|
| 39 |
# Try to evict all BP before dropping. |
| 40 |
create table t (d mediumtext not null); |
| 41 |
insert into t select * from t_temp; |
| 42 |
create temporary table t_t (d mediumtext not null); |
| 43 |
insert into t_t select * from t_temp; |
| 44 |
select sum(length(d)) from evict; |
| 45 |
DROP TABLE t, t_t; |
| 46 |
|
| 47 |
# Try to evict all BP in parallel to dropping tables. |
| 48 |
create temporary table t_t (d mediumtext not null); |
| 49 |
insert into t_t select * from t_temp; |
| 50 |
create table t (d mediumtext not null); |
| 51 |
insert into t select * from t_temp; |
| 52 |
--connect(con1, localhost, root, '',) |
| 53 |
--send select sum(length(d)) from evict; |
| 54 |
|
| 55 |
--connection default |
| 56 |
DROP TABLE t, t_t; |
| 57 |
--connection con1 |
| 58 |
--reap |
| 59 |
--disconnect con1 |
| 60 |
|
| 61 |
# Try to evict all BP in parallel to closing connection (which will truncate |
| 62 |
# the temporary tablespace). |
| 63 |
--connect(con1, localhost, root, '',) |
| 64 |
create temporary table t_t (d mediumtext not null); |
| 65 |
insert into t_t select * from t_temp; |
| 66 |
|
| 67 |
--connection default |
| 68 |
--send select sum(length(d)) from evict; |
| 69 |
--disconnect con1 |
| 70 |
--reap |
| 71 |
|
| 72 |
--dec $i |
| 73 |
} |
| 74 |
|
| 75 |
DROP TABLE t_temp, evict; |