From 0ed513456f592342f3a51d17c3d1e50fa37aab52 Mon Sep 17 00:00:00 2001
From: Sergey Vojtovich <svoj@sun.com>
Date: Thu, 1 Apr 2010 15:20:54 +0400
Subject: [PATCH] Applying InnoDB snapshot

Detailed revision comments:

r6445 | marko | 2010-01-13 17:15:29 +0200 (Wed, 13 Jan 2010) | 3 lines
branches/zip: buf_pool_drop_hash_index(): Check block->page.state
before checking block->is_hashed, because the latter may be uninitialized
right after server startup.
---
 storage/innodb_plugin/ChangeLog     | 7 +++++++
 storage/innodb_plugin/buf/buf0buf.c | 4 +++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog
index 334c8b5a8c..d5748c825b 100644
--- a/storage/innodb_plugin/ChangeLog
+++ b/storage/innodb_plugin/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-13	The InnoDB Team
+
+	* buf/buf0buf.c:
+	When disabling the adaptive hash index, check the block state
+	before checking block->is_hashed, because the latter may be
+	uninitialized right after server startup.
+
 2010-01-12	The InnoDB Team
 
 	* handler/ha_innodb.cc, handler/ha_innodb.h:
diff --git a/storage/innodb_plugin/buf/buf0buf.c b/storage/innodb_plugin/buf/buf0buf.c
index 111d396fbc..549d1a3194 100644
--- a/storage/innodb_plugin/buf/buf0buf.c
+++ b/storage/innodb_plugin/buf/buf0buf.c
@@ -1058,7 +1058,9 @@ buf_pool_drop_hash_index(void)
 				when we have an x-latch on btr_search_latch;
 				see the comment in buf0buf.h */
 
-				if (!block->is_hashed) {
+				if (buf_block_get_state(block)
+				    != BUF_BLOCK_FILE_PAGE
+				    || !block->is_hashed) {
 					continue;
 				}
 
-- 
2.30.9