diff options
author | unknown <pem@mysql.comhem.se> | 2003-10-21 12:08:35 +0200 |
---|---|---|
committer | unknown <pem@mysql.comhem.se> | 2003-10-21 12:08:35 +0200 |
commit | 562a04d593ca9a179b851e1d71d30e764e55f7ad (patch) | |
tree | 2a69a7aa7527c9093f6156dee7a663e6404c913f /sql/sql_class.cc | |
parent | 2b1dc5f35d5bf773378a36a14399987635be7127 (diff) | |
download | mariadb-git-562a04d593ca9a179b851e1d71d30e764e55f7ad.tar.gz |
WL#1265: Fix proper ALTER/DROP support in the SP cache.
New sp_cache C API. When an SP is dropped, old caches (in other threads)
become invalid and are cleared.
Also, the caches in THD are only created on demand.
Docs/sp-imp-spec.txt:
Brough the SP cache docs up-to-date.
sql/mysqld.cc:
Initialize SP cache.
sql/sp.cc:
New C API for SP cache.
sql/sp_cache.cc:
New C API for sp_cache.
The class sp_cache is still used, but not directly. The C functions makes takes
care of updating caches when SPs are dropped. (This is done in the simplest
possible way, by simply detecting drops and then clear all old caches.)
The API is also designed so that the sp_cache is created on demand.
sql/sp_cache.h:
New C API for sp_cache.
The class sp_cache is still used, but not directly. The C functions makes takes
care of updating caches when SPs are dropped.
The API is also designed so that the sp_cache is created on demand.
sql/sql_class.cc:
The new sp_cache API creates the caches on demand, to avoid allocating it
when it's not needed.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r-- | sql/sql_class.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 487ae14f4cd..025b1d7429d 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -156,8 +156,8 @@ THD::THD():user_time(0), is_fatal_error(0), (hash_get_key) get_var_key, (hash_free_key) free_user_var, 0); - sp_proc_cache= new sp_cache(); - sp_func_cache= new sp_cache(); + sp_proc_cache= NULL; + sp_func_cache= NULL; /* For user vars replication*/ if (opt_bin_log) @@ -260,8 +260,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); - sp_proc_cache->init(); - sp_func_cache->init(); + sp_cache_clear(&sp_proc_cache); + sp_cache_clear(&sp_func_cache); } @@ -285,8 +285,8 @@ void THD::cleanup(void) close_temporary_tables(this); delete_dynamic(&user_var_events); hash_free(&user_vars); - sp_proc_cache->cleanup(); - sp_func_cache->cleanup(); + sp_cache_clear(&sp_proc_cache); + sp_cache_clear(&sp_func_cache); if (global_read_lock) unlock_global_read_lock(this); if (ull) @@ -328,8 +328,8 @@ THD::~THD() } #endif - delete sp_proc_cache; - delete sp_func_cache; + sp_cache_clear(&sp_proc_cache); + sp_cache_clear(&sp_func_cache); DBUG_PRINT("info", ("freeing host")); if (host != localhost) // If not pointer to constant |