From 0880db56407c8eb2d8cd7804471ee2fd5662d150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Lindstr=C3=B6m?= Date: Wed, 4 Sep 2013 09:54:40 +0300 Subject: [PATCH] Fix merge error --- sql/sql_table.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index ba91eb3ba38..9981361cf52 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -7499,6 +7499,10 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, : HA_EXTRA_FORCE_REOPEN; DBUG_ENTER("simple_rename_or_index_change"); +#ifdef WITH_WSREP + bool do_log_write(true); +#endif /* WITH_WSREP */ + if (keys_onoff != Alter_info::LEAVE_AS_IS) { if (wait_while_table_is_used(thd, table, extra_func)) @@ -7557,7 +7561,14 @@ simple_rename_or_index_change(THD *thd, TABLE_LIST *table_list, if (!error) { - error= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); +#ifdef WITH_WSREP + if (!WSREP(thd) || do_log_write) { +#endif /* WITH_WSREP */ + error= write_bin_log(thd, TRUE, thd->query(), thd->query_length()); +#ifdef WITH_WSREP + } +#endif /* !WITH_WSREP */ + if (!error) my_ok(thd); } @@ -7857,9 +7868,6 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, bool res= simple_rename_or_index_change(thd, table_list, alter_info->keys_onoff, &alter_ctx); -#ifdef WITH_WSREP - bool do_log_write(true); -#endif /* WITH_WSREP */ DBUG_RETURN(res); }