Commit ac8e5d59 authored by marko's avatar marko

branches/zip: Define and use ASSERT_HASH_MUTEX_OWN.

Make it a no-op in UNIV_HOTBACKUP builds.
parent 2febfb27
...@@ -141,7 +141,7 @@ ha_insert_for_fold_func( ...@@ -141,7 +141,7 @@ ha_insert_for_fold_func(
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
ut_a(block->frame == page_align(data)); ut_a(block->frame == page_align(data));
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
hash = hash_calc_hash(fold, table); hash = hash_calc_hash(fold, table);
...@@ -254,7 +254,7 @@ ha_delete( ...@@ -254,7 +254,7 @@ ha_delete(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
node = ha_search_with_data(table, fold, data); node = ha_search_with_data(table, fold, data);
...@@ -280,7 +280,7 @@ ha_search_and_update_if_found_func( ...@@ -280,7 +280,7 @@ ha_search_and_update_if_found_func(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG #if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
ut_a(new_block->frame == page_align(new_data)); ut_a(new_block->frame == page_align(new_data));
#endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */ #endif /* UNIV_AHI_DEBUG || UNIV_DEBUG */
...@@ -316,7 +316,7 @@ ha_remove_all_nodes_to_page( ...@@ -316,7 +316,7 @@ ha_remove_all_nodes_to_page(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
node = ha_chain_get_first(table, fold); node = ha_chain_get_first(table, fold);
......
...@@ -181,6 +181,13 @@ struct ha_node_struct { ...@@ -181,6 +181,13 @@ struct ha_node_struct {
ulint fold; /* fold value for the data */ ulint fold; /* fold value for the data */
}; };
#ifndef UNIV_HOTBACKUP
# define ASSERT_HASH_MUTEX_OWN(table, fold) \
ut_ad(!(table)->mutexes || mutex_own(hash_get_mutex(table, fold)))
#else /* !UNIV_HOTBACKUP */
# define ASSERT_HASH_MUTEX_OWN(table, fold) ((void) 0)
#endif /* !UNIV_HOTBACKUP */
#ifndef UNIV_NONINL #ifndef UNIV_NONINL
#include "ha0ha.ic" #include "ha0ha.ic"
#endif #endif
......
...@@ -110,7 +110,7 @@ ha_search( ...@@ -110,7 +110,7 @@ ha_search(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
node = ha_chain_get_first(table, fold); node = ha_chain_get_first(table, fold);
...@@ -140,7 +140,7 @@ ha_search_and_get_data( ...@@ -140,7 +140,7 @@ ha_search_and_get_data(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
node = ha_chain_get_first(table, fold); node = ha_chain_get_first(table, fold);
...@@ -170,7 +170,7 @@ ha_search_with_data( ...@@ -170,7 +170,7 @@ ha_search_with_data(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
node = ha_chain_get_first(table, fold); node = ha_chain_get_first(table, fold);
...@@ -200,7 +200,7 @@ ha_search_and_delete_if_found( ...@@ -200,7 +200,7 @@ ha_search_and_delete_if_found(
{ {
ha_node_t* node; ha_node_t* node;
ut_ad(!table->mutexes || mutex_own(hash_get_mutex(table, fold))); ASSERT_HASH_MUTEX_OWN(table, fold);
node = ha_search_with_data(table, fold, data); node = ha_search_with_data(table, fold, data);
......
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