mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user