summaryrefslogtreecommitdiff
path: root/storage/innobase/ha
diff options
context:
space:
mode:
authorJimmy Yang <jimmy.yang@oracle.com>2010-06-30 21:52:47 -0700
committerJimmy Yang <jimmy.yang@oracle.com>2010-06-30 21:52:47 -0700
commit6180fa31d32a0b5a6d9f07947d2a735b19cbde69 (patch)
treeb4556824000cd32337441ef0c1a82a5b0e3a5485 /storage/innobase/ha
parent75a5aaf2ada1ae4b7a06e3742f5762aa0f330420 (diff)
downloadmariadb-git-6180fa31d32a0b5a6d9f07947d2a735b19cbde69.tar.gz
Fix bug #54311 Crash on CHECK PARTITION after concurrent LOAD DATA
and adaptive_hash_index=OFF rb://389 approved by Marko
Diffstat (limited to 'storage/innobase/ha')
-rw-r--r--storage/innobase/ha/ha0ha.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/storage/innobase/ha/ha0ha.c b/storage/innobase/ha/ha0ha.c
index 9d9d341ad39..f9e798012f8 100644
--- a/storage/innobase/ha/ha0ha.c
+++ b/storage/innobase/ha/ha0ha.c
@@ -31,9 +31,7 @@ Created 8/22/1994 Heikki Tuuri
#ifdef UNIV_DEBUG
# include "buf0buf.h"
#endif /* UNIV_DEBUG */
-#ifdef UNIV_SYNC_DEBUG
-# include "btr0sea.h"
-#endif /* UNIV_SYNC_DEBUG */
+#include "btr0sea.h"
#include "page0page.h"
/*************************************************************//**
@@ -127,7 +125,8 @@ ha_clear(
/*************************************************************//**
Inserts an entry into a hash table. If an entry with the same fold number
is found, its node is updated to point to the new data, and no new node
-is inserted.
+is inserted. If btr_search_enabled is set to FALSE, we will only allow
+updating existing nodes, but no new node is allowed to be added.
@return TRUE if succeed, FALSE if no more memory could be allocated */
UNIV_INTERN
ibool
@@ -174,6 +173,7 @@ ha_insert_for_fold_func(
prev_block->n_pointers--;
block->n_pointers++;
}
+ ut_ad(!btr_search_fully_disabled);
# endif /* !UNIV_HOTBACKUP */
prev_node->block = block;
@@ -186,6 +186,13 @@ ha_insert_for_fold_func(
prev_node = prev_node->next;
}
+ /* We are in the process of disabling hash index, do not add
+ new chain node */
+ if (!btr_search_enabled) {
+ ut_ad(!btr_search_fully_disabled);
+ return(TRUE);
+ }
+
/* We have to allocate a new chain node */
node = mem_heap_alloc(hash_get_heap(table, fold), sizeof(ha_node_t));