Debian Codegraph @

mysql-test/suite/innodb/r/dblwr_recover_general_tablespace.result

raw
1 CREATE TABLESPACE ts1 ADD DATAFILE 'ts1.ibd' ENGINE=InnoDB ENCRYPTION='Y';
2 CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 BLOB) TABLESPACE=ts1 ENCRYPTION='Y' ENGINE=InnoDB;
3 SELECT NAME, ENCRYPTION FROM INFORMATION_SCHEMA.INNODB_TABLESPACES where NAME='ts1';
4 NAME ENCRYPTION
5 ts1 Y
6 SHOW CREATE TABLE t1;
7 Table Create Table
8 t1 CREATE TABLE `t1` (
9 `f1` int NOT NULL,
10 `f2` blob,
11 PRIMARY KEY (`f1`)
12 ) /*!50100 TABLESPACE `ts1` */ ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci /*!80016 ENCRYPTION='Y' */
13 SET GLOBAL innodb_fast_shutdown = 0;
14 # restart
15 # Wait for purge to complete
16 START TRANSACTION;
17 INSERT INTO t1 VALUES(1, repeat('#',12));
18 INSERT INTO t1 VALUES(2, repeat('+',12));
19 INSERT INTO t1 VALUES(3, repeat('/',12));
20 INSERT INTO t1 VALUES(4, repeat('-',12));
21 INSERT INTO t1 VALUES(5, repeat('.',12));
22 COMMIT WORK;
23 # Ensure that dirty pages of table t1 is flushed.
24 FLUSH TABLES t1 FOR EXPORT;
25 Warnings:
26 Warning 1235 InnoDB: This version of MySQL doesn't yet support 'FLUSH TABLES FOR EXPORT on table `test`.`t1` in a general tablespace.'
27 UNLOCK TABLES;
28 SET GLOBAL innodb_master_thread_disabled_debug=1;
29 SET GLOBAL innodb_checkpoint_disabled = 1;
30 SET SESSION innodb_interpreter = 'init';
31 # Check if the DBLWR files contain encrypted pages.
32 SET SESSION innodb_interpreter = 'print_dblwr_has_encrypted_pages';
33 SELECT @@session.innodb_interpreter_output;
34 @@session.innodb_interpreter_output
35 Double write file has encrypted pages.
36 SET SESSION innodb_interpreter = 'open_table test/t1';
37 SET SESSION innodb_interpreter = 'find_space_id test/t1';
38 SELECT @@session.innodb_interpreter_output INTO @space_id;
39 SET SESSION innodb_interpreter = 'find_root_page_no test/t1';
40 SELECT @@session.innodb_interpreter_output INTO @page_no;
41 SET @cmd = CONCAT('find_ondisk_page_type ', @space_id, ' ', @page_no);
42 SET SESSION innodb_interpreter = @cmd;
43 SELECT @@session.innodb_interpreter_output INTO @page_type;
44 SELECT @page_type;
45 @page_type
46 FIL_PAGE_ENCRYPTED
47 SET SESSION innodb_interpreter = 'find_tablespace_file_name ts1';
48 SELECT @@session.innodb_interpreter_output INTO @space_file_name;
49 SET SESSION innodb_interpreter = 'find_tablespace_physical_page_size ts1';
50 SELECT @@session.innodb_interpreter_output INTO @space_page_size;
51 SET SESSION innodb_interpreter = 'destroy';
52 START TRANSACTION;
53 INSERT INTO t1 VALUES(6, repeat('?',12));
54 SET GLOBAL innodb_log_flush_now = ON;
55 # Kill the server
56 # Corrupt the root page of table t1 in the user tablespace.
57 # restart
58 Pattern "Double write file has encrypted pages" found
59 Pattern "\[Note\] \[MY-\d+\] \[InnoDB\] Recovered page \[page id: space=\d+, page number=\d+\] from the doublewrite buffer" found
60 CHECK TABLE t1;
61 Table Op Msg_type Msg_text
62 test.t1 check status OK
63 SELECT f1, f2 FROM t1;
64 f1 f2
65 1 ############
66 2 ++++++++++++
67 3 ////////////
68 4 ------------
69 5 ............
70 DROP TABLE t1;
71 DROP TABLESPACE ts1;
72 # Test End