summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@oracle.com>2010-07-19 11:03:52 +0200
committerJon Olav Hauglid <jon.hauglid@oracle.com>2010-07-19 11:03:52 +0200
commit85e5ce0ba06b6a79e4bd7521ab0e44c1e63a3e77 (patch)
treea1625076e06207efabbacb575121b6d04a393404 /sql/sql_delete.cc
parent92f3fc92f3310cb19d48f69ab6f5d23789a90570 (diff)
downloadmariadb-git-85e5ce0ba06b6a79e4bd7521ab0e44c1e63a3e77.tar.gz
Bug #54734 assert in Diagnostics_area::set_ok_status
This assert checks that the server does not try to send OK to the client if there has been some error during processing. This is done to make sure that the error is in fact sent to the client. The problem was that view errors during processing of WHERE conditions in UPDATE statements where not detected by the update code. It therefore tried to send OK to the client, triggering the assert. The bug was only noticeable in debug builds. This patch fixes the problem by making sure that the update code checks for errors during condition processing and acts accordingly.
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index eb0fd4b5332..6a87eb4e572 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -51,6 +51,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
THD::killed_state killed_status= THD::NOT_KILLED;
DBUG_ENTER("mysql_delete");
bool save_binlog_row_based;
+ bool skip_record;
THD::enum_binlog_query_type query_type=
thd->lex->sql_command == SQLCOM_TRUNCATE ?
@@ -307,7 +308,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
{
thd->examined_row_count++;
// thd->is_error() is tested to disallow delete row on error
- if (!(select && select->skip_record())&& ! thd->is_error() )
+ if (!select || (!select->skip_record(thd, &skip_record) && !skip_record))
{
if (triggers_applicable &&