The world's most popular open source database
#include "mysql_priv.h"#include "sp_cache.h"#include "sp_head.h"Include dependency graph for sp_cache.cc:

Go to the source code of this file.
Classes | |
| class | sp_cache |
Functions | |
| void | sp_cache_init () |
| void | sp_cache_clear (sp_cache **cp) |
| void | sp_cache_insert (sp_cache **cp, sp_head *sp) |
| sp_head * | sp_cache_lookup (sp_cache **cp, sp_name *name) |
| void | sp_cache_invalidate () |
| void | sp_cache_flush_obsolete (sp_cache **cp) |
| static byte * | hash_get_key_for_sp_head (const byte *ptr, uint *plen, my_bool first) |
| static void | hash_free_sp_head (void *p) |
Variables | |
| static pthread_mutex_t | Cversion_lock |
| static ulong volatile | Cversion = 0 |
| static void hash_free_sp_head | ( | void * | p | ) | [static] |
Definition at line 228 of file sp_cache.cc.
Referenced by sp_cache::init().
Here is the caller graph for this function:

Definition at line 218 of file sp_cache.cc.
References LEX_STRING::length, sp_head::m_qname, and LEX_STRING::str.
Referenced by sp_cache::init().
00220 { 00221 sp_head *sp= (sp_head *)ptr; 00222 *plen= sp->m_qname.length; 00223 return (byte*) sp->m_qname.str; 00224 }
Here is the caller graph for this function:

| void sp_cache_clear | ( | sp_cache ** | cp | ) |
Definition at line 98 of file sp_cache.cc.
References NULL.
00099 { 00100 sp_cache *c= *cp; 00101 00102 if (c) 00103 { 00104 delete c; 00105 *cp= NULL; 00106 } 00107 }
| void sp_cache_flush_obsolete | ( | sp_cache ** | cp | ) |
Definition at line 196 of file sp_cache.cc.
References Cversion, DBUG_PRINT, sp_cache::remove_all(), and sp_cache::version.
Referenced by mysql_parse(), mysql_stmt_execute(), and mysql_stmt_prepare().
00197 { 00198 sp_cache *c= *cp; 00199 if (c) 00200 { 00201 ulong v; 00202 v= Cversion; // No need to lock when reading long variable 00203 if (c->version < v) 00204 { 00205 DBUG_PRINT("info",("sp_cache: deleting all functions")); 00206 /* We need to delete all elements. */ 00207 c->remove_all(); 00208 c->version= v; 00209 } 00210 } 00211 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sp_cache_init | ( | ) |
Definition at line 81 of file sp_cache.cc.
References Cversion_lock, MY_MUTEX_INIT_FAST, and pthread_mutex_init.
Referenced by init_thread_environment().
00082 { 00083 pthread_mutex_init(&Cversion_lock, MY_MUTEX_INIT_FAST); 00084 }
Here is the caller graph for this function:

Definition at line 124 of file sp_cache.cc.
References Cversion, DBUG_PRINT, sp_cache::insert(), LEX_STRING::length, sp_head::m_qname, LEX_STRING::str, and sp_cache::version.
Referenced by sp_cache_routines_and_add_tables_aux(), and sp_find_routine().
00125 { 00126 sp_cache *c; 00127 00128 if (!(c= *cp)) 00129 { 00130 if (!(c= new sp_cache())) 00131 return; // End of memory error 00132 c->version= Cversion; // No need to lock when reading long variable 00133 } 00134 DBUG_PRINT("info",("sp_cache: inserting: %.*s", sp->m_qname.length, 00135 sp->m_qname.str)); 00136 c->insert(sp); 00137 *cp= c; // Update *cp if it was NULL 00138 }
Here is the call graph for this function:

Here is the caller graph for this function:

| void sp_cache_invalidate | ( | ) |
Definition at line 177 of file sp_cache.cc.
References Cversion, Cversion_lock, DBUG_PRINT, and thread_safe_increment.
Referenced by mysql_create_view(), mysql_drop_view(), mysql_rename_view(), sp_drop_db_routines(), sp_drop_function(), sp_drop_procedure(), sp_update_function(), and sp_update_procedure().
00178 { 00179 DBUG_PRINT("info",("sp_cache: invalidating")); 00180 thread_safe_increment(Cversion, &Cversion_lock); 00181 }
Here is the caller graph for this function:

Definition at line 157 of file sp_cache.cc.
References sp_cache::lookup(), name, and NULL.
Referenced by sp_cache_routines_and_add_tables_aux(), and sp_find_routine().
00158 { 00159 sp_cache *c= *cp; 00160 if (! c) 00161 return NULL; 00162 return c->lookup(name->m_qname.str, name->m_qname.length); 00163 }
Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 25 of file sp_cache.cc.
Referenced by sp_cache_flush_obsolete(), sp_cache_insert(), and sp_cache_invalidate().
pthread_mutex_t Cversion_lock [static] |
Definition at line 24 of file sp_cache.cc.
Referenced by sp_cache_init(), and sp_cache_invalidate().
1.4.7

