File: blob_page_reserve.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (108 lines) | stat: -rw-r--r-- 3,704 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
--source include/no_valgrind_without_big.inc
--source include/have_debug.inc

--echo #
--echo # Bug #18756233	 ASSERT !HAS_DONE_RESERVATION,
--echo # FSEG_ALLOC_FREE_PAGE_LOW(), BTR_STORE_BIG_REC_EXTE
--echo #

create table t1 (f1 int primary key, f2 longblob, f3 longblob) engine = innodb;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t1';

--echo # If the page size is 16K, an uncompressed blob page can hold
--echo # data of 16330 bytes.  Insert 64 pages of data (64 * 16330 =
--echo # 1045120 bytes) so that 1 extent will be reserved and used.
insert into t1 values (1, repeat('%', 1045120), repeat('~', 1045120));

set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t1';

--echo # This will reserve 2 extents.
insert into t1 values (2, repeat('%', 1045121), repeat('~', 1045121));

set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t1';

--echo # This will reserve 1 extent.
insert into t1 values (3, repeat('%', 1045119), repeat('~', 1045119));

set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t1';

drop table t1;

set global innodb_compression_level=0;

create table t2 (f1 int primary key, f2 longblob, f3 longblob) engine=innodb
 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t2';

--echo # For KBS=1, the payload is 986 bytes.  The extent will contain
--echo # 1048576/1024 = 1024 pages. So total bytes is 1024 * 986 = 1009664.
--echo # This will reserve 1 extent.
insert into t2 values (1, repeat('%', 1009664), repeat('~', 1009664));
set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t2';

--echo # This will reserve 2 extent.
insert into t2 values (2, repeat('%', 1009665), repeat('~', 1009665));
set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t2';

--echo # This will reserve 1 extent.
insert into t2 values (3, repeat('%', 1009663), repeat('~', 1009663));
set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t2';

drop table t2;

set global innodb_compression_level=3;

create table t3 (f1 int primary key, f2 longblob, f3 longblob) engine=innodb
 ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t3';

--echo # For KBS=1, the payload is 986 bytes.  The extent will contain
--echo # 1048576/1024 = 1024 pages. So total bytes is 4 * 1024 * 986 = 4038656.
--echo # This will reserve <= 4 extent.
insert into t3 values (1, repeat('%', 4038656), repeat('~', 4038656));
set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t3';

--echo # This will reserve <= 4 extent
insert into t3 values (2, repeat('%', 4038655), repeat('~', 4038655));
set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t3';

--echo # This will reserve <= 4 extent
insert into t3 values (3, repeat('%', 4038657), repeat('~', 4038657));
set global innodb_buf_flush_list_now = 1;

select name, clust_index_size from information_schema.innodb_tablestats
where name = 'test/t3';

drop table t3;

set global innodb_compression_level=default;