Commit 30a82dfb authored by unknown's avatar unknown

Fix for BUG#9149 "OPTIMIZE TABLE statement on InnoDB table is logged twice in the binary log"

if we fall back to mysql_alter_table() (for InnoDB), don't do binlogging in mysql_alter_table(), as mysql_admin_table()
is not supposed to do any binlogging (it is done by the caller).


sql/sql_table.cc:
  When optimizing a table, if we fall back to mysql_alter_table()
  (for InnoDB), don't do binlogging in mysql_alter_table(), as mysql_admin_table()
  is not supposed to do any binlogging (it is done by the caller).
parent 93b4fbea
......@@ -2041,7 +2041,9 @@ send_result_message:
close_thread_tables(thd);
TABLE_LIST *save_next= table->next;
table->next= 0;
tmp_disable_binlog(thd); // binlogging is done by caller if wanted
result_code= mysql_recreate_table(thd, table, 0);
reenable_binlog(thd);
close_thread_tables(thd);
if (!result_code) // recreation went ok
{
......
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