diff options
author | He Zhenxing <zhenxing.he@sun.com> | 2009-05-30 21:32:28 +0800 |
---|---|---|
committer | He Zhenxing <zhenxing.he@sun.com> | 2009-05-30 21:32:28 +0800 |
commit | abf5f8dac2a0840687dc99816cbd68fb8c515e50 (patch) | |
tree | a2efff0bf717227dce4199d6e283e4a7c112dfdd /sql/sql_table.cc | |
parent | 88e84c1fbfe9b60eeb9c3d24745ee31cfe29c38b (diff) | |
download | mariadb-git-abf5f8dac2a0840687dc99816cbd68fb8c515e50.tar.gz |
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
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 7 |
1 files changed, 5 insertions, 2 deletions
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); |