summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gbichot@quadita2.mysql.com>2005-04-11 16:46:03 +0200
committerunknown <gbichot@quadita2.mysql.com>2005-04-11 16:46:03 +0200
commit30a82dfb7d6784b1121f23f37ee81d9cfedec08e (patch)
treefaab11b6a00d573da36c6c2e768b6de212f23b56
parent93b4fbea9247aad1ad469a252ef1b67fc8e87bdf (diff)
downloadmariadb-git-30a82dfb7d6784b1121f23f37ee81d9cfedec08e.tar.gz
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).
-rw-r--r--sql/sql_table.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 84f51a95691..f3f8511026b 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -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
{