From d1d58b5f1d9a0bee5651217809f4ad61a0c44d5a Mon Sep 17 00:00:00 2001 From: "evgen@moonbone.local" <> Date: Wed, 23 May 2007 23:24:16 +0400 Subject: Bug#27563: Stored functions and triggers wasn't throwing an error when killed. If a stored function or a trigger was killed it had aborted but no error was thrown. This allows the caller statement to continue without a notice. This may lead to a wrong data being inserted/updated to/deleted as in such cases the correct result of a stored function isn't guaranteed. In the case of triggers it allows the caller statement to ignore kill signal and to waste time because of re-evaluation of triggers that always will fail because thd->killed flag is still on. Now the Item_func_sp::execute() and the sp_head::execute_trigger() functions check whether a function or a trigger were killed during execution and throws an appropriate error if so. Now the fill_record() function stops filling record if an error was reported through thd->net.report_error. --- sql/sp_head.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql/sp_head.cc') diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 338b2eb84bb..9e9c1d7bdda 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -1318,6 +1318,9 @@ err_with_cleanup: free_root(&call_mem_root, MYF(0)); thd->spcont= octx; + if (thd->killed) + thd->send_kill_message(); + DBUG_RETURN(err_status); } -- cgit v1.2.1