Commit ba5ef63a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27476 heap-use-after-free in buf_pool_t::is_block_field()

This follows up commit 017d1b86.
In commit aaef2e1d (MDEV-27058)
some more problematic debug assertions were added.

btr_search_update_block_hash_info(), trx_purge_truncate_history():
Use simpler assertions to check that an uncompressed page is present.
parent 0261eac5
......@@ -2,7 +2,7 @@
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2008, Google Inc.
Copyright (c) 2017, 2021, MariaDB Corporation.
Copyright (c) 2017, 2022, MariaDB Corporation.
Portions of this file contain modifications contributed and copyrighted by
Google, Inc. Those modifications are gratefully acknowledged and are described
......@@ -412,7 +412,7 @@ btr_search_update_block_hash_info(btr_search_t* info, buf_block_t* block)
ut_ad(block->page.lock.have_x() || block->page.lock.have_s());
info->last_hash_succ = FALSE;
ut_ad(buf_pool.is_uncompressed(block));
ut_ad(block->page.frame);
ut_ad(info->magic_n == BTR_SEARCH_MAGIC_N);
if ((block->n_hash_helps > 0)
......
......@@ -703,8 +703,8 @@ TRANSACTIONAL_TARGET static void trx_purge_truncate_history()
if (bpage->id().space() == space.id &&
bpage->oldest_modification() != 1)
{
ut_ad(bpage->frame);
auto block= reinterpret_cast<buf_block_t*>(bpage);
ut_ad(buf_pool.is_uncompressed(block));
if (!bpage->lock.x_lock_try())
{
/* Let buf_pool_t::release_freed_page() proceed. */
......
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