-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-8588: Assertion failure in file ha_innodb.cc line 21140 if at le…
…ast one encrypted table exists and encryption service is not available Analysis: Problem was that in fil_read_first_page we do find that table has encryption information and that encryption service or used key_id is not available. But, then we just printed fatal error message that causes above assertion. Fix: When we open single table tablespace if it has encryption information (crypt_data) store this crypt data to the table structure. When we open a table and we find out that tablespace is not available, check has table a encryption information and from there is encryption service or used key_id is not available. If it is, add additional warning for SQL-layer.
- Loading branch information
Jan Lindström
committed
Sep 4, 2015
1 parent
e9b6f95
commit e197823
Showing
17 changed files
with
223 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
mysql-test/suite/encryption/r/innodb-bad-key-change.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); | ||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*"); | ||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); | ||
|
||
# Start server with keys2.txt | ||
SET GLOBAL innodb_file_format = `Barracuda`; | ||
SET GLOBAL innodb_file_per_table = ON; | ||
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2; | ||
INSERT INTO t1 VALUES ('foobar'); | ||
ALTER TABLE t1 ADD COLUMN c2 INT; | ||
INSERT INTO t1 VALUES ('foobar',2); | ||
SELECT * FROM t1; | ||
c c2 | ||
foobar NULL | ||
foobar 2 | ||
TRUNCATE TABLE t1; | ||
SELECT * FROM t1; | ||
c c2 | ||
INSERT INTO t1 VALUES ('foobar',1); | ||
INSERT INTO t1 VALUES ('foobar',2); | ||
FLUSH TABLE WITH READ LOCK; | ||
SELECT * FROM t1; | ||
c c2 | ||
foobar 1 | ||
foobar 2 | ||
|
||
# Restart server with keysbad3.txt | ||
SELECT * FROM t1; | ||
ERROR 42S02: Table 'test.t1' doesn't exist in engine | ||
SHOW WARNINGS; | ||
Level Code Message | ||
Warning 1812 Tablespace is missing for table 'test/t1' | ||
Warning 155 Table test/t1 is encrypted but encryption service or used key_id 2 is not available. Can't continue reading table. | ||
Error 1932 Table 'test.t1' doesn't exist in engine | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
-- source include/have_innodb.inc | ||
-- source include/have_file_key_management_plugin.inc | ||
# embedded does not support restart | ||
-- source include/not_embedded.inc | ||
|
||
call mtr.add_suppression("Plugin 'file_key_management' init function returned error"); | ||
call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*"); | ||
call mtr.add_suppression("Plugin 'file_key_management' registration.*failed"); | ||
|
||
--echo | ||
--echo # Start server with keys2.txt | ||
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt | ||
-- source include/restart_mysqld.inc | ||
|
||
--disable_query_log | ||
let $innodb_file_format_orig = `SELECT @@innodb_file_format`; | ||
let $innodb_file_per_table_orig = `SELECT @@innodb_file_per_table`; | ||
--enable_query_log | ||
|
||
SET GLOBAL innodb_file_format = `Barracuda`; | ||
SET GLOBAL innodb_file_per_table = ON; | ||
|
||
CREATE TABLE t1 (c VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=2; | ||
INSERT INTO t1 VALUES ('foobar'); | ||
ALTER TABLE t1 ADD COLUMN c2 INT; | ||
INSERT INTO t1 VALUES ('foobar',2); | ||
SELECT * FROM t1; | ||
TRUNCATE TABLE t1; | ||
SELECT * FROM t1; | ||
INSERT INTO t1 VALUES ('foobar',1); | ||
INSERT INTO t1 VALUES ('foobar',2); | ||
FLUSH TABLE WITH READ LOCK; | ||
SELECT * FROM t1; | ||
|
||
--echo | ||
--echo # Restart server with keysbad3.txt | ||
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt | ||
-- source include/restart_mysqld.inc | ||
|
||
--error 1932 | ||
SELECT * FROM t1; | ||
SHOW WARNINGS; | ||
|
||
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt | ||
-- source include/restart_mysqld.inc | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.