summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorDmitry Shulga <Dmitry.Shulga@oracle.com>2010-11-11 10:52:51 +0600
committerDmitry Shulga <Dmitry.Shulga@oracle.com>2010-11-11 10:52:51 +0600
commit0fc49ccf9afe3410bd2ef54705a2f2aafe2219ca (patch)
tree18525f93620e5650b179bb8c126d52c184985fae /sql/sp_head.cc
parentce3a7f4b01578ae00d972bdec8700349f3ed44a2 (diff)
downloadmariadb-git-0fc49ccf9afe3410bd2ef54705a2f2aafe2219ca.tar.gz
Fixed bug#54375 - Error in stored procedure leaves connection
in different default schema. In strict mode, when data truncation or conversion happens, THD::killed is set to THD::KILL_BAD_DATA. This is abuse of KILL mechanism to guarantee that execution of statement is aborted. The stored procedures execution, on the other hand, upon detection that a connection was killed, would terminate immediately, without trying to restore the caller's context, in particular, restore the caller's current schema. The fix is, when terminating a stored procedure execution, to only bypass cleanup if the entire connection was killed, not in case of other forms of KILL.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 66d5eff5112..2473abea3c7 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -1372,7 +1372,7 @@ sp_head::execute(THD *thd)
If the DB has changed, the pointer has changed too, but the
original thd->db will then have been freed
*/
- if (cur_db_changed && !thd->killed)
+ if (cur_db_changed && thd->killed != THD::KILL_CONNECTION)
{
/*
Force switching back to the saved current database, because it may be