summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-11-30 22:38:25 +0300
committerKonstantin Osipov <kostja@sun.com>2009-11-30 22:38:25 +0300
commitcd055f0efe330ace1d4d83536f1cbbeb1c8e0ab9 (patch)
tree2119379f97c4c8fea49681173452f812011da706 /storage
parent40d98edd220d1ec7a317d3c1cbcbf58c5748388b (diff)
downloadmariadb-git-cd055f0efe330ace1d4d83536f1cbbeb1c8e0ab9.tar.gz
Backport of:
------------------------------------------------------------------- revno: 2630.6.6 committer: Konstantin Osipov <konstantin@mysql.com> branch nick: mysql-6.0-3726 timestamp: Tue 2008-05-27 16:15:44 +0400 message: Implement code review fixes for WL#3726 "DDL locking for all metadata objects": cleanup the code from share->mutex acquisitions, which are now obsolete. sql/ha_partition.cc: Rename share->mutex to share->LOCK_ha_data. The mutex never protected the entire share. The right way to protect a share is to acquire an MDL lock. sql/ha_partition.h: Rename share->mutex to share->LOCK_ha_data. sql/sql_base.cc: Remove LOCK_table_share. Do not acquire share->mutex when deleting a table share or incrementing its ref_count. All these operations are and must continue to be protected by LOCK_open and respective MDL locks. sql/sql_view.cc: Remove acquisition of share->mutex when incrementing share->ref_count. sql/table.cc: Simplify release_table_shar() by removing dead code related to share->mutex from it. sql/table.h: Rename TABLE_SHARE::mutex to TABLE_SHARE::LOCK_ha_data to better reflect its purpose. storage/myisam/ha_myisam.cc: Rename share->mutex to share->LOCK_ha_data.
Diffstat (limited to 'storage')
-rw-r--r--storage/myisam/ha_myisam.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc
index cb8333767f8..9269b331754 100644
--- a/storage/myisam/ha_myisam.cc
+++ b/storage/myisam/ha_myisam.cc
@@ -1812,7 +1812,7 @@ int ha_myisam::info(uint flag)
/* Update share */
if (share->tmp_table == NO_TMP_TABLE)
- pthread_mutex_lock(&share->mutex);
+ pthread_mutex_lock(&share->LOCK_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);
@@ -1822,7 +1822,7 @@ int ha_myisam::info(uint flag)
(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)
- pthread_mutex_unlock(&share->mutex);
+ pthread_mutex_unlock(&share->LOCK_ha_data);
/*
Set data_file_name and index_file_name to point at the symlink value