summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2020-05-20 17:02:47 +0200
committerSergei Golubchik <serg@mariadb.org>2020-05-27 15:56:40 +0200
commit1e951155bddd42b84e1c4ed949a85d62829e696f (patch)
tree583b2763083ec1702701900d67c3be21f23535ff
parentb01c8a6cc8b361c6c8ecd887f1958c1f0b2e9811 (diff)
downloadmariadb-git-1e951155bddd42b84e1c4ed949a85d62829e696f.tar.gz
bugfix: use THD::main_mem_root for kill error message
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).
-rw-r--r--sql/sql_class.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 80aa5710b62..838998af94f 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -3729,7 +3729,8 @@ public:
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,