diff options
author | Georgi Kodinov <joro@sun.com> | 2009-07-13 18:11:16 +0300 |
---|---|---|
committer | Georgi Kodinov <joro@sun.com> | 2009-07-13 18:11:16 +0300 |
commit | 410e1a72b957b72e0fb2a50930e7e82847c4486c (patch) | |
tree | 8915bb86227f4747f69f6afbe8076c9d43a2181f /sql/sql_delete.cc | |
parent | 544147417a567c2a40e8cf01e25c7785e26887a1 (diff) | |
download | mariadb-git-410e1a72b957b72e0fb2a50930e7e82847c4486c.tar.gz |
Bug #40113: Embedded SELECT inside UPDATE or DELETE can timeout
without error
When using quick access methods for searching rows in UPDATE or
DELETE there was no check if a fatal error was not already sent
to the client while evaluating the quick condition.
As a result a false OK (following the error) was sent to the
client and the error was thus transformed into a warning.
Fixed by checking for errors sent to the client during
SQL_SELECT::check_quick() and treating them as real errors.
Fixed a wrong test case in group_min_max.test
Fixed a wrong return code in mysql_update() and mysql_delete()
mysql-test/r/bug40113.result:
Bug #40013: test case
mysql-test/r/group_min_max.result:
Bug #40013: fixed a wrong test case
mysql-test/t/bug40113-master.opt:
Bug #40013: test case
mysql-test/t/bug40113.test:
Bug #40013: test case
mysql-test/t/group_min_max.test:
Bug #40013: fixed a wrong test case
sql/sql_delete.cc:
Bug #40113: check for errors evaluating the quick select
sql/sql_update.cc:
Bug #40113: check for errors evaluating the quick select
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 30b14209a7c..3bf088609cd 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -144,6 +144,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->net.report_error) + DBUG_RETURN(TRUE); send_ok(thd,0L); /* @@ -407,7 +415,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); |