1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-8143: InnoDB: Database page corruption on disk or a failed file read

Analysis: Problem was that we did create crypt data for encrypted table but
this new crypt data was not written to page 0. Instead a default crypt data
was written to page 0 at table creation.

Fixed by explicitly writing new crypt data to page 0 after successfull
table creation.
This commit is contained in:
Jan Lindström
2015-05-13 11:41:22 +03:00
parent be2038e3cb
commit f8cacd03a7
17 changed files with 335 additions and 36 deletions

View File

@ -133,9 +133,8 @@ t1.c1 = t2.c1 and t1.b = t2.b;
select count(*) from innodb_redundant t1, innodb_normal t2 where
t1.c1 = t2.c1 and t1.b = t2.b;
# After alter+restart these should be 0
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
SELECT variable_value = 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_encrypted';
SELECT variable_value >= 0 FROM information_schema.global_status WHERE LOWER(variable_name) = 'innodb_num_pages_decrypted';
drop procedure innodb_insert_proc;
drop table innodb_normal;
@ -144,6 +143,19 @@ drop table innodb_compressed;
drop table innodb_dynamic;
drop table innodb_redundant;
#
# MDEV-8143: InnoDB: Database page corruption on disk or a failed file read
#
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB ENCRYPTION_KEY_ID=2 ENCRYPTED=YES;
INSERT INTO t1 VALUES (1),(2);
--echo # Restarting server...
--source include/restart_mysqld.inc
SELECT * FROM t1;
DROP TABLE t1;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_file_per_table = $innodb_file_per_table_orig;