Debian Codegraph @

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

raw
1 --source include/have_debug.inc
2 --source include/have_innodb_16k.inc
3 --source include/have_punch_hole.inc
4
5 --echo #
6 --echo # WL#13775 - InnoDB: Encrypt DBLWR files
7 --echo #
8
9 --echo #
10 --echo # Test Begin: Test if recovery works if first page of user
11 --echo # tablespace is corrupted. Valid copy of that page is there
12 --echo # in DBLWR file.
13 --echo #
14
15 --disable_query_log
16 call mtr.add_suppression("A bad Space ID was found in datafile");
17 call mtr.add_suppression("\\[ERROR\\] .* Space ID in fsp header is \\d+, but in the page header it is \\d+");
18 call mtr.add_suppression("Header page contains inconsistent data in datafile");
19 --enable_query_log
20
21 # Slow shutdown and restart to make sure ibuf merge is finished
22 SET GLOBAL innodb_fast_shutdown = 0;
23 --source include/restart_mysqld.inc
24
25 CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 BLOB) COMPRESSION='zlib' ENCRYPTION='Y';
26
27 START TRANSACTION;
28 INSERT INTO t1 VALUES(1, repeat('#',12));
29 INSERT INTO t1 VALUES(2, repeat('+',12));
30 INSERT INTO t1 VALUES(3, repeat('/',12));
31 INSERT INTO t1 VALUES(4, repeat('-',12));
32 INSERT INTO t1 VALUES(5, repeat('.',12));
33 COMMIT WORK;
34
35 --echo # Wait for purge to complete
36 --source include/wait_innodb_all_purged.inc
37
38 --echo # Ensure that dirty pages of table t1 is flushed.
39 FLUSH TABLES t1 FOR EXPORT;
40 UNLOCK TABLES;
41
42 SET GLOBAL innodb_master_thread_disabled_debug=1;
43 SET GLOBAL innodb_checkpoint_disabled = 1;
44
45 BEGIN;
46 INSERT INTO t1 VALUES (6, repeat('%', 12));
47
48 SET SESSION innodb_interpreter = 'init';
49 SET SESSION innodb_interpreter = 'buf_flush_sync_all_buf_pools';
50 SET SESSION innodb_interpreter = 'open_table test/t1';
51 SET SESSION innodb_interpreter = 'find_space_id test/t1';
52 SELECT @@session.innodb_interpreter_output INTO @space_id;
53 SET @cmd = CONCAT('make_page_dirty ', @space_id, ' 0');
54 SET SESSION innodb_interpreter = @cmd;
55 SET SESSION innodb_interpreter = 'corrupt_ondisk_page0 test/t1';
56 SET SESSION innodb_interpreter = 'destroy';
57
58 --source include/kill_and_restart_mysqld.inc
59
60 SET SESSION innodb_interpreter = 'init';
61 SET SESSION innodb_interpreter = 'print_dblwr_has_encrypted_pages';
62 SET SESSION innodb_interpreter = 'destroy';
63
64 let SEARCH_FILE= $MYSQLTEST_VARDIR/log/mysqld.1.err;
65 let SEARCH_PATTERN= Double write file has encrypted pages;
66 --source include/search_pattern.inc
67
68 let SEARCH_PATTERN=\\[Note\\] .* Restoring page \\[page id: space=\\d+, page number=0\\] of datafile .* from the doublewrite buffer. Writing .*;
69 --source include/search_pattern.inc
70
71 CHECK TABLE t1;
72 SELECT f1, f2 FROM t1;
73
74 DROP TABLE t1;
75 --echo # Test End