Commit a94cabd5 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-8159 InnoDB: Failing assertion: key_state->key_id

to simplify various checks, set crypt_data->key_id even
for not encrypted tablespaces
parent 2300fe2e
create table t1 (i int) engine=innodb;
set global innodb_encryption_threads = 1;
set global innodb_encryption_rotate_key_age = 2;
insert t1 values (1);
set global innodb_encryption_threads = 0;
set global innodb_encryption_rotate_key_age = 1;
drop table t1;
--source include/have_innodb.inc
--source include/have_file_key_management_plugin.inc
#
# MDEV-8159 InnoDB: Failing assertion: key_state->key_id
#
create table t1 (i int) engine=innodb;
set global innodb_encryption_threads = 1;
set global innodb_encryption_rotate_key_age = 2;
insert t1 values (1);
set global innodb_encryption_threads = 0;
set global innodb_encryption_rotate_key_age = 1;
drop table t1;
......@@ -203,7 +203,6 @@ fil_space_create_crypt_data(
crypt_data->min_key_version = 0;
} else {
crypt_data->type = CRYPT_SCHEME_1;
crypt_data->key_id = key_id;
crypt_data->min_key_version = encryption_key_get_latest_version(key_id);
}
......@@ -212,6 +211,7 @@ fil_space_create_crypt_data(
crypt_data->locker = crypt_data_scheme_locker;
my_random_bytes(crypt_data->iv, sizeof(crypt_data->iv));
crypt_data->encryption = FIL_SPACE_ENCRYPTION_DEFAULT;
crypt_data->key_id = key_id;
return crypt_data;
}
......
......@@ -203,7 +203,6 @@ fil_space_create_crypt_data(
crypt_data->min_key_version = 0;
} else {
crypt_data->type = CRYPT_SCHEME_1;
crypt_data->key_id = key_id;
crypt_data->min_key_version = encryption_key_get_latest_version(key_id);
}
......@@ -212,6 +211,7 @@ fil_space_create_crypt_data(
crypt_data->locker = crypt_data_scheme_locker;
my_random_bytes(crypt_data->iv, sizeof(crypt_data->iv));
crypt_data->encryption = FIL_SPACE_ENCRYPTION_DEFAULT;
crypt_data->key_id = key_id;
return crypt_data;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment