summaryrefslogtreecommitdiff
path: root/mysql-test/suite/encryption/t/innodb-log-encrypt.test
blob: 0555f9d49aa6b2be92f1a6f78abbddda4fbb46e2 (plain)
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
-- source include/have_innodb.inc
-- source include/not_embedded.inc
-- source filekeys_plugin.inc

#
# MDEV-9011: Redo log encryption does not work
#

SET GLOBAL innodb_file_format = `Barracuda`;
SET GLOBAL innodb_file_per_table = ON;

create table t1(c1 bigint not null, b char(200), c varchar(200)) engine=innodb encrypted=yes encryption_key_id=1;
show warnings;

delimiter //;
create procedure innodb_insert_proc (repeat_count int)
begin
  declare current_num int;
  set current_num = 0;
  while current_num < repeat_count do
    insert into t1 values(current_num, substring(MD5(RAND()), -64), REPEAT('privatejanprivate',10));
    set current_num = current_num + 1;
  end while;
end//
delimiter ;//
commit;

begin;
call innodb_insert_proc(2000);
commit;

update t1 set c1 = c1 +1;
select count(*) from t1;

--let $MYSQLD_DATADIR=`select @@datadir`
--let ib1_IBD = $MYSQLD_DATADIR/ibdata1
--let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd
--let log0 = $MYSQLD_DATADIR/ib_logfile0
--let log1 = $MYSQLD_DATADIR/ib_logfile1
--let SEARCH_RANGE = 10000000
--let SEARCH_PATTERN=privatejanprivate

-- source include/kill_mysqld.inc

--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
--echo # t1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--echo # log0 yes on expecting NOT FOUND
-- let SEARCH_FILE=$log0
-- source include/search_pattern_in_file.inc
--echo # log1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$log1
-- source include/search_pattern_in_file.inc

--echo # Restart mysqld --innodb_encrypt_log=0
-- let $restart_parameters=--innodb_encrypt_log=0
-- source include/start_mysqld.inc

insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));
insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('publicmessage',10));

--let SEARCH_PATTERN=privatejanprivate
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
--echo # t1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--echo # log0 yes on expecting NOT FOUND
-- let SEARCH_FILE=$log0
-- source include/search_pattern_in_file.inc
--echo # log1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$log1
-- source include/search_pattern_in_file.inc

--let SEARCH_PATTERN=publicmessage
--echo # ibdata1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$ib1_IBD
-- source include/search_pattern_in_file.inc
--echo # t1 yes on expecting NOT FOUND
-- let SEARCH_FILE=$t1_IBD
-- source include/search_pattern_in_file.inc
--echo # log0 no on expecting FOUND/NOTFOUND depending where insert goes
-- let SEARCH_FILE=$log0
-- source include/search_pattern_in_file.inc
--echo # log1 no on expecting FOUND/NOTFOUND depending where insert goes
-- let SEARCH_FILE=$log1
-- source include/search_pattern_in_file.inc

drop procedure innodb_insert_proc;
drop table t1;