Commit ec6ba66a authored by Inaam Rana's avatar Inaam Rana

Currently we do a full validation of AHI whenever check tables is

called on any table. This patch fixes this by only doing this full
check in debug versions.

bug#55716
rb://423
approved by: Marko
parent 61257997
...@@ -1746,6 +1746,7 @@ btr_search_update_hash_on_insert( ...@@ -1746,6 +1746,7 @@ btr_search_update_hash_on_insert(
} }
} }
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/********************************************************************//** /********************************************************************//**
Validates the search system. Validates the search system.
@return TRUE if ok */ @return TRUE if ok */
...@@ -1913,3 +1914,4 @@ btr_search_validate(void) ...@@ -1913,3 +1914,4 @@ btr_search_validate(void)
return(ok); return(ok);
} }
#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
...@@ -354,6 +354,7 @@ ha_remove_all_nodes_to_page( ...@@ -354,6 +354,7 @@ ha_remove_all_nodes_to_page(
#endif #endif
} }
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/*************************************************************//** /*************************************************************//**
Validates a given range of the cells in hash table. Validates a given range of the cells in hash table.
@return TRUE if ok */ @return TRUE if ok */
...@@ -400,6 +401,7 @@ ha_validate( ...@@ -400,6 +401,7 @@ ha_validate(
return(ok); return(ok);
} }
#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
/*************************************************************//** /*************************************************************//**
Prints info of a hash table. */ Prints info of a hash table. */
......
...@@ -180,6 +180,7 @@ btr_search_update_hash_on_delete( ...@@ -180,6 +180,7 @@ btr_search_update_hash_on_delete(
btr_cur_t* cursor);/*!< in: cursor which was positioned on the btr_cur_t* cursor);/*!< in: cursor which was positioned on the
record to delete using btr_cur_search_..., record to delete using btr_cur_search_...,
the record is not yet deleted */ the record is not yet deleted */
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/********************************************************************//** /********************************************************************//**
Validates the search system. Validates the search system.
@return TRUE if ok */ @return TRUE if ok */
...@@ -187,6 +188,9 @@ UNIV_INTERN ...@@ -187,6 +188,9 @@ UNIV_INTERN
ibool ibool
btr_search_validate(void); btr_search_validate(void);
/*======================*/ /*======================*/
#else
# define btr_search_validate() TRUE
#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
/** Flag: has the search system been enabled? /** Flag: has the search system been enabled?
Protected by btr_search_latch and btr_search_enabled_mutex. */ Protected by btr_search_latch and btr_search_enabled_mutex. */
......
...@@ -186,6 +186,7 @@ ha_remove_all_nodes_to_page( ...@@ -186,6 +186,7 @@ ha_remove_all_nodes_to_page(
hash_table_t* table, /*!< in: hash table */ hash_table_t* table, /*!< in: hash table */
ulint fold, /*!< in: fold value */ ulint fold, /*!< in: fold value */
const page_t* page); /*!< in: buffer page */ const page_t* page); /*!< in: buffer page */
#if defined UNIV_AHI_DEBUG || defined UNIV_DEBUG
/*************************************************************//** /*************************************************************//**
Validates a given range of the cells in hash table. Validates a given range of the cells in hash table.
@return TRUE if ok */ @return TRUE if ok */
...@@ -196,6 +197,7 @@ ha_validate( ...@@ -196,6 +197,7 @@ ha_validate(
hash_table_t* table, /*!< in: hash table */ hash_table_t* table, /*!< in: hash table */
ulint start_index, /*!< in: start index */ ulint start_index, /*!< in: start index */
ulint end_index); /*!< in: end index */ ulint end_index); /*!< in: end index */
#endif /* defined UNIV_AHI_DEBUG || defined UNIV_DEBUG */
/*************************************************************//** /*************************************************************//**
Prints info of a hash table. */ Prints info of a hash table. */
UNIV_INTERN UNIV_INTERN
......
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