diff options
Diffstat (limited to 'storage/myisam/ha_myisam.cc')
-rw-r--r-- | storage/myisam/ha_myisam.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 3e73bb7c801..9d53372d467 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -1849,9 +1849,12 @@ int ha_myisam::info(uint flag) share->db_options_in_use= misam_info.options; stats.block_size= myisam_block_size; /* record block size */ - /* Update share */ - if (share->tmp_table == NO_TMP_TABLE) - mysql_mutex_lock(&share->LOCK_ha_data); + /* + Update share. + lock_shared_ha_data is slighly abused here, since there is no other + way of locking the TABLE_SHARE. + */ + lock_shared_ha_data(); share->keys_in_use.set_prefix(share->keys); share->keys_in_use.intersect_extended(misam_info.key_map); share->keys_for_keyread.intersect(share->keys_in_use); @@ -1860,8 +1863,7 @@ int ha_myisam::info(uint flag) memcpy((char*) table->key_info[0].rec_per_key, (char*) misam_info.rec_per_key, sizeof(table->key_info[0].rec_per_key[0])*share->key_parts); - if (share->tmp_table == NO_TMP_TABLE) - mysql_mutex_unlock(&share->LOCK_ha_data); + unlock_shared_ha_data(); /* Set data_file_name and index_file_name to point at the symlink value |