Commit d71b75c9 authored by Sergei Golubchik's avatar Sergei Golubchik

moving LOCK_open into get_table_share()

parent 16388266
......@@ -128,10 +128,8 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
has_mdl_lock= TRUE;
hash_value= my_calc_hash(&table_def_cache, (uchar*) key, key_length);
mysql_mutex_lock(&LOCK_open);
share= get_table_share(thd, table_list, key, key_length,
FRM_READ_TABLE_ONLY, &not_used, hash_value);
mysql_mutex_unlock(&LOCK_open);
if (share == NULL)
DBUG_RETURN(0); // Can't open frm file
......
This diff is collapsed.
......@@ -4382,13 +4382,12 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
key_length= create_table_def_key(thd, key, &table_list, 0);
hash_value= my_calc_hash(&table_def_cache, (uchar*) key, key_length);
mysql_mutex_lock(&LOCK_open);
share= get_table_share(thd, &table_list, key, key_length,
FRM_READ_NO_ERROR_FOR_VIEW, &not_used, hash_value);
if (!share)
{
res= 0;
goto end_unlock;
goto end;
}
if (share->is_view)
......@@ -4437,10 +4436,10 @@ static int fill_schema_table_from_frm(THD *thd, TABLE_LIST *tables,
free_root(&tbl.mem_root, MYF(0));
}
end_share:
mysql_mutex_lock(&LOCK_open);
release_table_share(share);
end_unlock:
mysql_mutex_unlock(&LOCK_open);
end:
......
......@@ -1707,9 +1707,8 @@ bool mysql_drop_view(THD *thd, TABLE_LIST *views, enum_drop_mode drop_mode)
some_views_deleted= TRUE;
/*
For a view, there is a TABLE_SHARE object, but its
ref_count never goes above 1. Remove it from the table
definition cache, in case the view was cached.
For a view, there is a TABLE_SHARE object.
Remove it from the table definition cache, in case the view was cached.
*/
tdc_remove_table(thd, TDC_RT_REMOVE_ALL, view->db, view->table_name,
FALSE);
......
......@@ -2188,9 +2188,9 @@ private:
#else
inline void set_check_merged() {}
#endif
/** See comments for set_metadata_id() */
/** See comments for set_table_ref_id() */
enum enum_table_ref_type m_table_ref_type;
/** See comments for set_metadata_id() */
/** See comments for set_table_ref_id() */
ulong m_table_ref_version;
};
......
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