mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
Make sure that when we publish the crypt_data we access the memory cache of the tablespace crypt_data. Make sure that crypt_data is stored whenever it is really needed. All this is not yet enough in my opinion because: sql/encryption.cc has DBUG_ASSERT(scheme->type == 1) i.e. crypt_data->type == CRYPT_SCHEME_1 However, for InnoDB point of view we have global crypt_data for every tablespace. When we change variables on crypt_data we take mutex. However, when we use crypt_data for encryption/decryption we use pointer to this global structure and no mutex to protect against changes on crypt_data. Tablespace encryption starts in fil_crypt_start_encrypting_space from crypt_data that has crypt_data->type = CRYPT_SCHEME_UNENCRYPTED and later we write page 0 CRYPT_SCHEME_1 and finally whe publish that to memory cache.
This commit is contained in:
@@ -3,3 +3,15 @@ CREATE TABLE t1 (pk INT PRIMARY KEY, c VARCHAR(256));
|
||||
CREATE TABLE t2 AS SELECT * FROM t1;
|
||||
drop table t1,t2;
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
SET GLOBAL innodb_encryption_threads = 4;
|
||||
CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
|
||||
INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
|
||||
CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;
|
||||
CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
|
||||
INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
|
||||
INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
|
||||
INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
|
||||
INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
|
||||
drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
SET GLOBAL innodb_encrypt_tables = OFF;
|
||||
|
@@ -33,4 +33,77 @@ dec $i;
|
||||
--enable_query_log
|
||||
|
||||
drop table t1,t2;
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
|
||||
#
|
||||
# MDEV-8173: InnoDB; Failing assertion: crypt_data->type == 1
|
||||
#
|
||||
|
||||
SET GLOBAL innodb_encryption_threads = 4;
|
||||
|
||||
CREATE TABLE `table10_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
|
||||
INSERT /*! IGNORE */ INTO table10_int_autoinc VALUES (NULL, NULL, -474021888) , (1, NULL, NULL) , (1141047296, NULL, NULL) , (NULL, NULL, NULL) , (NULL, NULL, 1) , (NULL, NULL, 9) , (0, NULL, 1225785344) , (NULL, NULL, 1574174720) , (2, NULL, NULL) , (6, NULL, 3);
|
||||
|
||||
CREATE TABLE `table1_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int,key (`col_int_key` ), primary key (pk)) engine=innodb;
|
||||
|
||||
CREATE TABLE `table0_int_autoinc` (`col_int_key` int, pk int auto_increment, `col_int` int, key (`col_int_key` ),primary key (pk)) engine=innodb;
|
||||
|
||||
INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
|
||||
INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
|
||||
INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
|
||||
INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
|
||||
|
||||
--connect (con1,localhost,root,,test)
|
||||
--connect (con2,localhost,root,,test)
|
||||
|
||||
--disable_abort_on_error
|
||||
--disable_warnings
|
||||
--disable_query_log
|
||||
|
||||
let $i = 500;
|
||||
while ($i)
|
||||
{
|
||||
connection con1;
|
||||
send SET GLOBAL innodb_encrypt_tables = ON;
|
||||
connection default;
|
||||
CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table1_int_autoinc`;
|
||||
connection con2;
|
||||
send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table10_int_autoinc`;
|
||||
connection default;
|
||||
send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table0_int_autoinc`;
|
||||
connection con1;
|
||||
--reap;
|
||||
send SET GLOBAL innodb_encrypt_tables = OFF;
|
||||
connection con2;
|
||||
--reap;
|
||||
connection default;
|
||||
--reap;
|
||||
send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table1_int_autoinc`;
|
||||
connection con2;
|
||||
send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table10_int_autoinc`;
|
||||
connection con1;
|
||||
--reap;
|
||||
send SET GLOBAL innodb_encrypt_tables = ON;
|
||||
connection default;
|
||||
--reap;
|
||||
send CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table1_int_autoinc`;
|
||||
connection con2;
|
||||
--reap;
|
||||
CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table10_int_autoinc`;
|
||||
CREATE OR REPLACE TABLE `create_or_replace_t` AS SELECT * FROM `table0_int_autoinc`;
|
||||
connection con1;
|
||||
--reap;
|
||||
connection default;
|
||||
--reap;
|
||||
dec $i;
|
||||
}
|
||||
|
||||
--enable_query_log
|
||||
connection default;
|
||||
drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
|
||||
--disconnect con1
|
||||
--disconnect con2
|
||||
--enable_abort_on_error
|
||||
--enable_warnings
|
||||
SET GLOBAL innodb_encryption_threads = 0;
|
||||
SET GLOBAL innodb_encrypt_tables = OFF;
|
||||
|
Reference in New Issue
Block a user