diff options
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 76c511e4ba0..36648c33ac6 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -614,18 +614,12 @@ static MYSQL_LOCK *get_lock_data(THD *thd, TABLE **table_ptr, uint count, lock_count++; } /* - To be able to open and lock for reading system tables like 'mysql.proc', - when we already have some tables opened and locked, and avoid deadlocks - we have to disallow write-locking of these tables with any other tables. + Check if we can lock the table. For some tables we cannot do that + beacause of handler-specific locking issues. */ - if (table_ptr[i]->s->system_table && - table_ptr[i]->reginfo.lock_type >= TL_WRITE_ALLOW_WRITE && - count != 1) - { - my_error(ER_WRONG_LOCK_OF_SYSTEM_TABLE, MYF(0), table_ptr[i]->s->db.str, - table_ptr[i]->s->table_name.str); - DBUG_RETURN(0); - } + if (!table_ptr[i]->file->check_if_locking_is_allowed(thd, table_ptr[i], + count)) + return 0; } if (!(sql_lock= (MYSQL_LOCK*) |