summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2009-11-03 14:23:46 +0400
committerSergey Vojtovich <svoj@sun.com>2009-11-03 14:23:46 +0400
commitd927bc67dce4d944dbe781ba675567e3d34dfee8 (patch)
tree888b54deccf8fdc0fb2233b65aa0dc30e6fe8d24 /storage
parent74d505db0beb86ae8e32cfa724ce1908a35a58a5 (diff)
downloadmariadb-git-d927bc67dce4d944dbe781ba675567e3d34dfee8.tar.gz
Applying InnoDB plugin snashot
Detailed revision comments: r6107 | marko | 2009-10-28 16:10:34 +0200 (Wed, 28 Oct 2009) | 5 lines branches/zip: buf_page_set_old(): Improve UNIV_LRU_DEBUG diagnostics in order to catch the buf_pool->LRU_old corruption reported in Issue #381. buf_LRU_old_init(): Set the property from the tail towards the front of the buf_pool->LRU list, in order not to trip the debug check.
Diffstat (limited to 'storage')
-rw-r--r--storage/innodb_plugin/buf/buf0lru.c6
-rw-r--r--storage/innodb_plugin/include/buf0buf.ic12
2 files changed, 10 insertions, 8 deletions
diff --git a/storage/innodb_plugin/buf/buf0lru.c b/storage/innodb_plugin/buf/buf0lru.c
index d3a79d62d3f..329448a6206 100644
--- a/storage/innodb_plugin/buf/buf0lru.c
+++ b/storage/innodb_plugin/buf/buf0lru.c
@@ -1009,13 +1009,11 @@ buf_LRU_old_init(void)
the adjust function to move the LRU_old pointer to the right
position */
- bpage = UT_LIST_GET_FIRST(buf_pool->LRU);
-
- while (bpage != NULL) {
+ for (bpage = UT_LIST_GET_LAST(buf_pool->LRU); bpage != NULL;
+ bpage = UT_LIST_GET_PREV(LRU, bpage)) {
ut_ad(bpage->in_LRU_list);
ut_ad(buf_page_in_file(bpage));
buf_page_set_old(bpage, TRUE);
- bpage = UT_LIST_GET_NEXT(LRU, bpage);
}
buf_pool->LRU_old = UT_LIST_GET_FIRST(buf_pool->LRU);
diff --git a/storage/innodb_plugin/include/buf0buf.ic b/storage/innodb_plugin/include/buf0buf.ic
index 8b1f904a090..465fcadc0bb 100644
--- a/storage/innodb_plugin/include/buf0buf.ic
+++ b/storage/innodb_plugin/include/buf0buf.ic
@@ -466,10 +466,14 @@ buf_page_set_old(
ut_ad(bpage->in_LRU_list);
#ifdef UNIV_LRU_DEBUG
- if (UT_LIST_GET_PREV(LRU, bpage) && UT_LIST_GET_NEXT(LRU, bpage)
- && UT_LIST_GET_PREV(LRU, bpage)->old
- == UT_LIST_GET_NEXT(LRU, bpage)->old) {
- ut_a(UT_LIST_GET_PREV(LRU, bpage)->old == 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);
+ if (prev->old == next->old) {
+ ut_a(prev->old == old);
+ } else {
+ ut_a(!prev->old);
+ }
}
#endif /* UNIV_LRU_DEBUG */