Debian Codegraph @

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

raw
1 --source include/big_test.inc
2 --source include/have_innodb_16k.inc
3 --source include/have_debug.inc
4 --source include/not_valgrind.inc
5
6
7 --echo # Ensure that there is not already lot of data to be purged.
8 --echo # If timeout happens here, then check the chain of previously
9 --echo # executed test cases.
10 let $wait_timeout = 100;
11 --source include/wait_innodb_all_purged.inc
12
13 SET GLOBAL innodb_compression_level = 0;
14
15 CREATE TABLE `t`
16 (`id` INT NOT NULL AUTO_INCREMENT,
17 `b` LONGBLOB,
18 PRIMARY KEY(`id`)) ENGINE=InnoDB ROW_FORMAT=COMPRESSED;
19
20 DELIMITER $;
21 CREATE PROCEDURE p(p_num INT)
22 BEGIN
23 DECLARE v_i INT DEFAULT 0;
24 REPEAT
25 UPDATE t SET b:=REPEAT('a',1024*1024*4);
26 UPDATE t SET b:=REPEAT('b',1024*1024*4);
27 SET v_i:=v_i+1;
28 UNTIL v_i>p_num END REPEAT;
29 END $
30 DELIMITER ;$
31
32 SET @b:=repeat('b',4*1024*1024);
33 INSERT INTO t(id,b) VALUES(1,@b);
34
35 START TRANSACTION;
36 CALL p(20);
37 COMMIT;
38
39 FLUSH TABLES `t` FOR EXPORT;
40 UNLOCK TABLES;
41 let $wait_timeout = 100;
42 --source include/wait_innodb_all_purged.inc
43
44 SET @fs1 = (SELECT file_size FROM information_schema.innodb_tablespaces
45 WHERE name = 'test/t');
46
47 START TRANSACTION;
48 CALL p(20);
49 COMMIT;
50
51 FLUSH TABLES `t` FOR EXPORT;
52 UNLOCK TABLES;
53 let $wait_timeout = 100;
54 --source include/wait_innodb_all_purged.inc
55
56 SET @fs2 = (SELECT file_size FROM information_schema.innodb_tablespaces
57 WHERE name = 'test/t');
58
59 SET @growing = (SELECT (@fs2 - @fs1));
60
61 SELECT @growing;
62
63 if (`SELECT @growing > 0`) {
64 --echo Error: The ibd file 'test/t.ibd' is growing.
65
66 }
67
68 START TRANSACTION;
69 CALL p(20);
70 ROLLBACK;
71
72 FLUSH TABLES `t` FOR EXPORT;
73 UNLOCK TABLES;
74 let $wait_timeout = 100;
75 --source include/wait_innodb_all_purged.inc
76
77 SET @fs3 = (SELECT file_size FROM information_schema.innodb_tablespaces
78 WHERE name = 'test/t');
79
80 SET @growing = (SELECT (@fs3 - @fs2));
81
82 SELECT @growing;
83
84 if (`SELECT @growing > 0`) {
85 --echo Error: The ibd file 'test/t.ibd' is growing.
86
87 }
88
89 DROP PROCEDURE p;
90 DROP TABLE t;
91
92 SET GLOBAL innodb_compression_level = DEFAULT;
93