summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorHe Zhenxing <zhenxing.he@sun.com>2009-05-30 21:32:28 +0800
committerHe Zhenxing <zhenxing.he@sun.com>2009-05-30 21:32:28 +0800
commit0793eec018214cab504210ff0a40993ac0b319a9 (patch)
treea2efff0bf717227dce4199d6e283e4a7c112dfdd /sql/sql_delete.cc
parent81eb33838b682b975fa3a1955c52994ea9c543d0 (diff)
downloadmariadb-git-0793eec018214cab504210ff0a40993ac0b319a9.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.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 7b967206305..277269f3b0d 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -389,8 +389,12 @@ cleanup:
FALSE :
transactional_table;
+ int errcode= 0;
if (error < 0)
thd->clear_error();
+ else
+ errcode= query_error_code(thd, killed_status == THD::NOT_KILLED);
+
/*
[binlog]: If 'handler::delete_all_rows()' was called and the
storage engine does not inject the rows itself, we replicate
@@ -402,7 +406,7 @@ cleanup:
*/
int log_result= thd->binlog_query(query_type,
thd->query, thd->query_length,
- is_trans, FALSE, killed_status);
+ is_trans, FALSE, errcode);
if (log_result && transactional_table)
{
@@ -836,9 +840,10 @@ void multi_delete::abort()
*/
if (mysql_bin_log.is_open())
{
+ int errcode= query_error_code(thd, thd->killed == THD::NOT_KILLED);
thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
- transactional_tables, FALSE);
+ transactional_tables, FALSE, errcode);
}
thd->transaction.all.modified_non_trans_table= true;
}
@@ -979,11 +984,14 @@ bool multi_delete::send_eof()
{
if (mysql_bin_log.is_open())
{
+ int errcode= 0;
if (local_error == 0)
thd->clear_error();
+ else
+ errcode= query_error_code(thd, killed_status == THD::NOT_KILLED);
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
- transactional_tables, FALSE, killed_status) &&
+ transactional_tables, FALSE, errcode) &&
!normal_tables)
{
local_error=1; // Log write failed: roll back the SQL statement