-
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-8750: Server crashes in page_cur_is_after_last on altering table…
… using a wrong encryption key Analysis: Server tried to continue reading tablespace using a cursor after we had resolved that pages in the tablespace can't be decrypted. Fixed by addind check is tablespace still encrypted.
- Loading branch information
Jan Lindström
committed
Sep 4, 2015
1 parent
7e916bb
commit e04723d
Showing
6 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
mysql-test/suite/encryption/r/innodb-bad-key-change2.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,15 @@ | ||
call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); | ||
call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); | ||
call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); | ||
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); | ||
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); | ||
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; | ||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); | ||
select * from t1; | ||
alter table t1 discard tablespace; | ||
alter table t1 engine=InnoDB; | ||
ERROR 42S02: Table 'test.t1' doesn't exist in engine | ||
show warnings; | ||
Level Code Message | ||
Warning 155 Table test/t1 is encrypted but encryption service or used key_id is not available. Can't continue reading table. | ||
Error 1932 Table 'test.t1' doesn't exist in engine |
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,50 @@ | ||
--source include/have_innodb.inc | ||
|
||
# | ||
# MDEV-8750: Server crashes in page_cur_is_after_last on altering table using a wrong encryption key | ||
# | ||
call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted"); | ||
call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match."); | ||
call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file."); | ||
call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem."); | ||
call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*"); | ||
|
||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--shutdown_server | ||
--source include/wait_until_disconnected.inc | ||
|
||
--write_file $MYSQLTEST_VARDIR/keys1.txt | ||
1;770A8A65DA156D24EE2A093277530142 | ||
4;770A8A65DA156D24EE2A093277530143 | ||
EOF | ||
|
||
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys1.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--enable_reconnect | ||
--source include/wait_until_connected_again.inc | ||
|
||
CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4; | ||
INSERT INTO t1 VALUES (1,'foo'),(2,'bar'); | ||
|
||
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--shutdown_server | ||
--source include/wait_until_disconnected.inc | ||
|
||
--write_file $MYSQLTEST_VARDIR/keys2.txt | ||
1;770A8A65DA156D24EE2A093277530142 | ||
4;770A8A65DA156D24EE2A093277530144 | ||
EOF | ||
|
||
--exec echo "restart:--innodb-encrypt-tables --innodb-stats-persistent --plugin-load-add=file_key_management.so --file-key-management --file-key-management-filename=$MYSQLTEST_VARDIR/keys2.txt" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect | ||
--enable_reconnect | ||
--source include/wait_until_connected_again.inc | ||
|
||
--error 0,ER_NO_SUCH_TABLE_IN_ENGINE | ||
select * from t1; | ||
--error 0,ER_NO_SUCH_TABLE_IN_ENGINE | ||
alter table t1 discard tablespace; | ||
--error ER_NO_SUCH_TABLE_IN_ENGINE | ||
alter table t1 engine=InnoDB; | ||
show warnings; | ||
|
||
--remove_file $MYSQLTEST_VARDIR/keys1.txt | ||
--remove_file $MYSQLTEST_VARDIR/keys2.txt |
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