summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-01 01:33:22 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-01 01:33:22 +0300
commite23046d1bcaf54838167dd6bd3d8c6900e24b2ef (patch)
treeba3438eef550d9cf10d121bad3981f18566659d4 /sql/sql_delete.cc
parentcf45b61a6a611415161e6176b8c8ae85a51e9349 (diff)
downloadmariadb-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/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index fb48f32660b..f5c6dfd8986 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -1089,7 +1089,7 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
TABLE *table;
bool error;
uint path_length;
- MDL_LOCK *mdl_lock= 0;
+ MDL_LOCK_DATA *mdl_lock_data= 0;
DBUG_ENTER("mysql_truncate");
bzero((char*) &create_info,sizeof(create_info));
@@ -1164,10 +1164,10 @@ bool mysql_truncate(THD *thd, TABLE_LIST *table_list, bool dont_send_ok)
tries to get table enging and therefore accesses table in some way
without holding any kind of meta-data lock.
*/
- mdl_lock= mdl_alloc_lock(0, table_list->db, table_list->table_name,
- thd->mem_root);
- mdl_set_lock_type(mdl_lock, MDL_EXCLUSIVE);
- mdl_add_lock(&thd->mdl_context, mdl_lock);
+ mdl_lock_data= mdl_alloc_lock(0, table_list->db, table_list->table_name,
+ thd->mem_root);
+ 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))
DBUG_RETURN(TRUE);
pthread_mutex_lock(&LOCK_open);
@@ -1197,13 +1197,13 @@ end:
write_bin_log(thd, TRUE, thd->query(), thd->query_length());
my_ok(thd); // This should return record count
}
- if (mdl_lock)
- mdl_release_lock(&thd->mdl_context, mdl_lock);
+ if (mdl_lock_data)
+ mdl_release_lock(&thd->mdl_context, mdl_lock_data);
}
else if (error)
{
- if (mdl_lock)
- mdl_release_lock(&thd->mdl_context, mdl_lock);
+ if (mdl_lock_data)
+ mdl_release_lock(&thd->mdl_context, mdl_lock_data);
}
DBUG_RETURN(error);