Commit 11961fe8 authored by marko's avatar marko

dict_index_get_if_in_cache(): Enclose in #ifdef UNIV_DEBUG.

Replace the search loop with a call to dict_index_find_on_id_low().
parent 80c208a1
...@@ -3547,6 +3547,7 @@ syntax_error: ...@@ -3547,6 +3547,7 @@ syntax_error:
/*==================== END OF FOREIGN KEY PROCESSING ====================*/ /*==================== END OF FOREIGN KEY PROCESSING ====================*/
#ifdef UNIV_DEBUG
/************************************************************************** /**************************************************************************
Returns an index object if it is found in the dictionary cache. */ Returns an index object if it is found in the dictionary cache. */
...@@ -3556,7 +3557,6 @@ dict_index_get_if_in_cache( ...@@ -3556,7 +3557,6 @@ dict_index_get_if_in_cache(
/* out: index, NULL if not found */ /* out: index, NULL if not found */
dulint index_id) /* in: index id */ dulint index_id) /* in: index id */
{ {
dict_table_t* table;
dict_index_t* index; dict_index_t* index;
if (dict_sys == NULL) { if (dict_sys == NULL) {
...@@ -3565,29 +3565,13 @@ dict_index_get_if_in_cache( ...@@ -3565,29 +3565,13 @@ dict_index_get_if_in_cache(
mutex_enter(&(dict_sys->mutex)); mutex_enter(&(dict_sys->mutex));
table = UT_LIST_GET_FIRST(dict_sys->table_LRU); index = dict_index_find_on_id_low(index_id);
while (table) {
index = UT_LIST_GET_FIRST(table->indexes);
while (index) {
if (0 == ut_dulint_cmp(index->id, index_id)) {
goto found;
}
index = UT_LIST_GET_NEXT(indexes, index);
}
table = UT_LIST_GET_NEXT(table_LRU, table);
}
index = NULL;
found:
mutex_exit(&(dict_sys->mutex)); mutex_exit(&(dict_sys->mutex));
return(index); return(index);
} }
#endif /* UNIV_DEBUG */
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
/************************************************************************** /**************************************************************************
......
...@@ -778,9 +778,8 @@ const dict_col_t* ...@@ -778,9 +778,8 @@ const dict_col_t*
dict_field_get_col( dict_field_get_col(
/*===============*/ /*===============*/
const dict_field_t* field); const dict_field_t* field);
/**************************************************************************
In an index tree, finds the index corresponding to a record in the tree. */
#ifdef UNIV_DEBUG
/************************************************************************** /**************************************************************************
Returns an index object if it is found in the dictionary cache. */ Returns an index object if it is found in the dictionary cache. */
...@@ -789,7 +788,6 @@ dict_index_get_if_in_cache( ...@@ -789,7 +788,6 @@ dict_index_get_if_in_cache(
/*=======================*/ /*=======================*/
/* out: index, NULL if not found */ /* out: index, NULL if not found */
dulint index_id); /* in: index id */ dulint index_id); /* in: index id */
#ifdef UNIV_DEBUG
/************************************************************************** /**************************************************************************
Checks that a tuple has n_fields_cmp value in a sensible range, so that Checks that a tuple has n_fields_cmp value in a sensible range, so that
no comparison can occur with the page number field in a node pointer. */ no comparison can occur with the page number field in a node pointer. */
......
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