summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authorDmitry Lenev <dlenev@mysql.com>2010-05-25 16:35:01 +0400
committerDmitry Lenev <dlenev@mysql.com>2010-05-25 16:35:01 +0400
commita3c080be7ac95ce7f6f384a07f9ff0b31fd33a0f (patch)
tree5ca3eccef7fd43ef9cca0e1b7c7d9d307f34add2 /sql/sql_trigger.cc
parent6ceacd4fb94f84faeb6d637d068cea2722a016c1 (diff)
downloadmariadb-git-a3c080be7ac95ce7f6f384a07f9ff0b31fd33a0f.tar.gz
Pre-requisite patch for bug #51263 "Deadlock between
transactional SELECT and ALTER TABLE ... REBUILD PARTITION". The goal of this patch is to decouple type of metadata lock acquired for table by open_tables() from type of table-level lock to be acquired on it. To achieve this we change approach to how we determine what type of metadata lock should be acquired on table to be open. Now instead of inferring it at open_tables() time from flags and type of table-level lock we rely on that type of metadata lock is properly set at parsing time and is not changed further.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 9ce62d9f2a4..ae09898ada2 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -489,8 +489,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
else
{
tables->table= open_n_lock_single_table(thd, tables,
- TL_WRITE_ALLOW_READ,
- MYSQL_OPEN_TAKE_UPGRADABLE_MDL);
+ TL_WRITE_ALLOW_READ, 0);
if (! tables->table)
goto end;
tables->table->use_all_columns();
@@ -1667,7 +1666,8 @@ bool add_table_for_trigger(THD *thd,
DBUG_RETURN(TRUE);
*table= sp_add_to_query_tables(thd, lex, trg_name->m_db.str,
- tbl_name.str, TL_IGNORE);
+ tbl_name.str, TL_IGNORE,
+ MDL_SHARED_NO_WRITE);
DBUG_RETURN(*table ? FALSE : TRUE);
}