diff options
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 98d034a4d5c..722b6f7478f 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -1,4 +1,5 @@ -/* Copyright (C) 2000 MySQL AB +/* + Copyright (c) 2000, 2010, Oracle and/or its affiliates. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -11,7 +12,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ /* Delete of records and truncate of tables. @@ -122,8 +124,6 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, DBUG_RETURN(TRUE); } - select_lex->no_error= thd->lex->ignore; - const_cond_result= const_cond && (!conds || conds->val_int()); if (thd->is_error()) { @@ -363,16 +363,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, } else { - table->file->print_error(error,MYF(0)); - /* - In < 4.0.14 we set the error number to 0 here, but that - was not sensible, because then MySQL would not roll back the - failed DELETE, and also wrote it to the binlog. For MyISAM - tables a DELETE probably never should fail (?), but for - InnoDB it can fail in a FOREIGN KEY error or an - out-of-tablespace error. - */ - if (!select_lex->no_error) + table->file->print_error(error, + MYF(thd->lex->ignore ? ME_JUST_WARNING : 0)); + if (thd->is_error()) { error= 1; break; @@ -807,7 +800,7 @@ int multi_delete::send_data(List<Item> &values) TABLE_LIST *del_table; DBUG_ENTER("multi_delete::send_data"); - bool ignore= thd->lex->current_select->no_error; + bool ignore= thd->lex->ignore; for (del_table= delete_tables; del_table; @@ -956,11 +949,11 @@ int multi_delete::do_deletes() table_being_deleted= table_being_deleted->next_local, counter++) { TABLE *table = table_being_deleted->table; + int local_error; if (tempfiles[counter]->get(table)) DBUG_RETURN(1); - int local_error= - do_table_deletes(table, thd->lex->current_select->no_error); + local_error= do_table_deletes(table, thd->lex->ignore); if (thd->killed && !local_error) DBUG_RETURN(1); |