summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <aelkin/elkin@koti.dsl.inet.fi>2007-10-30 11:31:03 +0200
committerunknown <aelkin/elkin@koti.dsl.inet.fi>2007-10-30 11:31:03 +0200
commit200f0531eff80dd9ac24b8ba15af3e0009739f83 (patch)
treef5e6986d61bf71321559f4a770993fbb5aa8da16 /sql/sql_delete.cc
parenta3b60d2d5177f48ca82ef644e81f5b287b52f1ba (diff)
parent5e314d06e67117b85d0e72f07c73b26fa0fb55d3 (diff)
downloadmariadb-git-200f0531eff80dd9ac24b8ba15af3e0009739f83.tar.gz
Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug27571_asyn_killed_flags
into koti.dsl.inet.fi:/home/elkin/MySQL/5.1-merge-bug27571 client/mysql.cc: Auto merged mysql-test/r/ctype_euckr.result: Auto merged mysql-test/r/ctype_uca.result: Auto merged mysql-test/suite/binlog/r/binlog_killed.result: Auto merged mysql-test/suite/binlog/t/binlog_killed.test: Auto merged sql/item_cmpfunc.cc: Auto merged sql/log_event.cc: Auto merged sql/log_event.h: Auto merged sql/mysqld.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_parse.cc: Auto merged strings/ctype-euc_kr.c: Auto merged mysql-test/suite/rpl/r/rpl_sp_effects.result: manual merge ul mysql-test/suite/rpl/t/rpl_sp_effects.test: manual merge sql/slave.cc: leaving for manual merge sql/sql_delete.cc: leaving for manual merge sql/sql_insert.cc: leaving for manual merge sql/sql_load.cc: leaving for manual merge sql/sql_update.cc: leaving for manual merge
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc34
1 files changed, 29 insertions, 5 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 0746a261de1..33d19852371 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -38,6 +38,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
ha_rows deleted= 0;
uint usable_index= MAX_KEY;
SELECT_LEX *select_lex= &thd->lex->select_lex;
+ THD::killed_state killed_status= THD::NOT_KILLED;
DBUG_ENTER("mysql_delete");
if (open_and_lock_tables(thd, table_list))
@@ -300,8 +301,8 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
else
table->file->unlock_row(); // Row failed selection, release lock on it
}
- if (thd->killed && !error)
- error= 1; // Aborted
+ killed_status= thd->killed;
+ error= (killed_status == THD::NOT_KILLED)? error : 1;
if (will_batch && (loc_error= table->file->end_bulk_delete()))
{
if (error != 1)
@@ -351,6 +352,11 @@ cleanup:
{
if (error < 0)
thd->clear_error();
+<<<<<<< gca sql/sql_delete.cc 1.144.1.57
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ transactional_table, FALSE);
+ if (mysql_bin_log.write(&qinfo) && transactional_table)
+<<<<<<< local sql/sql_delete.cc 1.230
/*
[binlog]: If 'handler::delete_all_rows()' was called and the
@@ -364,6 +370,11 @@ cleanup:
if (log_result && transactional_table)
{
+<<<<<<< remote sql/sql_delete.cc 1.144.1.58
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ transactional_table, FALSE, killed_status);
+ if (mysql_bin_log.write(&qinfo) && transactional_table)
+>>>>>>>
error=1;
}
}
@@ -764,7 +775,8 @@ void multi_delete::send_error(uint errcode,const char *err)
}
thd->transaction.all.modified_non_trans_table= true;
}
- DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table);
+ DBUG_ASSERT(!normal_tables || !deleted ||
+ thd->transaction.stmt.modified_non_trans_table);
DBUG_VOID_RETURN;
}
@@ -862,6 +874,7 @@ int multi_delete::do_deletes()
bool multi_delete::send_eof()
{
+ THD::killed_state killed_status= THD::NOT_KILLED;
thd->proc_info="deleting from reference tables";
/* Does deletes for the last n - 1 tables, returns 0 if ok */
@@ -869,7 +882,7 @@ bool multi_delete::send_eof()
/* compute a total error to know if something failed */
local_error= local_error || error;
-
+ killed_status= (local_error == 0)? THD::NOT_KILLED : thd->killed;
/* reset used flags */
thd->proc_info="end";
@@ -881,18 +894,29 @@ bool multi_delete::send_eof()
{
query_cache_invalidate3(thd, delete_tables, 1);
}
- DBUG_ASSERT(!normal_tables || !deleted || thd->transaction.stmt.modified_non_trans_table);
+ DBUG_ASSERT(!normal_tables || !deleted ||
+ thd->transaction.stmt.modified_non_trans_table);
if ((local_error == 0) || thd->transaction.stmt.modified_non_trans_table)
{
if (mysql_bin_log.is_open())
{
if (local_error == 0)
thd->clear_error();
+<<<<<<< gca sql/sql_delete.cc 1.144.1.57
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ transactional_tables, FALSE);
+ if (mysql_bin_log.write(&qinfo) && !normal_tables)
+<<<<<<< local sql/sql_delete.cc 1.230
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query, thd->query_length,
transactional_tables, FALSE) &&
!normal_tables)
{
+<<<<<<< remote sql/sql_delete.cc 1.144.1.58
+ Query_log_event qinfo(thd, thd->query, thd->query_length,
+ transactional_tables, FALSE, killed_status);
+ if (mysql_bin_log.write(&qinfo) && !normal_tables)
+>>>>>>>
local_error=1; // Log write failed: roll back the SQL statement
}
}