summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index aa06822e03f..a9054b99186 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -108,6 +108,13 @@ MYSQL_LOCK *mysql_lock_tables(THD *thd,TABLE **tables,uint count)
thd->locked=0;
break;
}
+ else if (!thd->open_tables)
+ {
+ // Only using temporary tables, no need to unlock
+ thd->some_tables_deleted=0;
+ thd->locked=0;
+ break;
+ }
/* some table was altered or deleted. reopen tables marked deleted */
mysql_unlock_tables(thd,sql_lock);