Skip to content

Commit b4777bf

Browse files
committed
cleanup, use encryption_key_id_exists() where appropriate
1 parent 6638091 commit b4777bf

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,9 +1994,8 @@ fil_read_first_page(
19941994
if ((cdata && cdata->encryption == FIL_SPACE_ENCRYPTION_ON) ||
19951995
(srv_encrypt_tables &&
19961996
cdata && cdata->encryption == FIL_SPACE_ENCRYPTION_DEFAULT)) {
1997-
uint rc = encryption_key_get_latest_version(cdata->key_id);
19981997

1999-
if (rc == ENCRYPTION_KEY_VERSION_INVALID) {
1998+
if (!encryption_key_id_exists(cdata->key_id)) {
20001999
ib_logf(IB_LOG_LEVEL_FATAL,
20012000
"Tablespace id %ld encrypted but encryption service"
20022001
" not available. Can't continue opening tablespace.\n",

storage/maria/ma_crypt.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@ void ma_crypt_set_data_pagecache_callbacks(PAGECACHE_FILE *file,
315315
__attribute__((unused)))
316316
{
317317
/* Only use encryption if we have defined it */
318-
if (encryption_key_get_latest_version(HARD_CODED_ENCRYPTION_KEY_ID) !=
319-
ENCRYPTION_KEY_VERSION_INVALID)
318+
if (encryption_key_id_exists(HARD_CODED_ENCRYPTION_KEY_ID))
320319
{
321320
file->pre_read_hook= ma_crypt_pre_read_hook;
322321
file->post_read_hook= ma_crypt_data_post_read_hook;

storage/xtradb/fil/fil0fil.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,9 +2032,8 @@ fil_read_first_page(
20322032
if ((cdata && cdata->encryption == FIL_SPACE_ENCRYPTION_ON) ||
20332033
(srv_encrypt_tables &&
20342034
cdata && cdata->encryption == FIL_SPACE_ENCRYPTION_DEFAULT)) {
2035-
uint rc = encryption_key_get_latest_version(cdata->key_id);
20362035

2037-
if (rc == ENCRYPTION_KEY_VERSION_INVALID) {
2036+
if (!encryption_key_id_exists(cdata->key_id)) {
20382037
ib_logf(IB_LOG_LEVEL_FATAL,
20392038
"Tablespace id %ld encrypted but encryption service"
20402039
" not available. Can't continue opening tablespace.\n",

0 commit comments

Comments
 (0)