Skip to content

Commit

Permalink
bugfix: use THD::main_mem_root for kill error message
Browse files Browse the repository at this point in the history
cannot use the current THD::mem_root, because it can be temporarily
reassigned to something with a very different life time
(e.g. to TABLE::mem_root or range optimizer mem_root).
  • Loading branch information
vuvova committed May 27, 2020
1 parent b01c8a6 commit 1e95115
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/sql_class.h
Original file line number Diff line number Diff line change
Expand Up @@ -3729,7 +3729,8 @@ class THD :public Statement,
The worst things that can happen is that we get
a suboptimal error message.
*/
if ((killed_err= (err_info*) alloc(sizeof(*killed_err))))
killed_err= (err_info*) alloc_root(&main_mem_root, sizeof(*killed_err));
if (killed_err)
{
killed_err->no= killed_errno_arg;
::strmake((char*) killed_err->msg, killed_err_msg_arg,
Expand Down

0 comments on commit 1e95115

Please sign in to comment.