From abf5f8dac2a0840687dc99816cbd68fb8c515e50 Mon Sep 17 00:00:00 2001 From: He Zhenxing Date: Sat, 30 May 2009 21:32:28 +0800 Subject: BUG#41948 Query_log_event constructor needlessly contorted Make the caller of Query_log_event, Execute_load_log_event constructors and THD::binlog_query to provide the error code instead of having the constructors to figure out the error code. sql/log_event.cc: Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument instead of figuring it out by itself sql/log_event.h: Changed constructors of Query_log_event and Execute_load_log_event to accept the error code argument --- sql/sql_table.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sql/sql_table.cc') diff --git a/sql/sql_table.cc b/sql/sql_table.cc index d5317995948..3f90a950324 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1460,10 +1460,13 @@ void write_bin_log(THD *thd, bool clear_error, { if (mysql_bin_log.is_open()) { + int errcode= 0; if (clear_error) thd->clear_error(); + else + errcode= query_error_code(thd, TRUE); thd->binlog_query(THD::STMT_QUERY_TYPE, - query, query_length, FALSE, FALSE, THD::NOT_KILLED); + query, query_length, FALSE, FALSE, errcode); } } @@ -6180,7 +6183,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, { thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, - 0, FALSE, THD::NOT_KILLED); + 0, FALSE, 0); mysql_bin_log.write(&qinfo); } my_ok(thd); -- cgit v1.2.1