summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4c3e113d537..9ba5277a92c 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -407,7 +407,10 @@ void close_thread_tables(THD *thd, bool locked)
DBUG_ENTER("close_thread_tables");
if (thd->locked_tables)
+ {
+ ha_commit_stmt(thd); // If select statement
DBUG_VOID_RETURN; // LOCK TABLES in use
+ }
TABLE *table,*next;
bool found_old_table=0;