mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Backport of:
------------------------------------------------------------ revno: 2630.4.16 committer: Dmitry Lenev <dlenev@mysql.com> branch nick: mysql-6.0-3726-w timestamp: Thu 2008-05-29 09:45:02 +0400 message: WL#3726 "DDL locking for all metadata objects". After review changes in progress. Tweaked some comments and did some renames to avoid ambiguites.
This commit is contained in:
@ -446,8 +446,17 @@ bool mysql_create_or_drop_trigger(THD *thd, TABLE_LIST *tables, bool create)
|
||||
|
||||
if (thd->locked_tables)
|
||||
{
|
||||
if (name_lock_locked_table(thd, tables))
|
||||
/* Under LOCK TABLES we must only accept write locked tables. */
|
||||
if (!(tables->table= find_write_locked_table(thd->open_tables, tables->db,
|
||||
tables->table_name)))
|
||||
goto end;
|
||||
/*
|
||||
Ensure that table is opened only by this thread and that no other
|
||||
statement will open this table.
|
||||
*/
|
||||
if (wait_while_table_is_used(thd, tables->table, HA_EXTRA_FORCE_REOPEN))
|
||||
goto end;
|
||||
|
||||
pthread_mutex_lock(&LOCK_open);
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user