summaryrefslogtreecommitdiff
path: root/storage/innobase/log
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2021-06-22 09:15:38 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2021-06-22 09:15:38 +0300
commite07f0a2d8028f7f802854223812c0a4f6d3a8749 (patch)
treea7e6ac1b5265dce0659530d8eeb9d450bb2eff0f /storage/innobase/log
parent6e94ef41859cc628f92224e33dd661d9a4be215b (diff)
parent19716ad5a82b979c6817f8e8ee8b623c43d97059 (diff)
downloadmariadb-git-e07f0a2d8028f7f802854223812c0a4f6d3a8749.tar.gz
Merge 10.2 into 10.3
Diffstat (limited to 'storage/innobase/log')
-rw-r--r--storage/innobase/log/log0crypt.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/storage/innobase/log/log0crypt.cc b/storage/innobase/log/log0crypt.cc
index a2e4ac1dd40..6ee31eced1b 100644
--- a/storage/innobase/log/log0crypt.cc
+++ b/storage/innobase/log/log0crypt.cc
@@ -1,7 +1,7 @@
/*****************************************************************************
Copyright (C) 2013, 2015, Google Inc. All Rights Reserved.
-Copyright (C) 2014, 2018, MariaDB Corporation.
+Copyright (C) 2014, 2021, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -164,6 +164,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
<< info->key_version << " failed (" << rc
<< "). Maybe the key or the required encryption "
"key management plugin was not found.";
+ info->key_version = ENCRYPTION_KEY_VERSION_INVALID;
return false;
}
@@ -183,6 +184,7 @@ static bool init_crypt_key(crypt_info_t* info, bool upgrade = false)
if (err != MY_AES_OK || dst_len != MY_AES_BLOCK_SIZE) {
ib::error() << "Getting redo log crypto key failed: err = "
<< err << ", len = " << dst_len;
+ info->key_version = ENCRYPTION_KEY_VERSION_INVALID;
return false;
}
@@ -276,6 +278,7 @@ log_crypt_101_read_block(byte* buf)
for (const crypt_info_t* const end = info + infos_used; info < end;
info++) {
if (info->key_version
+ && info->key_version != ENCRYPTION_KEY_VERSION_INVALID
&& info->checkpoint_no == checkpoint_no) {
goto found;
}
@@ -287,6 +290,9 @@ log_crypt_101_read_block(byte* buf)
/* MariaDB Server 10.1 would use the first key if it fails to
find a key for the current checkpoint. */
info = infos;
+ if (info->key_version == ENCRYPTION_KEY_VERSION_INVALID) {
+ return false;
+ }
found:
byte dst[OS_FILE_LOG_BLOCK_SIZE];
uint dst_len;