| 1 |
|
| 2 |
let $per_table=`select @@innodb_file_per_table`; |
| 3 |
|
| 4 |
-- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0 |
| 5 |
|
| 6 |
set global innodb_file_per_table=on; |
| 7 |
|
| 8 |
create table t1(a text) engine=innodb key_block_size=8; |
| 9 |
|
| 10 |
-- disable_query_log |
| 11 |
|
| 12 |
# insert some rows so we are using compressed pages |
| 13 |
-- let $i = 10 |
| 14 |
while ($i) |
| 15 |
{ |
| 16 |
insert into t1 values(repeat('abcdefghijklmnopqrstuvwxyz',100)); |
| 17 |
dec $i; |
| 18 |
} |
| 19 |
-- enable_query_log |
| 20 |
|
| 21 |
# we should be using some 8K pages |
| 22 |
-- eval $query_i_s |
| 23 |
|
| 24 |
drop table t1; |
| 25 |
|
| 26 |
# because of lazy eviction at drop table there should still be some |
| 27 |
# used 8K pages |
| 28 |
-- eval $query_i_s |
| 29 |
|
| 30 |
# create a non-compressed table and insert enough into it to evict |
| 31 |
# compressed pages |
| 32 |
create table t2(a text) engine=innodb; |
| 33 |
|
| 34 |
-- disable_query_log |
| 35 |
|
| 36 |
-- let $i = 500 |
| 37 |
while ($i) |
| 38 |
{ |
| 39 |
insert into t2 values(repeat('abcdefghijklmnopqrstuvwxyz',1000)); |
| 40 |
dec $i; |
| 41 |
} |
| 42 |
|
| 43 |
-- enable_query_log |
| 44 |
|
| 45 |
# now there should be no 8K pages in the buffer pool |
| 46 |
-- eval $query_i_s |
| 47 |
|
| 48 |
drop table t2; |
| 49 |
|
| 50 |
# |
| 51 |
# restore environment to the state it was before this test execution |
| 52 |
# |
| 53 |
|
| 54 |
-- disable_query_log |
| 55 |
eval set global innodb_file_per_table=$per_table; |