diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-06-09 10:57:28 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-06-09 10:57:28 +0300 |
commit | 98293130c34cfd39bf2e8c904923abe3942d23be (patch) | |
tree | 51951e48ff66afb9e991d62a7cde439e6d0dde69 /storage | |
parent | 2cd1edfc2176649cda412b2ff4f1075ad23448ba (diff) | |
download | mariadb-git-98293130c34cfd39bf2e8c904923abe3942d23be.tar.gz |
MDEV-28779: ALTER TABLE IMPORT TABLESPACE corrupts an encrypted table
PageConverter::update_header(): Remove an unnecessary write.
The field that was originally called FIL_PAGE_FILE_FLUSH_LSN only
made sense for the first page of the system tablespace
(initially, for the first page of each file of the system tablespace).
It never had any meaning for .ibd files, and it lost its original
meaning in MariaDB Server 10.8.1 when
commit b07920b634f455c39e3650c6163bec2a8ce0ffe0 (MDEV-27199)
removed the ability to start without ib_logfile0.
If the most significant 32 bits of the LSN are nonzero, this
unnecessary write would write the wrong encryption key identifier
to the page. The first page of any file is never encrypted,
so normally those bytes should be 0 for any .ibd file.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/row/row0import.cc | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/storage/innobase/row/row0import.cc b/storage/innobase/row/row0import.cc index 885a43bb2f8..db4c22b4969 100644 --- a/storage/innobase/row/row0import.cc +++ b/storage/innobase/row/row0import.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2012, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2015, 2021, MariaDB Corporation. +Copyright (c) 2015, 2022, 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 @@ -1996,10 +1996,6 @@ PageConverter::update_header( ib::warn() << "Space id check in the header failed: ignored"; } - mach_write_to_8( - get_frame(block) + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION, - m_current_lsn); - /* Write back the adjusted flags. */ mach_write_to_4(FSP_HEADER_OFFSET + FSP_SPACE_FLAGS + get_frame(block), m_space_flags); |