summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.intranet>2006-10-25 19:53:26 +0400
committerunknown <kroki/tomash@moonlight.intranet>2006-10-25 19:53:26 +0400
commite3d49f0c3f7995e2c618cfa764a1ceaa2418a669 (patch)
tree76cc8ccd7dde29804581307da1615334d22c3ad8 /sql/sql_delete.cc
parent5d46e2993389f3cffe2a37374ba61334f86f7e5e (diff)
downloadmariadb-git-e3d49f0c3f7995e2c618cfa764a1ceaa2418a669.tar.gz
BUG#18819: DELETE IGNORE hangs on foreign key parent delete
If the error happens during DELETE IGNORE, nothing could be send to the client, thus leaving it frozen expecting the reply. The problem was that if some error occurred, it wouldn't be reported to the client because of IGNORE, but neither success would be reported. MySQL 4.1 would not freeze the client, but will report ERROR 1105 (HY000): Unknown error instead, which is also a bug. The solution is to report success if we are in DELETE IGNORE and some non-fatal error has happened. mysql-test/r/innodb_mysql.result: Add result for bug#18819: DELETE IGNORE hangs on foreign key parent delete. mysql-test/t/innodb_mysql.test: Add test case for bug#18819: DELETE IGNORE hangs on foreign key parent delete. sql/sql_delete.cc: Report success if we have got an error, but we are in DELETE IGNORE, and the error is not fatal (if it is, it would be reported to the client).
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 b085d37be78..506eec88500 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -253,7 +253,8 @@ cleanup:
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}
- if (error >= 0 || thd->net.report_error)
+ if ((error >= 0 || thd->net.report_error) &&
+ (!thd->lex->ignore || thd->is_fatal_error))
send_error(thd,thd->killed ? ER_SERVER_SHUTDOWN: 0);
else
{