diff options
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 5c7cfdce657..f63ba4ed657 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2000, 2015, Oracle and/or its affiliates. - Copyright (c) 2008, 2016, MariaDB + Copyright (c) 2008, 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -742,8 +742,8 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) #endif { ulong tmp; + bzero(&variables, sizeof(variables)); - mdl_context.init(this); /* We set THR_THD to temporally point to this THD to register all the variables that allocates memory for this THD @@ -753,8 +753,11 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) status_var.local_memory_used= sizeof(THD); status_var.global_memory_used= 0; variables.pseudo_thread_id= thread_id; + variables.max_mem_used= global_system_variables.max_mem_used; main_da.init(); + mdl_context.init(this); + /* Pass nominal parameters to init_alloc_root only to ensure that the destructor works OK in case of an error. The main_mem_root @@ -800,7 +803,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) connection_name.str= 0; connection_name.length= 0; - bzero(&variables, sizeof(variables)); file_id = 0; query_id= 0; query_name_consts= 0; @@ -916,7 +918,6 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) m_internal_handler= NULL; m_binlog_invoker= INVOKER_NONE; - arena_for_cached_items= 0; memset(&invoker_user, 0, sizeof(invoker_user)); memset(&invoker_host, 0, sizeof(invoker_host)); prepare_derived_at_open= FALSE; |