summaryrefslogtreecommitdiff
path: root/sql/sql_base.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-10-08 22:54:24 +0200
committerSergei Golubchik <serg@mariadb.org>2015-10-08 22:54:24 +0200
commit82e9f6d948132b71abd57d8413f97f0cc2208d82 (patch)
tree3ab146f819af46d42d93be133cea16b66ff5df7f /sql/sql_base.cc
parentc8d511293aae155210089b6de4143d11569af18d (diff)
parentb9768521bdeb1a8069c7b871f4536792b65fd79b (diff)
downloadmariadb-git-82e9f6d948132b71abd57d8413f97f0cc2208d82.tar.gz
Merge remote-tracking branch 'mysql/5.5' into 5.5
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r--sql/sql_base.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 4b088952551..1403fe91e55 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1682,13 +1682,20 @@ bool close_temporary_tables(THD *thd)
if (!thd->temporary_tables)
DBUG_RETURN(FALSE);
+ /*
+ Ensure we don't have open HANDLERs for tables we are about to close.
+ This is necessary when close_temporary_tables() is called as part
+ of execution of BINLOG statement (e.g. for format description event).
+ */
+ mysql_ha_rm_temporary_tables(thd);
if (!mysql_bin_log.is_open())
{
TABLE *tmp_next;
- for (table= thd->temporary_tables; table; table= tmp_next)
+ for (TABLE *t= thd->temporary_tables; t; t= tmp_next)
{
- tmp_next= table->next;
- close_temporary(table, 1, 1);
+ tmp_next= t->next;
+ mysql_lock_remove(thd, thd->lock, t);
+ close_temporary(t, 1, 1);
}
thd->temporary_tables= 0;
DBUG_RETURN(FALSE);
@@ -1783,6 +1790,7 @@ bool close_temporary_tables(THD *thd)
strlen(table->s->table_name.str));
s_query.append(',');
next= table->next;
+ mysql_lock_remove(thd, thd->lock, table);
close_temporary(table, 1, 1);
}
thd->clear_error();