Commit 35ee4aa4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-13103 fixup: Actually fix a crash during IMPORT TABLESPACE

parent 99945d77
/*****************************************************************************
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++) {
......
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