1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Code cleanup (and moved sp cache to separate file).

This commit is contained in:
pem@mysql.com
2003-07-03 15:58:37 +02:00
parent 1d3c703d58
commit 6d225437ed
7 changed files with 37 additions and 70 deletions

View File

@ -37,8 +37,7 @@
#include <mysys_err.h>
#include <sp_rcontext.h>
byte *hash_get_key_for_sp_head(const byte*,uint*,my_bool);
#include <sp_cache.h>
/*
The following is used to initialise Table_ident with a internal
@ -157,11 +156,9 @@ THD::THD():user_time(0), is_fatal_error(0),
hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(hash_get_key) get_var_key,
(hash_free_key) free_user_var, 0);
hash_init(sp_hash,system_charset_info,0,0,0,
hash_get_key_for_sp_head,0,0);
hash_init(sp_hash+1,system_charset_info,0,0,0,
hash_get_key_for_sp_head,0,0);
sp_proc_cache= new sp_cache();
sp_func_cache= new sp_cache();
/* For user vars replication*/
if (opt_bin_log)
@ -265,10 +262,8 @@ void THD::change_user(void)
hash_init(&user_vars, system_charset_info, USER_VARS_HASH_SIZE, 0, 0,
(hash_get_key) get_var_key,
(hash_free_key) free_user_var, 0);
hash_init(sp_hash,system_charset_info,0,0,0,
hash_get_key_for_sp_head,0,0);
hash_init(sp_hash+1,system_charset_info,0,0,0,
hash_get_key_for_sp_head,0,0);
sp_proc_cache->init();
sp_func_cache->init();
}
@ -292,8 +287,8 @@ void THD::cleanup(void)
close_temporary_tables(this);
delete_dynamic(&user_var_events);
hash_free(&user_vars);
hash_free(sp_hash);
hash_free(sp_hash+1);
sp_proc_cache->cleanup();
sp_func_cache->cleanup();
if (global_read_lock)
unlock_global_read_lock(this);
if (ull)
@ -335,6 +330,9 @@ THD::~THD()
}
#endif
delete sp_proc_cache;
delete sp_func_cache;
DBUG_PRINT("info", ("freeing host"));
if (host != localhost) // If not pointer to constant
safeFree(host);