Skip to content

Commit f9cc391

Browse files
committed
Merge 10.1 into 10.2
This only merges MDEV-12253, adapting it to MDEV-12602 which is already present in 10.2 but not yet in the 10.1 revision that is being merged. TODO: Error handling in crash recovery needs to be improved. If a page cannot be decrypted (or read), we should cleanly abort the startup. If innodb_force_recovery is specified, we should ignore the problematic page and apply redo log to other pages. Currently, the test encryption.innodb-redo-badkey randomly fails like this (the last messages are from cmake -DWITH_ASAN): 2017-05-05 10:19:40 140037071685504 [Note] InnoDB: Starting crash recovery from checkpoint LSN=1635994 2017-05-05 10:19:40 140037071685504 [ERROR] InnoDB: Missing MLOG_FILE_NAME or MLOG_FILE_DELETE before MLOG_CHECKPOINT for tablespace 1 2017-05-05 10:19:40 140037071685504 [ERROR] InnoDB: Plugin initialization aborted at srv0start.cc[2201] with error Data structure corruption 2017-05-05 10:19:41 140037071685504 [Note] InnoDB: Starting shutdown... i================================================================= ==5226==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x612000018588 in thread T0 #0 0x736750 in operator delete(void*) (/mariadb/server/build/sql/mysqld+0x736750) #1 0x1e4833f in LatchCounter::~LatchCounter() /mariadb/server/storage/innobase/include/sync0types.h:599:4 #2 0x1e480b8 in LatchMeta<LatchCounter>::~LatchMeta() /mariadb/server/storage/innobase/include/sync0types.h:786:17 #3 0x1e35509 in sync_latch_meta_destroy() /mariadb/server/storage/innobase/sync/sync0debug.cc:1622:3 #4 0x1e35314 in sync_check_close() /mariadb/server/storage/innobase/sync/sync0debug.cc:1839:2 #5 0x1dfdc18 in innodb_shutdown() /mariadb/server/storage/innobase/srv/srv0start.cc:2888:2 #6 0x197e5e6 in innobase_init(void*) /mariadb/server/storage/innobase/handler/ha_innodb.cc:4475:3
2 parents db0917f + 765a436 commit f9cc391

File tree

188 files changed

+3487
-2903
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+3487
-2903
lines changed

mysql-test/std_data/keys.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
5;966050D7777350B6FD5CCB3E5F648DA45C63BEFB6DEDDFA13443F156B7D35C84
1111
6;B5EA210C8C09EF20DB95EC584714A89F # and yet another
12-
12+
10;770A8A65DA156D24EE2A093277530143

mysql-test/std_data/keys2.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
1;593E580927F47AB530D3B1237CDEF6D6
1+
1;770A8A65DA156D24EE2A093277530142
22
2;352E42F1B9DB5CB915C3262FE745520A
33
3;CFE065600F5EB57481075C65180C3F8A
44
4;205379930183490D3BECA139BDF4DB5B
55
5;E2D944D5D837A1DCB22FF7FD397892EE
66
6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
77
19;678D6B0063824BACCE33224B385104B35F30FF5749F0EBC030A0955DBC7FAC34
8+
20;BAFE99B0BB87F2CD33A6AF26A11F6BD1

mysql-test/std_data/keys3.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1;593E580927F47AB530D3B1237CDEF6D6
1+
1;770A8A65DA156D24EE2A093277530142
22
2;E4B00A45BF775B4E07D634EC5CA5912B
33
3;6E35ACB162B29D1FB9E178021DAF16ED
44
4;971A664A88EE0022D408E40BFAB17E79

