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.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ba9fa6f6c80..c6f491cdb61 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -624,8 +624,10 @@ void close_temporary_tables(THD *thd)
if (!mysql_bin_log.is_open())
{
- for (table= thd->temporary_tables; table; table= table->next)
+ TABLE *next;
+ for (table= thd->temporary_tables; table; table= next)
{
+ next= table->next;
close_temporary(table, 1);
}
thd->temporary_tables= 0;
@@ -648,7 +650,6 @@ void close_temporary_tables(THD *thd)
insertion sort of temp tables by pseudo_thread_id to build ordered list
of sublists of equal pseudo_thread_id
*/
-
for (prev_table= thd->temporary_tables, table= prev_table->next;
table;
prev_table= table, table= table->next)