Debian Codegraph @

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

raw
1 --source include/innodb_page_size.inc
2 --source include/have_sequence.inc
3
4 --echo #
5 --echo # Bug #21950389 SMALL TABLESPACES WITH BLOBS TAKE UP TO 80 TIMES MORE
6 --echo # SPACE IN 5.7 THAN IN 5.6
7 --echo #
8
9 #
10 # Table 1: small rows
11 #
12 CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
13 let MYSQLD_DATADIR=`select @@datadir`;
14 perl;
15 print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
16 EOF
17
18 INSERT INTO t1 SELECT * FROM seq_1_to_25000;
19 perl;
20 print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
21 EOF
22 DROP TABLE t1;
23
24 #
25 # Table 2: BLOB
26 #
27 CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB) ENGINE=InnoDB;
28 perl;
29 print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
30 EOF
31 INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
32 perl;
33 print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
34 EOF
35 DROP TABLE t1;
36
37 let $page_size=`SELECT @@innodb_page_size`;
38 if ($page_size < 32768)
39 {
40 #
41 # Table 3: compressed BLOB
42 #
43 CREATE TABLE t1 (a INT PRIMARY KEY, b BLOB)
44 ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1;
45 perl;
46 print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
47 EOF
48 INSERT INTO t1 SELECT seq,REPEAT('a',30000) FROM seq_1_to_20;
49 # Ensure that the file will be extended with the last 1024-byte page
50 # after the file was pre-extended in 4096-byte increments.
51 --disable_query_log
52 FLUSH TABLE t1 FOR EXPORT;
53 UNLOCK TABLES;
54 --enable_query_log
55 perl;
56 print "# bytes: ", (-s "$ENV{MYSQLD_DATADIR}/test/t1.ibd"), "\n";
57 EOF
58 DROP TABLE t1;
59 }