summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorGeorgi Kodinov <joro@sun.com>2009-07-13 20:36:54 +0300
committerGeorgi Kodinov <joro@sun.com>2009-07-13 20:36:54 +0300
commitbef74a2335bcd99699579d4db2b80692aa5fb1da (patch)
treeb51de7ece35f1ee2f89556f42ea5a616174cdbf7 /sql/sql_delete.cc
parent68228070f80eded56049f4b300583b9e3309fe33 (diff)
parent410e1a72b957b72e0fb2a50930e7e82847c4486c (diff)
downloadmariadb-git-bef74a2335bcd99699579d4db2b80692aa5fb1da.tar.gz
Merge of the fix for bug #40113 to 5.1.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 677098d275a..0d4bf3f0b8f 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -187,6 +187,14 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
delete select;
free_underlaid_joins(thd, select_lex);
thd->row_count_func= 0;
+ /*
+ Error was already created by quick select evaluation (check_quick()).
+ TODO: Add error code output parameter to Item::val_xxx() methods.
+ Currently they rely on the user checking DA for
+ errors when unwinding the stack after calling Item::val_xxx().
+ */
+ if (thd->is_error())
+ DBUG_RETURN(TRUE);
my_ok(thd, (ha_rows) thd->row_count_func);
/*
We don't need to call reset_auto_increment in this case, because
@@ -490,7 +498,7 @@ int mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
if (select_lex->inner_refs_list.elements &&
fix_inner_refs(thd, all_fields, select_lex, select_lex->ref_pointer_array))
- DBUG_RETURN(-1);
+ DBUG_RETURN(TRUE);
select_lex->fix_prepare_information(thd, conds, &fake_conds);
DBUG_RETURN(FALSE);