Commit e5142047 authored by Luis Soares's avatar Luis Soares

BUG#54925: Assertion `query_arg && mysql_bin_log.is_open()' on

DROP TEMP TABLE

Cset: alfranio.correia@sun.com-20100420091043-4i6ouzozb34hvzhb
introduced a change that made drop temporary table to be always
logged if current statement log format was set to row. This is
fine. However, logging operations, for a "DROP TABLE" statement
in mysql_rm_table_part2, are not protected by first checking if
the mysql_bin_log is open before proceeding to the actual
logging. They only check the dont_log_query variable. This was
actually uncovered by the aforementioned cset and not introduced
by it.

We fix this by extending the condition used in the "if" that
wraps logging operations in mysql_rm_table_part2.
parent cd655559
...@@ -2202,7 +2202,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists, ...@@ -2202,7 +2202,7 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (some_tables_deleted || tmp_table_deleted || !error) if (some_tables_deleted || tmp_table_deleted || !error)
{ {
query_cache_invalidate3(thd, tables, 0); query_cache_invalidate3(thd, tables, 0);
if (!dont_log_query) if (!dont_log_query && mysql_bin_log.is_open())
{ {
if (!thd->is_current_stmt_binlog_format_row() || if (!thd->is_current_stmt_binlog_format_row() ||
(non_temp_tables_count > 0 && !tmp_table_deleted)) (non_temp_tables_count > 0 && !tmp_table_deleted))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment