summaryrefslogtreecommitdiff
path: root/sql/sql_base.h
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2010-07-22 16:56:50 +0100
committerLuis Soares <luis.soares@sun.com>2010-07-22 16:56:50 +0100
commit2773385dd7f2b02ae226538c818037056cd01fd2 (patch)
tree5a2149e9c8739b4144a1c69b624eb7bfe52e92d2 /sql/sql_base.h
parent83aebca534a25b537f405934deade1719e63426f (diff)
downloadmariadb-git-2773385dd7f2b02ae226538c818037056cd01fd2.tar.gz
BUG#55387: binlog.binlog_tmp_table crashes the server
sporadically There are two problems: 1. When closing temporary tables, during the THD clean up - and after the session connection was already closed, there is a chance we can push an error into the THD diagnostics area, if the writing of the implicit DROP event to the binary log fails for some reason. As a consequence an assertion can be triggered, because at that point the diagnostics area is already set. 2. Using push_warning with MYSQL_ERROR::WARN_LEVEL_ERROR is a bug. Given that close_temporary_tables is mostly called from THD::cleanup - ie, with the session already closed, we fix problem #1 by allowing the diagnostics area to be overwritten. There is one other place in the code that calls close_temporary_tables - while applying Start_log_event_v3. To cover that case, we make close_temporary_tables to return the error, thus, propagating upwards in the stack. To fix problem #2, we replace push_warning with sql_print_error.
Diffstat (limited to 'sql/sql_base.h')
-rw-r--r--sql/sql_base.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_base.h b/sql/sql_base.h
index 20a068e27d7..eed535f5cdc 100644
--- a/sql/sql_base.h
+++ b/sql/sql_base.h
@@ -222,7 +222,7 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables);
void free_io_cache(TABLE *entry);
void intern_close_table(TABLE *entry);
bool close_thread_table(THD *thd, TABLE **table_ptr);
-void close_temporary_tables(THD *thd);
+bool close_temporary_tables(THD *thd);
TABLE_LIST *unique_table(THD *thd, TABLE_LIST *table, TABLE_LIST *table_list,
bool check_alias);
int drop_temporary_table(THD *thd, TABLE_LIST *table_list);