Debian Codegraph @

mysql-test/suite/innodb/t/blob_page_reserve.test

raw
1 --source include/no_valgrind_without_big.inc
2 --source include/have_debug.inc
3
4 --echo #
5 --echo # Bug #18756233 ASSERT !HAS_DONE_RESERVATION,
6 --echo # FSEG_ALLOC_FREE_PAGE_LOW(), BTR_STORE_BIG_REC_EXTE
7 --echo #
8
9 create table t1 (f1 int primary key, f2 longblob, f3 longblob) engine = innodb;
10
11 select name, clust_index_size from information_schema.innodb_tablestats
12 where name = 'test/t1';
13
14 --echo # If the page size is 16K, an uncompressed blob page can hold
15 --echo # data of 16330 bytes. Insert 64 pages of data (64 * 16330 =
16 --echo # 1045120 bytes) so that 1 extent will be reserved and used.
17 insert into t1 values (1, repeat('%', 1045120), repeat('~', 1045120));
18
19 set global innodb_buf_flush_list_now = 1;
20
21 select name, clust_index_size from information_schema.innodb_tablestats
22 where name = 'test/t1';
23
24 --echo # This will reserve 2 extents.
25 insert into t1 values (2, repeat('%', 1045121), repeat('~', 1045121));
26
27 set global innodb_buf_flush_list_now = 1;
28
29 select name, clust_index_size from information_schema.innodb_tablestats
30 where name = 'test/t1';
31
32 --echo # This will reserve 1 extent.
33 insert into t1 values (3, repeat('%', 1045119), repeat('~', 1045119));
34
35 set global innodb_buf_flush_list_now = 1;
36
37 select name, clust_index_size from information_schema.innodb_tablestats
38 where name = 'test/t1';
39
40 drop table t1;
41
42 set global innodb_compression_level=0;
43
44 create table t2 (f1 int primary key, f2 longblob, f3 longblob) engine=innodb
45 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
46
47 select name, clust_index_size from information_schema.innodb_tablestats
48 where name = 'test/t2';
49
50 --echo # For KBS=1, the payload is 986 bytes. The extent will contain
51 --echo # 1048576/1024 = 1024 pages. So total bytes is 1024 * 986 = 1009664.
52 --echo # This will reserve 1 extent.
53 insert into t2 values (1, repeat('%', 1009664), repeat('~', 1009664));
54 set global innodb_buf_flush_list_now = 1;
55
56 select name, clust_index_size from information_schema.innodb_tablestats
57 where name = 'test/t2';
58
59 --echo # This will reserve 2 extent.
60 insert into t2 values (2, repeat('%', 1009665), repeat('~', 1009665));
61 set global innodb_buf_flush_list_now = 1;
62
63 select name, clust_index_size from information_schema.innodb_tablestats
64 where name = 'test/t2';
65
66 --echo # This will reserve 1 extent.
67 insert into t2 values (3, repeat('%', 1009663), repeat('~', 1009663));
68 set global innodb_buf_flush_list_now = 1;
69
70 select name, clust_index_size from information_schema.innodb_tablestats
71 where name = 'test/t2';
72
73 drop table t2;
74
75 set global innodb_compression_level=3;
76
77 create table t3 (f1 int primary key, f2 longblob, f3 longblob) engine=innodb
78 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
79
80 select name, clust_index_size from information_schema.innodb_tablestats
81 where name = 'test/t3';
82
83 --echo # For KBS=1, the payload is 986 bytes. The extent will contain
84 --echo # 1048576/1024 = 1024 pages. So total bytes is 4 * 1024 * 986 = 4038656.
85 --echo # This will reserve <= 4 extent.
86 insert into t3 values (1, repeat('%', 4038656), repeat('~', 4038656));
87 set global innodb_buf_flush_list_now = 1;
88
89 select name, clust_index_size from information_schema.innodb_tablestats
90 where name = 'test/t3';
91
92 --echo # This will reserve <= 4 extent
93 insert into t3 values (2, repeat('%', 4038655), repeat('~', 4038655));
94 set global innodb_buf_flush_list_now = 1;
95
96 select name, clust_index_size from information_schema.innodb_tablestats
97 where name = 'test/t3';
98
99 --echo # This will reserve <= 4 extent
100 insert into t3 values (3, repeat('%', 4038657), repeat('~', 4038657));
101 set global innodb_buf_flush_list_now = 1;
102
103 select name, clust_index_size from information_schema.innodb_tablestats
104 where name = 'test/t3';
105
106 drop table t3;
107
108 set global innodb_compression_level=default;