diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-11-30 22:38:25 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-11-30 22:38:25 +0300 |
commit | cd055f0efe330ace1d4d83536f1cbbeb1c8e0ab9 (patch) | |
tree | 2119379f97c4c8fea49681173452f812011da706 /sql/ha_partition.cc | |
parent | 40d98edd220d1ec7a317d3c1cbcbf58c5748388b (diff) | |
download | mariadb-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 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 2ec92173d14..1514651c1c5 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -2606,7 +2606,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) for the same table. */ if (is_not_tmp_table) - pthread_mutex_lock(&table_share->mutex); + pthread_mutex_lock(&table_share->LOCK_ha_data); if (!table_share->ha_data) { HA_DATA_PARTITION *ha_data; @@ -2617,7 +2617,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) if (!ha_data) { if (is_not_tmp_table) - pthread_mutex_unlock(&table_share->mutex); + pthread_mutex_unlock(&table_share->LOCK_ha_data); goto err_handler; } DBUG_PRINT("info", ("table_share->ha_data 0x%p", ha_data)); @@ -2626,7 +2626,7 @@ int ha_partition::open(const char *name, int mode, uint test_if_locked) pthread_mutex_init(&ha_data->mutex, MY_MUTEX_INIT_FAST); } if (is_not_tmp_table) - pthread_mutex_unlock(&table_share->mutex); + pthread_mutex_unlock(&table_share->LOCK_ha_data); /* Some handlers update statistics as part of the open call. This will in some cases corrupt the statistics of the partition handler and thus |