summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-01 01:39:13 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-01 01:39:13 +0300
commitb05303c132995ed78f38d725ffae198dcaaba364 (patch)
tree52b964eba5b9ce63717368ccff69c2934a6e8472 /sql/sql_trigger.cc
parente23046d1bcaf54838167dd6bd3d8c6900e24b2ef (diff)
downloadmariadb-git-b05303c132995ed78f38d725ffae198dcaaba364.tar.gz
Backport of:
------------------------------------------------------------ revno: 2630.4.18 committer: Dmitry Lenev <dlenev@mysql.com> branch nick: mysql-6.0-3726-w2 timestamp: Tue 2008-06-03 21:07:58 +0400 message: WL#3726 "DDL locking for all metadata objects". After review fixes in progress. Now during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context. This makes API a bit more clear and makes adjust_mdl_locks_upgradability() much nicer. sql/lock.cc: lock_table_names(): Set TABLE_LIST::mdl_lock_data when allocating new metadata lock request object for table list element. sql/mdl.cc: Now during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context. Adjusted upgrade/ downgrade functions accordingly. We also got rid of mdl_release_exclusive_locks() and now release locks individually. To simplify this process mdl_release_all_locks_for_name() was introduced. sql/mdl.h: Now during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context. Adjusted upgrade/ downgrade functions accordingly. We also got rid of mdl_release_exclusive_locks() and now release locks individually. To simplify this process mdl_release_all_locks_for_name() was introduced. sql/sql_base.cc: Now during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context. We also got rid of mdl_release_exclusive_locks() and now release locks individually. sql/sql_parse.cc: adjust_mdl_locks_upgradability() is much simplier now due to the fact that now during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context. sql/sql_table.cc: Now during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context. Adjusted upgrade/ downgrade functions accordingly. We also got rid of mdl_release_exclusive_locks() and now release locks individually. To simplify this process mdl_release_all_locks_for_name() was introduced. sql/sql_trigger.cc: ow during upgrading/downgrading metadata locks we deal with individual metadata lock requests rather than with all requests for this object in the context.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 4e2b77292d8..caf5c84e1f9 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -527,8 +527,9 @@ end:
locks. Otherwise call to close_thread_tables() will take care about both
TABLE instance created by reopen_name_locked_table() and meta-data lock.
*/
- if (thd->locked_tables)
- mdl_downgrade_exclusive_locks(&thd->mdl_context);
+ if (thd->locked_tables && tables && tables->table)
+ mdl_downgrade_exclusive_lock(&thd->mdl_context,
+ tables->table->mdl_lock_data);
if (need_start_waiting)
start_waiting_global_read_lock(thd);