1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

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
This commit is contained in:
He Zhenxing
2009-05-30 21:32:28 +08:00
parent 88e84c1fbf
commit abf5f8dac2
18 changed files with 133 additions and 83 deletions

View File

@@ -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);