mysql-test/suite/encryption/r/create_or_replace.result

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
call mtr.add_suppression("InnoDB: Error: trying to do an operation on a dropped tablespace.*");
21
SET default_storage_engine = InnoDB;
32
CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
43
CREATE TABLE t2 AS SELECT * FROM t1;
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
SET GLOBAL innodb_file_per_table = ON;
2+
SET GLOBAL innodb_file_format = `Barracuda`;
23
create table t1 (a varchar(255)) engine=innodb encrypted=yes;
34
create table t2 (a varchar(255)) engine=innodb;
5+
show warnings;
6+
Level Code Message
47
create table t3 (a varchar(255)) engine=innodb encrypted=no;
5-
insert t1 values (repeat('foobar', 42));
6-
insert t2 values (repeat('temp', 42));
7-
insert t3 values (repeat('dummy', 42));
8+
insert t1 values (repeat('foobarsecret', 12));
9+
insert t2 values (repeat('tempsecret', 12));
10+
insert t3 values (repeat('dummysecret', 12));
811
# Wait max 10 min for key encryption threads to encrypt all spaces
912
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
1013
NAME
@@ -17,15 +20,14 @@ test/t1
1720
test/t2
1821
innodb_system
1922
# t1 yes on expecting NOT FOUND
20-
NOT FOUND /foobar/ in t1.ibd
23+
NOT FOUND /foobarsecret/ in t1.ibd
2124
# t2 ... on expecting NOT FOUND
22-
NOT FOUND /temp/ in t2.ibd
25+
NOT FOUND /tempsecret/ in t2.ibd
2326
# t3 no on expecting FOUND
24-
FOUND 42 /dummy/ in t3.ibd
27+
FOUND 12 /dummysecret/ in t3.ibd
2528
# ibdata1 expecting NOT FOUND
26-
NOT FOUND /foobar/ in ibdata1
29+
NOT FOUND /foobarsecret/ in ibdata1
2730
# Now turn off encryption and wait for threads to decrypt everything
28-
SET GLOBAL innodb_encryption_threads = 1;
2931
SET GLOBAL innodb_encrypt_tables = off;
3032
# Wait max 10 min for key encryption threads to decrypt all spaces
3133
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
@@ -39,15 +41,14 @@ SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_
3941
NAME
4042
test/t1
4143
# t1 yes on expecting NOT FOUND
42-
NOT FOUND /foobar/ in t1.ibd
43-
# t2 ... on expecting FOUND
44-
NOT FOUND /temp/ in t2.ibd
44+
NOT FOUND /foobarsecret/ in t1.ibd
45+
# t2 ... default expecting FOUND
46+
FOUND 12 /tempsecret/ in t2.ibd
4547
# t3 no on expecting FOUND
46-
FOUND 42 /dummy/ in t3.ibd
48+
FOUND 12 /dummysecret/ in t3.ibd
4749
# ibdata1 expecting NOT FOUND
48-
NOT FOUND /foobar/ in ibdata1
50+
NOT FOUND /foobarsecret/ in ibdata1
4951
# Now turn on encryption and wait for threads to encrypt all spaces
50-
SET GLOBAL innodb_encryption_threads = 4;
5152
SET GLOBAL innodb_encrypt_tables = on;
5253
# Wait max 10 min for key encryption threads to encrypt all spaces
5354
SELECT NAME FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION = 0;
@@ -61,11 +62,11 @@ test/t1
6162
test/t2
6263
innodb_system
6364
# t1 yes on expecting NOT FOUND
64-
NOT FOUND /foobar/ in t1.ibd
65+
NOT FOUND /foobarsecret/ in t1.ibd
6566
# t2 ... on expecting NOT FOUND
66-
NOT FOUND /temp/ in t2.ibd
67+
NOT FOUND /tempsecret/ in t2.ibd
6768
# t3 no on expecting FOUND
68-
FOUND 42 /dummy/ in t3.ibd
69+
FOUND 12 /dummysecret/ in t3.ibd
6970
# ibdata1 expecting NOT FOUND
70-
NOT FOUND /foobar/ in ibdata1
71+
NOT FOUND /foobarsecret/ in ibdata1
7172
drop table t1, t2, t3;

mysql-test/suite/encryption/r/filekeys_emptyfile.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call mtr.add_suppression("System key id 1 is missing at");
22
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
33
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
4-
FOUND 1 /System key id 1 is missing at/ in mysqld.1.err
4+
FOUND /System key id 1 is missing at/ in mysqld.1.err
55
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
66
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
77
select plugin_status from information_schema.plugins

mysql-test/suite/encryption/r/filekeys_encfile_bad.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
22
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
33
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
4-
FOUND 1 /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
4+
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
55
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
66
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
77
select plugin_status from information_schema.plugins

mysql-test/suite/encryption/r/filekeys_encfile_badfile.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call mtr.add_suppression("File 'bad' not found");
22
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
33
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
4-
FOUND 1 /File 'bad' not found/ in mysqld.1.err
4+
FOUND /File 'bad' not found/ in mysqld.1.err
55
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
66
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
77
select plugin_status from information_schema.plugins

mysql-test/suite/encryption/r/filekeys_encfile_no.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call mtr.add_suppression("Cannot decrypt .*filekeys-data.enc. Wrong key");
22
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
33
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
4-
FOUND 1 /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
4+
FOUND /Cannot decrypt .*filekeys-data.enc. Wrong key/ in mysqld.1.err
55
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
66
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
77
select plugin_status from information_schema.plugins

mysql-test/suite/encryption/r/filekeys_nofile.result

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
call mtr.add_suppression("file-key-management-filename is not set");
22
call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
33
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
4-
FOUND 1 /file-key-management-filename is not set/ in mysqld.1.err
4+
FOUND /file-key-management-filename is not set/ in mysqld.1.err
55
create table t1(c1 bigint not null, b char(200)) engine=innodb encrypted=yes encryption_key_id=1;
66
ERROR HY000: Can't create table `test`.`t1` (errno: 140 "Wrong create options")
77
select plugin_status from information_schema.plugins

0 commit comments

Comments
 (0)