mirror of
https://github.com/MariaDB/server.git
synced 2025-08-31 22:22:30 +03:00
Applying InnoDB plugin snashot
Detailed revision comments: r6110 | marko | 2009-10-29 12:44:57 +0200 (Thu, 29 Oct 2009) | 2 lines branches/zip: Makefile.am (INCLUDES): Merge a change from MySQL: Use $(srcdir)/include instead of $(top_srcdir)/storage/innobase/include. r6111 | marko | 2009-10-29 13:04:11 +0200 (Thu, 29 Oct 2009) | 33 lines branches/zip: Fix corruption of buf_pool->LRU_old and improve debug assertions. This was reported as Issue #381. buf_page_set_old(): Assert that blocks may only be set old if buf_pool->LRU_old is initialized and buf_pool->LRU_old_len is nonzero. Assert that buf_pool->LRU_old points to the block at the old/new boundary. buf_LRU_old_adjust_len(): Invoke buf_page_set_old() after adjusting buf_pool->LRU_old and buf_pool->LRU_old_len, in order not to violate the added assertions. buf_LRU_old_init(): Replace buf_page_set_old() with a direct assignment to bpage->old, because these loops that initialize all the blocks would temporarily violate the assertions about buf_pool->LRU_old. buf_LRU_remove_block(): When setting buf_pool->LRU_old = NULL, also clear all bpage->old flags and set buf_pool->LRU_old_len = 0. buf_LRU_add_block_to_end_low(), buf_LRU_add_block_low(): Move the buf_page_set_old() call later in order not to violate the debug assertions. If buf_pool->LRU_old is NULL, set old=FALSE. buf_LRU_free_block(): Replace the UNIV_LRU_DEBUG assertion with a dummy buf_page_set_old() call that performs more thorough checks. buf_LRU_validate(): Do not tolerate garbage in buf_pool->LRU_old_len even if buf_pool->LRU_old is NULL. Check that bpage->old is monotonic. buf_relocate(): Make the UNIV_LRU_DEBUG checks stricter. buf0buf.h: Revise the documentation of buf_page_t::old and buf_pool_t::LRU_old_len.
This commit is contained in:
@@ -466,6 +466,10 @@ buf_page_set_old(
|
||||
ut_ad(bpage->in_LRU_list);
|
||||
|
||||
#ifdef UNIV_LRU_DEBUG
|
||||
ut_a((buf_pool->LRU_old_len == 0) == (buf_pool->LRU_old == NULL));
|
||||
/* If a block is flagged "old", the LRU_old list must exist. */
|
||||
ut_a(!old || buf_pool->LRU_old);
|
||||
|
||||
if (UT_LIST_GET_PREV(LRU, bpage) && UT_LIST_GET_NEXT(LRU, bpage)) {
|
||||
const buf_page_t* prev = UT_LIST_GET_PREV(LRU, bpage);
|
||||
const buf_page_t* next = UT_LIST_GET_NEXT(LRU, bpage);
|
||||
@@ -473,6 +477,7 @@ buf_page_set_old(
|
||||
ut_a(prev->old == old);
|
||||
} else {
|
||||
ut_a(!prev->old);
|
||||
ut_a(buf_pool->LRU_old == (old ? bpage : next));
|
||||
}
|
||||
}
|
||||
#endif /* UNIV_LRU_DEBUG */
|
||||
|
Reference in New Issue
Block a user