From 02425b7bf05fc885bd75c66b51f06b6fdba696b7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 30 May 2005 18:55:56 +0400 Subject: Added test for bug #5894 "Triggers with altered tables cause corrupt databases" and basic handling of errors which happen in triggers. (The bug itself was fixed by several previous patches). Fixed bug in multi-delete which were exposed by these tests. mysql-test/r/trigger.result: Added test for bug #5894 "Triggers with altered tables cause corrupt databases" and basic handling of errors which happen in triggers. mysql-test/t/trigger.test: Added test for bug #5894 "Triggers with altered tables cause corrupt databases" and basic handling of errors which happen in triggers. sql/sql_delete.cc: multi_delete::send_eof(): Fixed bug which were exposed by testing of basic handling of errors in triggers. Error which happened in multi_delete::do_deletes() was wiped out by thd->clear_error() and thus never sent to client (and this stalled client connection). --- sql/sql_delete.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_delete.cc') diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 97830f7ec8f..672972ccb72 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -696,11 +696,11 @@ bool multi_delete::send_eof() Note that if we deleted nothing we don't write to the binlog (TODO: fix this). */ - if (deleted && (error <= 0 || normal_tables)) + if (deleted && ((error <= 0 && !local_error) || normal_tables)) { if (mysql_bin_log.is_open()) { - if (error <= 0) + if (error <= 0 && !local_error) thd->clear_error(); Query_log_event qinfo(thd, thd->query, thd->query_length, transactional_tables, FALSE); -- cgit v1.2.1