Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
112 additions
and
21 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
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,6 @@ | ||
--innodb-encrypt-log=ON | ||
--plugin-load-add=$FILE_KEY_MANAGEMENT_SO | ||
--loose-file-key-management | ||
--loose-file-key-management-filekey=FILE:$MTR_SUITE_DIR/filekeys-data.key | ||
--loose-file-key-management-filename=$MTR_SUITE_DIR/filekeys-data.enc | ||
--loose-file-key-management-encryption-algorithm=aes_cbc |
7 changes: 7 additions & 0 deletions
7
mysql-test/suite/mariabackup/encrypted_page_corruption.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,7 @@ | ||
call mtr.add_suppression("\\[ERROR\\] InnoDB: The page .* in file .* cannot be decrypted."); | ||
CREATE TABLE t1(c VARCHAR(128)) ENGINE INNODB, encrypted=yes; | ||
insert into t1 select repeat('a',100); | ||
# Corrupt the table | ||
# xtrabackup backup | ||
FOUND 1 /Database page corruption detected/ in backup.log | ||
drop table t1; |
50 changes: 50 additions & 0 deletions
50
mysql-test/suite/mariabackup/encrypted_page_corruption.test
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_file_key_management.inc | ||
|
||
call mtr.add_suppression("\\[ERROR\\] InnoDB: The page .* in file .* cannot be decrypted."); | ||
CREATE TABLE t1(c VARCHAR(128)) ENGINE INNODB, encrypted=yes; | ||
insert into t1 select repeat('a',100); | ||
|
||
let $MYSQLD_DATADIR=`select @@datadir`; | ||
let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd; | ||
|
||
--source include/shutdown_mysqld.inc | ||
|
||
--echo # Corrupt the table | ||
|
||
perl; | ||
use strict; | ||
use warnings; | ||
use Fcntl qw(:DEFAULT :seek); | ||
|
||
my $ibd_file = $ENV{'t1_IBD'}; | ||
|
||
my $chunk; | ||
my $len; | ||
|
||
sysopen IBD_FILE, $ibd_file, O_RDWR || die "Unable to open $ibd_file"; | ||
sysseek IBD_FILE, 16384 * 3, SEEK_CUR; | ||
$chunk = '\xAA\xAA\xAA\xAA'; | ||
syswrite IBD_FILE, $chunk, 4; | ||
|
||
close IBD_FILE; | ||
EOF | ||
|
||
--source include/start_mysqld.inc | ||
|
||
echo # xtrabackup backup; | ||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; | ||
let $backuplog=$MYSQLTEST_VARDIR/tmp/backup.log; | ||
|
||
--disable_result_log | ||
--error 1 | ||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir > $backuplog; | ||
--enable_result_log | ||
|
||
|
||
--let SEARCH_PATTERN=Database page corruption detected | ||
--let SEARCH_FILE=$backuplog | ||
--source include/search_pattern_in_file.inc | ||
remove_file $backuplog; | ||
|
||
drop table t1; | ||
rmdir $targetdir; |