diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-31 09:06:44 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-03-31 09:06:44 +0300 |
commit | 35ee4aa4e3bf391b7de78b3e95f3e484394fd1ac (patch) | |
tree | 584a7ebb9dbef9dd8afd840d9e37b78c11be7864 | |
parent | 99945d77d748470fbb3939be5f7d0e36d24d8097 (diff) | |
download | mariadb-git-35ee4aa4e3bf391b7de78b3e95f3e484394fd1ac.tar.gz |
MDEV-13103 fixup: Actually fix a crash during IMPORT TABLESPACE
-rw-r--r-- | storage/innobase/ibuf/ibuf0ibuf.cc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index ee6fd235d5e..46649187ca0 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020, MariaDB Corporation. +Copyright (c) 2016, 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 @@ -4922,6 +4922,13 @@ ibuf_check_bitmap_on_import( bitmap_page = ibuf_bitmap_get_map_page( page_id_t(space_id, page_no), page_size, &mtr); + if (!bitmap_page) { + mutex_exit(&ibuf_mutex); + ibuf_exit(&mtr); + mtr_commit(&mtr); + return DB_CORRUPTION; + } + if (buf_is_zeroes(span<const byte>(bitmap_page, page_size.physical()))) { /* This means we got all-zero page instead of @@ -4945,11 +4952,6 @@ ibuf_check_bitmap_on_import( continue; } - if (!bitmap_page) { - mutex_exit(&ibuf_mutex); - return DB_CORRUPTION; - } - for (i = FSP_IBUF_BITMAP_OFFSET + 1; i < page_size.physical(); i++) { |