diff options
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 38fb897c4f8..5eb4c405c4b 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -642,18 +642,19 @@ cleanup: if (!transactional_table && deleted > 0) thd->transaction.stmt.modified_non_trans_table= thd->transaction.all.modified_non_trans_table= TRUE; - + /* See similar binlogging code in sql_update.cc, for comments */ if ((error < 0) || thd->transaction.stmt.modified_non_trans_table) { - if (mysql_bin_log.is_open()) + if(IF_WSREP((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()), + mysql_bin_log.is_open())) { int errcode= 0; if (error < 0) thd->clear_error(); else errcode= query_error_code(thd, killed_status == NOT_KILLED); - + /* [binlog]: If 'handler::delete_all_rows()' was called and the storage engine does not inject the rows itself, we replicate @@ -1107,13 +1108,14 @@ void multi_delete::abort_result_set() DBUG_ASSERT(error_handled); DBUG_VOID_RETURN; } - + if (thd->transaction.stmt.modified_non_trans_table) { - /* + /* there is only side effects; to binlog with the error */ - if (mysql_bin_log.is_open()) + if (IF_WSREP((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()), + mysql_bin_log.is_open())) { int errcode= query_error_code(thd, thd->killed == NOT_KILLED); /* possible error of writing binary log is ignored deliberately */ @@ -1289,7 +1291,8 @@ bool multi_delete::send_eof() } if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table) { - if (mysql_bin_log.is_open()) + if(IF_WSREP((WSREP_EMULATE_BINLOG(thd) || mysql_bin_log.is_open()), + mysql_bin_log.is_open())) { int errcode= 0; if (local_error == 0) |