summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb/t/innodb_cmp_drop_table.test
blob: 827bb4bcc744f1ea64d36ec868fef200dcfa4833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
if (`select plugin_auth_version <= "1.1.8-20.1" from information_schema.plugins where plugin_name='innodb'`)
{
  --skip Not supported by XtraDB 1.1.8-20.1 or earlier
}

let $per_table=`select @@innodb_file_per_table`;
let $format=`select @@innodb_file_format`;

-- let $query_i_s = SELECT page_size FROM information_schema.innodb_cmpmem WHERE pages_used > 0

set global innodb_file_per_table=on;
set global innodb_file_format=`1`;
 
create table t1(a text) engine=innodb key_block_size=8;

-- disable_query_log

# insert some rows so we are using compressed pages
-- let $i = 10
while ($i)
{
  insert into t1 values(repeat('abcdefghijklmnopqrstuvwxyz',100));
  dec $i;
}
-- enable_query_log

# we should be using some 8K pages
-- eval $query_i_s

drop table t1;

# because of lazy eviction at drop table in 5.5 there should be some
# used 8K pages
-- eval $query_i_s

# create a non-compressed table and insert enough into it to evict
# compressed pages
create table t2(a text) engine=innodb;

-- disable_query_log

-- let $i = 400
while ($i)
{
  insert into t2 values(repeat('abcdefghijklmnopqrstuvwxyz',1000));
  dec $i;
}

-- enable_query_log

# now there should be no 8K pages in the buffer pool
-- eval $query_i_s

drop table t2;

#
# restore environment to the state it was before this test execution
#

-- disable_query_log
eval set global innodb_file_format=$format;
eval set global innodb_file_per_table=$per_table;