Commit 16bc24da authored by unknown's avatar unknown

Cleanups:

- unused variable THD::con_root removed
- we don't need to bzero(&warn_root) just before init_alloc_root(&warn_root)
- we don't need to bzero(&transaction.mem_root) because we 
  bzero(&transaction) later in THD::THD
- we don't need to free thd->mem_root thd->transaction.mem_root
  in handle_one_connection because they are freed in THD::~THD
  which is called in end_thread later 



sql/sql_class.cc:
  Cleanups:
  - unused variable THD::con_root removed
  - we don't need to bzero(&warn_root) just before init_alloc_root(&warn_root)
  - we don't need to bzero(&transaction.mem_root) because we 
    bzero(&transaction) later in THD::THD
sql/sql_class.h:
  Unused variable THD::con_root removed
sql/sql_parse.cc:
  we don't need to free thd->mem_root and thd->transaction.mem_root
  because they are freed in THD::~THD
parent 62a11790
...@@ -151,9 +151,6 @@ THD::THD():user_time(0), is_fatal_error(0), ...@@ -151,9 +151,6 @@ THD::THD():user_time(0), is_fatal_error(0),
init(); init();
/* Initialize sub structures */ /* Initialize sub structures */
bzero((char*) &mem_root,sizeof(mem_root)); bzero((char*) &mem_root,sizeof(mem_root));
bzero((char*) &transaction.mem_root,sizeof(transaction.mem_root));
bzero((char*) &con_root,sizeof(con_root));
bzero((char*) &warn_root,sizeof(warn_root));
init_alloc_root(&warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE); init_alloc_root(&warn_root, WARN_ALLOC_BLOCK_SIZE, WARN_ALLOC_PREALLOC_SIZE);
user_connect=(USER_CONN *)0; user_connect=(USER_CONN *)0;
hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0, hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
...@@ -355,7 +352,6 @@ THD::~THD() ...@@ -355,7 +352,6 @@ THD::~THD()
safeFree(db); safeFree(db);
safeFree(ip); safeFree(ip);
free_root(&mem_root,MYF(0)); free_root(&mem_root,MYF(0));
free_root(&con_root,MYF(0));
free_root(&warn_root,MYF(0)); free_root(&warn_root,MYF(0));
free_root(&transaction.mem_root,MYF(0)); free_root(&transaction.mem_root,MYF(0));
mysys_var=0; // Safety (shouldn't be needed) mysys_var=0; // Safety (shouldn't be needed)
......
...@@ -452,7 +452,6 @@ class THD :public ilink ...@@ -452,7 +452,6 @@ class THD :public ilink
LEX main_lex; LEX main_lex;
LEX *lex; // parse tree descriptor LEX *lex; // parse tree descriptor
MEM_ROOT mem_root; // 1 command-life memory pool MEM_ROOT mem_root; // 1 command-life memory pool
MEM_ROOT con_root; // connection-life memory
MEM_ROOT warn_root; // For warnings and errors MEM_ROOT warn_root; // For warnings and errors
Protocol *protocol; // Current protocol Protocol *protocol; // Current protocol
Protocol_simple protocol_simple; // Normal protocol Protocol_simple protocol_simple; // Normal protocol
......
...@@ -957,7 +957,6 @@ pthread_handler_decl(handle_one_connection,arg) ...@@ -957,7 +957,6 @@ pthread_handler_decl(handle_one_connection,arg)
} }
if (thd->user_connect) if (thd->user_connect)
decrease_user_connections(thd->user_connect); decrease_user_connections(thd->user_connect);
free_root(&thd->mem_root,MYF(0));
if (net->error && net->vio != 0 && net->report_error) if (net->error && net->vio != 0 && net->report_error)
{ {
if (!thd->killed && thd->variables.log_warnings) if (!thd->killed && thd->variables.log_warnings)
...@@ -1537,8 +1536,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, ...@@ -1537,8 +1536,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
#endif #endif
close_connection(thd, 0, 1); close_connection(thd, 0, 1);
close_thread_tables(thd); // Free before kill close_thread_tables(thd); // Free before kill
free_root(&thd->mem_root,MYF(0));
free_root(&thd->transaction.mem_root,MYF(0));
kill_mysql(); kill_mysql();
error=TRUE; error=TRUE;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment