diff options
author | Konstantin Osipov <kostja@sun.com> | 2009-12-01 01:33:22 +0300 |
---|---|---|
committer | Konstantin Osipov <kostja@sun.com> | 2009-12-01 01:33:22 +0300 |
commit | e23046d1bcaf54838167dd6bd3d8c6900e24b2ef (patch) | |
tree | ba3438eef550d9cf10d121bad3981f18566659d4 /sql/lock.cc | |
parent | cf45b61a6a611415161e6176b8c8ae85a51e9349 (diff) | |
download | mariadb-git-e23046d1bcaf54838167dd6bd3d8c6900e24b2ef.tar.gz |
Backport of:
------------------------------------------------------------
revno: 2630.4.17
committer: Dmitry Lenev <dlenev@mysql.com>
branch nick: mysql-6.0-3726-w2
timestamp: Thu 2008-05-29 16:52:56 +0400
message:
WL#3726 "DDL locking for all metadata objects".
After review fixes in progress.
"The great correction of names".
Renamed MDL_LOCK and MDL_LOCK_DATA classes to make usage of
these names in metadata locking subsystem consistent with
other parts of server (i.e. thr_lock.cc). Now we MDL_LOCK_DATA
corresponds to request for a lock and MDL_LOCK to the lock
itself. Adjusted code in MDL subsystem and other places
using these classes accordingly.
Did similar thing for GLOBAL_MDL_LOCK_DATA class and also
changed name of its members to correspond to names of
MDL_LOCK_DATA members.
Finally got rid of usage of one letter variables in MDL
code since it makes code harder to search in (according
to reviewer).
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 38b2d22f91f..b5eaaa05fff 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -966,15 +966,16 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, bool lock_table_names(THD *thd, TABLE_LIST *table_list) { TABLE_LIST *lock_table; - MDL_LOCK *mdl_lock; + MDL_LOCK_DATA *mdl_lock_data; for (lock_table= table_list; lock_table; lock_table= lock_table->next_local) { - if (!(mdl_lock= mdl_alloc_lock(0, lock_table->db, lock_table->table_name, - thd->mem_root))) + if (!(mdl_lock_data= mdl_alloc_lock(0, lock_table->db, + lock_table->table_name, + thd->mem_root))) goto end; - mdl_set_lock_type(mdl_lock, MDL_EXCLUSIVE); - mdl_add_lock(&thd->mdl_context, mdl_lock); + mdl_set_lock_type(mdl_lock_data, MDL_EXCLUSIVE); + mdl_add_lock(&thd->mdl_context, mdl_lock_data); } if (mdl_acquire_exclusive_locks(&thd->mdl_context)) return 1; |