summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc12
1 files changed, 5 insertions, 7 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 23177b8f51a..d07c7eaa277 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -131,13 +131,11 @@ static void mysql_ha_close_table(THD *thd, TABLE_LIST *tables)
/* Non temporary table. */
tables->table->file->ha_index_or_rnd_end();
tables->table->open_by_handler= 0;
- mysql_mutex_lock(&LOCK_open);
if (close_thread_table(thd, &tables->table))
{
/* Tell threads waiting for refresh that something has happened */
broadcast_refresh();
}
- mysql_mutex_unlock(&LOCK_open);
thd->mdl_context.release_lock(tables->mdl_request.ticket);
}
else if (tables->table)
@@ -278,7 +276,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
See open_table() back-off comments for more details.
*/
backup_open_tables= thd->open_tables;
- thd->open_tables= NULL;
+ thd->set_open_tables(NULL);
mdl_savepoint= thd->mdl_context.mdl_savepoint();
/*
@@ -312,7 +310,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
if (error)
{
close_thread_tables(thd);
- thd->open_tables= backup_open_tables;
+ thd->set_open_tables(backup_open_tables);
thd->mdl_context.rollback_to_savepoint(mdl_savepoint);
if (!reopen)
my_hash_delete(&thd->handler_tables_hash, (uchar*) hash_tables);
@@ -325,7 +323,7 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
DBUG_PRINT("exit",("ERROR"));
DBUG_RETURN(TRUE);
}
- thd->open_tables= backup_open_tables;
+ thd->set_open_tables(backup_open_tables);
if (hash_tables->mdl_request.ticket)
{
thd->mdl_context.
@@ -559,7 +557,7 @@ retry:
mysql_lock_tables() needs thd->open_tables to be set correctly to
be able to handle aborts properly.
*/
- thd->open_tables= hash_tables->table;
+ thd->set_open_tables(hash_tables->table);
sql_handler_lock_error.init();
@@ -575,7 +573,7 @@ retry:
*/
DBUG_ASSERT(hash_tables->table == thd->open_tables);
/* Restore previous context. */
- thd->open_tables= backup_open_tables;
+ thd->set_open_tables(backup_open_tables);
if (sql_handler_lock_error.need_reopen())
{