summaryrefslogtreecommitdiff
path: root/sql/sql_trigger.cc
diff options
context:
space:
mode:
authorKonstantin Osipov <kostja@sun.com>2009-12-10 11:41:03 +0300
committerKonstantin Osipov <kostja@sun.com>2009-12-10 11:41:03 +0300
commitf12936728885621bad57e0c21e2c0b35447742d2 (patch)
tree1af99bc4bb290dd6389f05386dda02b151f85ece /sql/sql_trigger.cc
parentf26f632b44dfe9a6cc239a10f8697ba0ba50675d (diff)
parent0bd574102208166774c79c8ffda40c6fc3779389 (diff)
downloadmariadb-git-f12936728885621bad57e0c21e2c0b35447742d2.tar.gz
Merge with next-4284.
Diffstat (limited to 'sql/sql_trigger.cc')
-rw-r--r--sql/sql_trigger.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/sql/sql_trigger.cc b/sql/sql_trigger.cc
index 08d0dacd8e8..823dca5d93f 100644
--- a/sql/sql_trigger.cc
+++ b/sql/sql_trigger.cc
@@ -328,7 +328,6 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
TABLE *table;
bool result= TRUE;
String stmt_query;
- bool need_start_waiting= FALSE;
bool lock_upgrade_done= FALSE;
MDL_ticket *mdl_ticket= NULL;
@@ -386,8 +385,7 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
LOCK_open is not enough because global read lock is held without holding
LOCK_open).
*/
- if (!thd->locked_tables_mode &&
- !(need_start_waiting= !wait_if_global_read_lock(thd, 0, 1)))
+ if (!thd->locked_tables_mode && wait_if_global_read_lock(thd, 0, 1))
DBUG_RETURN(TRUE);
if (!create)
@@ -521,7 +519,7 @@ end:
if (thd->locked_tables_mode && tables && lock_upgrade_done)
mdl_ticket->downgrade_exclusive_lock();
- if (need_start_waiting)
+ if (thd->global_read_lock_protection > 0)
start_waiting_global_read_lock(thd);
if (!result)