mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 01:04:19 +01:00
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().
This commit is contained in:
parent
13548ed68f
commit
6c6bc1f53e
2 changed files with 4 additions and 22 deletions
|
@ -3547,6 +3547,7 @@ syntax_error:
|
|||
|
||||
/*==================== END OF FOREIGN KEY PROCESSING ====================*/
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/**************************************************************************
|
||||
Returns an index object if it is found in the dictionary cache. */
|
||||
|
||||
|
@ -3556,7 +3557,6 @@ dict_index_get_if_in_cache(
|
|||
/* out: index, NULL if not found */
|
||||
dulint index_id) /* in: index id */
|
||||
{
|
||||
dict_table_t* table;
|
||||
dict_index_t* index;
|
||||
|
||||
if (dict_sys == NULL) {
|
||||
|
@ -3565,29 +3565,13 @@ dict_index_get_if_in_cache(
|
|||
|
||||
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));
|
||||
|
||||
return(index);
|
||||
}
|
||||
#endif /* UNIV_DEBUG */
|
||||
|
||||
#ifdef UNIV_DEBUG
|
||||
/**************************************************************************
|
||||
|
|
|
@ -778,9 +778,8 @@ const dict_col_t*
|
|||
dict_field_get_col(
|
||||
/*===============*/
|
||||
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. */
|
||||
|
||||
|
@ -789,7 +788,6 @@ dict_index_get_if_in_cache(
|
|||
/*=======================*/
|
||||
/* out: index, NULL if not found */
|
||||
dulint index_id); /* in: index id */
|
||||
#ifdef UNIV_DEBUG
|
||||
/**************************************************************************
|
||||
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. */
|
||||
|
|
Loading…
Add table
Reference in a new issue