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.h | |
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.h')
-rw-r--r-- | sql/ha_partition.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h index d4579d013fd..fc0e98348db 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -933,7 +933,7 @@ private: if(table_share->tmp_table == NO_TMP_TABLE) { auto_increment_lock= TRUE; - pthread_mutex_lock(&table_share->mutex); + pthread_mutex_lock(&table_share->LOCK_ha_data); } } virtual void unlock_auto_increment() @@ -946,7 +946,7 @@ private: */ if(auto_increment_lock && !auto_increment_safe_stmt_log_lock) { - pthread_mutex_unlock(&table_share->mutex); + pthread_mutex_unlock(&table_share->LOCK_ha_data); auto_increment_lock= FALSE; } } |