[Commits] 4735e58: Post review changes MDEV-7006

sanja at mariadb.com sanja at mariadb.com
Tue Feb 17 11:29:29 EET 2015


revision-id: 4735e5872c58e2d3ec119aafa8457cf00c38898b
parent(s): f69bf1ead4c27126457ec50f869c992e7ba0437d
committer: Oleksandr Byelkin
branch nick: work-maria-10.1-MDEV-6997
timestamp: 2015-02-17 10:29:20 +0100
message:

Post review changes MDEV-7006

---
 sql/log_event.cc | 2 +-
 sql/sql_lex.cc   | 7 ++++---
 sql/sql_lex.h    | 2 ++
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/sql/log_event.cc b/sql/log_event.cc
index bb4c517..7a485de 100644
--- a/sql/log_event.cc
+++ b/sql/log_event.cc
@@ -4290,10 +4290,10 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi,
 
         thd->enable_slow_log= thd->variables.sql_log_slow;
         mysql_parse(thd, thd->query(), thd->query_length(), &parser_state);
-        thd->lex->restore_set_statement_var();
         /* Finalize server status flags after executing a statement. */
         thd->update_server_status();
         log_slow_statement(thd);
+        thd->lex->restore_set_statement_var();
       }
 
       thd->variables.option_bits&= ~OPTION_MASTER_SQL_ERROR;
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 08094ce..96b63ee 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -4243,7 +4243,7 @@ void LEX::set_arena_for_set_stmt(Query_arena *backup)
   MEM_ROOT *mem_root= new MEM_ROOT();
   if (!(mem_root))
     DBUG_VOID_RETURN;
-  init_sql_alloc(mem_root, ALLOC_ROOT_MIN_BLOCK_SIZE, 0,
+  init_sql_alloc(mem_root, ALLOC_ROOT_SET, ALLOC_ROOT_SET,
                  MYF(MY_THREAD_SPECIFIC));
   if (!(arena_for_set_stmt= new Query_arena(mem_root,
                                             Query_arena::STMT_INITIALIZED)))
@@ -4276,9 +4276,10 @@ void LEX::free_arena_for_set_stmt()
                       (ulong) arena_for_set_stmt->mem_root,
                       (ulong) arena_for_set_stmt));
   arena_for_set_stmt->free_items();
-  free_root(arena_for_set_stmt->mem_root, MYF(0));
-  delete(arena_for_set_stmt->mem_root);
+  MEM_ROOT *memroot= arena_for_set_stmt->mem_root;
   delete(arena_for_set_stmt);
+  free_root(arena_for_set_stmt->mem_root, MYF(MY_KEEP_PREALLOC));
+  delete(arena_for_set_stmt->mem_root);
   arena_for_set_stmt= 0;
   DBUG_VOID_RETURN;
 }
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 224e7d0..531056c 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -48,6 +48,8 @@
 class File_parser;
 class Key_part_spec;
 
+#define ALLOC_ROOT_SET 1024
+
 #ifdef MYSQL_SERVER
 /*
   There are 8 different type of table access so there is no more than


More information about the commits mailing list