mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Merge 10.5 into 10.6
This commit is contained in:
@@ -1,21 +1,22 @@
|
|||||||
call mtr.add_suppression("(mysqld|mariadbd).*: File .*");
|
call mtr.add_suppression("mariadbd.*: File .*");
|
||||||
call mtr.add_suppression("Plugin 'file_key_management' .*");
|
call mtr.add_suppression("Plugin 'file_key_management' .*");
|
||||||
call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
|
call mtr.add_suppression("InnoDB: We do not continue the crash recovery");
|
||||||
|
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
||||||
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
|
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
|
||||||
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
|
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
|
||||||
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
|
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=0\\] of corrupted file '.*test.t[1-5]\\.ibd'");
|
||||||
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
|
|
||||||
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
|
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
|
||||||
SET GLOBAL innodb_file_per_table = ON;
|
SET GLOBAL innodb_file_per_table = ON;
|
||||||
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
|
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
|
||||||
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed;
|
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
|
||||||
create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
|
create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
|
||||||
create table t4(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb;
|
create table t4(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes;
|
||||||
begin;
|
begin;
|
||||||
insert into t2 select * from t1;
|
insert into t2 select * from t1;
|
||||||
insert into t3 select * from t1;
|
insert into t3 select * from t1;
|
||||||
insert into t4 select * from t1;
|
insert into t4 select * from t1;
|
||||||
commit;
|
commit;
|
||||||
|
CREATE TABLE t5 (a VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES;
|
||||||
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
||||||
begin;
|
begin;
|
||||||
update t1 set c = repeat('secret3', 20);
|
update t1 set c = repeat('secret3', 20);
|
||||||
@@ -26,8 +27,13 @@ insert into t1 (c,b) values (repeat('secret5',20), repeat('secret6',6000));
|
|||||||
insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
|
insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
|
||||||
insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
|
insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
|
||||||
insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
|
insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
|
||||||
|
INSERT INTO t5 VALUES ('foo'),('bar');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
# Kill the server
|
# Kill the server
|
||||||
|
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys-not-found.txt
|
||||||
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||||
|
WHERE engine = 'innodb'
|
||||||
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||||
|
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
|
||||||
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
|
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
|
||||||
# restart: --file-key-management-filename=MYSQL_TEST_DIR/std_data/keys2.txt
|
drop table t1,t2,t3,t4,t5;
|
||||||
drop table t1, t2,t3,t4;
|
|
||||||
|
@@ -1,3 +1,2 @@
|
|||||||
--innodb-change-buffering=none
|
--innodb-change-buffering=none
|
||||||
--innodb-encrypt-tables=on
|
|
||||||
--innodb-default-encryption-key-id=20
|
--innodb-default-encryption-key-id=20
|
||||||
|
@@ -3,13 +3,13 @@
|
|||||||
# embedded does not support restart
|
# embedded does not support restart
|
||||||
-- source include/not_embedded.inc
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
call mtr.add_suppression("(mysqld|mariadbd).*: File .*");
|
call mtr.add_suppression("mariadbd.*: File .*");
|
||||||
call mtr.add_suppression("Plugin 'file_key_management' .*");
|
call mtr.add_suppression("Plugin 'file_key_management' .*");
|
||||||
call mtr.add_suppression("InnoDB: cannot enable encryption, encryption plugin is not available");
|
call mtr.add_suppression("InnoDB: We do not continue the crash recovery");
|
||||||
|
call mtr.add_suppression("InnoDB: Plugin initialization aborted");
|
||||||
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
|
call mtr.add_suppression("Plugin 'InnoDB' init function returned error\\.");
|
||||||
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
|
call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed.");
|
||||||
call mtr.add_suppression("InnoDB: The page \\[page id: space=[0-9]+, page number=[0-9]+\\] in file '.*test.t[1-4]\\.ibd' cannot be decrypted\\.");
|
call mtr.add_suppression("InnoDB: Cannot apply log to \\[page id: space=[1-9][0-9]*, page number=0\\] of corrupted file '.*test.t[1-5]\\.ibd'");
|
||||||
call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]*, page number=[1-9][0-9]*\\]");
|
|
||||||
|
|
||||||
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
|
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
|
||||||
-- source include/restart_mysqld.inc
|
-- source include/restart_mysqld.inc
|
||||||
@@ -17,9 +17,9 @@ call mtr.add_suppression("failed to read or decrypt \\[page id: space=[1-9][0-9]
|
|||||||
SET GLOBAL innodb_file_per_table = ON;
|
SET GLOBAL innodb_file_per_table = ON;
|
||||||
|
|
||||||
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
|
create table t1(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes encryption_key_id=20;
|
||||||
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed;
|
create table t2(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb row_format=compressed encrypted=yes;
|
||||||
create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
|
create table t3(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes encryption_key_id=20;
|
||||||
create table t4(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb;
|
create table t4(a int not null primary key auto_increment, c char(200), b blob, index(b(10))) engine=innodb encrypted=yes;
|
||||||
|
|
||||||
begin;
|
begin;
|
||||||
--disable_query_log
|
--disable_query_log
|
||||||
@@ -45,6 +45,7 @@ commit;
|
|||||||
# happens, InnoDB refuses to start as used
|
# happens, InnoDB refuses to start as used
|
||||||
# encryption key is not found.
|
# encryption key is not found.
|
||||||
#
|
#
|
||||||
|
CREATE TABLE t5 (a VARCHAR(8)) ENGINE=InnoDB ENCRYPTED=YES;
|
||||||
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
SET GLOBAL innodb_flush_log_at_trx_commit=1;
|
||||||
begin;
|
begin;
|
||||||
update t1 set c = repeat('secret3', 20);
|
update t1 set c = repeat('secret3', 20);
|
||||||
@@ -55,12 +56,19 @@ insert into t1 (c,b) values (repeat('secret5',20), repeat('secret6',6000));
|
|||||||
insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
|
insert into t2 (c,b) values (repeat('secret7',20), repeat('secret8',6000));
|
||||||
insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
|
insert into t3 (c,b) values (repeat('secret9',20), repeat('secre10',6000));
|
||||||
insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
|
insert into t4 (c,b) values (repeat('secre11',20), repeat('secre12',6000));
|
||||||
|
INSERT INTO t5 VALUES ('foo'),('bar');
|
||||||
COMMIT;
|
COMMIT;
|
||||||
let $cleanup= drop table t1,t2,t3,t4;
|
|
||||||
|
let $cleanup= drop table t1,t2,t3,t4,t5;
|
||||||
--let CLEANUP_IF_CHECKPOINT= $cleanup;
|
--let CLEANUP_IF_CHECKPOINT= $cleanup;
|
||||||
--source ../../suite/innodb/include/no_checkpoint_end.inc
|
--source ../../suite/innodb/include/no_checkpoint_end.inc
|
||||||
|
|
||||||
|
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys-not-found.txt
|
||||||
-- source include/start_mysqld.inc
|
-- source include/start_mysqld.inc
|
||||||
|
SELECT * FROM INFORMATION_SCHEMA.ENGINES
|
||||||
|
WHERE engine = 'innodb'
|
||||||
|
AND support IN ('YES', 'DEFAULT', 'ENABLED');
|
||||||
|
|
||||||
#
|
#
|
||||||
# In above server does start but InnoDB refuses to start
|
# In above server does start but InnoDB refuses to start
|
||||||
# thus we need to restart server with correct key file
|
# thus we need to restart server with correct key file
|
||||||
@@ -68,4 +76,4 @@ let $cleanup= drop table t1,t2,t3,t4;
|
|||||||
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
|
-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys2.txt
|
||||||
-- source include/restart_mysqld.inc
|
-- source include/restart_mysqld.inc
|
||||||
|
|
||||||
drop table t1, t2,t3,t4;
|
drop table t1,t2,t3,t4,t5;
|
||||||
|
@@ -2651,6 +2651,13 @@ tablespace_check:
|
|||||||
? fil_space_read_crypt_data(fil_space_t::zip_size(flags),
|
? fil_space_read_crypt_data(fil_space_t::zip_size(flags),
|
||||||
first_page)
|
first_page)
|
||||||
: NULL;
|
: NULL;
|
||||||
|
|
||||||
|
if (crypt_data && !crypt_data->is_key_found()) {
|
||||||
|
crypt_data->~fil_space_crypt_t();
|
||||||
|
ut_free(crypt_data);
|
||||||
|
return FIL_LOAD_INVALID;
|
||||||
|
}
|
||||||
|
|
||||||
space = fil_space_t::create(
|
space = fil_space_t::create(
|
||||||
space_id, flags, FIL_TYPE_TABLESPACE, crypt_data);
|
space_id, flags, FIL_TYPE_TABLESPACE, crypt_data);
|
||||||
|
|
||||||
|
@@ -779,11 +779,18 @@ processed:
|
|||||||
@param flags FSP_SPACE_FLAGS
|
@param flags FSP_SPACE_FLAGS
|
||||||
@param crypt_data encryption metadata
|
@param crypt_data encryption metadata
|
||||||
@param size tablespace size in pages
|
@param size tablespace size in pages
|
||||||
@return tablespace */
|
@return tablespace
|
||||||
|
@retval nullptr if crypt_data is invalid */
|
||||||
static fil_space_t *create(const recv_spaces_t::const_iterator &it,
|
static fil_space_t *create(const recv_spaces_t::const_iterator &it,
|
||||||
const std::string &name, uint32_t flags,
|
const std::string &name, uint32_t flags,
|
||||||
fil_space_crypt_t *crypt_data, uint32_t size)
|
fil_space_crypt_t *crypt_data, uint32_t size)
|
||||||
{
|
{
|
||||||
|
if (crypt_data && !crypt_data->is_key_found())
|
||||||
|
{
|
||||||
|
crypt_data->~fil_space_crypt_t();
|
||||||
|
ut_free(crypt_data);
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
fil_space_t *space= fil_space_t::create(it->first, flags,
|
fil_space_t *space= fil_space_t::create(it->first, flags,
|
||||||
FIL_TYPE_TABLESPACE, crypt_data);
|
FIL_TYPE_TABLESPACE, crypt_data);
|
||||||
ut_ad(space);
|
ut_ad(space);
|
||||||
@@ -828,6 +835,9 @@ processed:
|
|||||||
fil_space_read_crypt_data(fil_space_t::zip_size(flags), page),
|
fil_space_read_crypt_data(fil_space_t::zip_size(flags), page),
|
||||||
size);
|
size);
|
||||||
|
|
||||||
|
if (!space)
|
||||||
|
goto next_item;
|
||||||
|
|
||||||
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
|
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
|
||||||
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
|
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
|
||||||
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
|
fil_node_t *node= UT_LIST_GET_FIRST(space->chain);
|
||||||
@@ -838,7 +848,8 @@ free_space:
|
|||||||
goto next_item;
|
goto next_item;
|
||||||
}
|
}
|
||||||
if (os_file_write(IORequestWrite, node->name, node->handle,
|
if (os_file_write(IORequestWrite, node->name, node->handle,
|
||||||
page, 0, fil_space_t::physical_size(flags)) != DB_SUCCESS)
|
page, 0, fil_space_t::physical_size(flags)) !=
|
||||||
|
DB_SUCCESS)
|
||||||
{
|
{
|
||||||
space->release();
|
space->release();
|
||||||
goto free_space;
|
goto free_space;
|
||||||
@@ -898,6 +909,11 @@ bool recv_sys_t::recover_deferred(recv_sys_t::map::iterator &p,
|
|||||||
fil_space_read_crypt_data
|
fil_space_read_crypt_data
|
||||||
(fil_space_t::zip_size(flags),
|
(fil_space_t::zip_size(flags),
|
||||||
page), size);
|
page), size);
|
||||||
|
if (!space)
|
||||||
|
{
|
||||||
|
block->page.lock.x_unlock();
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
|
space->free_limit= fsp_header_get_field(page, FSP_FREE_LIMIT);
|
||||||
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
|
space->free_len= flst_get_len(FSP_HEADER_OFFSET + FSP_FREE + page);
|
||||||
block->page.lock.x_unlock();
|
block->page.lock.x_unlock();
|
||||||
@@ -1363,7 +1379,7 @@ inline void recv_sys_t::clear()
|
|||||||
mysql_mutex_assert_owner(&mutex);
|
mysql_mutex_assert_owner(&mutex);
|
||||||
apply_log_recs= false;
|
apply_log_recs= false;
|
||||||
apply_batch_on= false;
|
apply_batch_on= false;
|
||||||
ut_ad(!after_apply || !UT_LIST_GET_LAST(blocks));
|
ut_ad(!after_apply || found_corrupt_fs || !UT_LIST_GET_LAST(blocks));
|
||||||
pages.clear();
|
pages.clear();
|
||||||
|
|
||||||
for (buf_block_t *block= UT_LIST_GET_LAST(blocks); block; )
|
for (buf_block_t *block= UT_LIST_GET_LAST(blocks); block; )
|
||||||
|
@@ -1 +1,2 @@
|
|||||||
wait_timeout : MDEV-26045
|
wait_timeout : MDEV-26045
|
||||||
|
mdev_27239 : failed with ASAN build
|
||||||
|
Reference in New Issue
Block a user