From 859fe1f24d499b34d31807d267a534a7f72e9c03 Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 1 Feb 2018 20:03:18 +0200 Subject: Ensure that thd->user_var_events_alloc is always relevant If binary logging is not enabled thd->user_var_events_alloc would never be initialized. --- sql/sql_class.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/sql_class.cc') diff --git a/sql/sql_class.cc b/sql/sql_class.cc index d0b45441d83..6922a7ae5df 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -772,6 +772,12 @@ THD::THD(my_thread_id id, bool is_wsrep_applier) init_sql_alloc(&main_mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0, MYF(MY_THREAD_SPECIFIC)); + /* + Allocation of user variables for binary logging is always done with main + mem root + */ + user_var_events_alloc= mem_root; + stmt_arena= this; thread_stack= 0; scheduler= thread_scheduler; // Will be fixed later -- cgit v1.2.1