1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

BUG#12228: Post review fixes: Added test case, code cleanup.

This commit is contained in:
sergefp@mysql.com
2005-08-10 21:17:02 +00:00
parent b7474403d6
commit fbab5fc568
6 changed files with 79 additions and 14 deletions

View File

@ -122,19 +122,15 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp)
{
sp_cache *c= *cp;
if (! c)
if (!c && (c= new sp_cache()))
{
ulong v;
c= new sp_cache();
pthread_mutex_lock(&Cversion_lock); // LOCK
v= Cversion;
c->version= Cversion;
pthread_mutex_unlock(&Cversion_lock); // UNLOCK
if (c)
c->version= v;
}
if (c)
{
DBUG_PRINT("info",("sp_cache: inserting: %*s", sp->m_qname.length,
DBUG_PRINT("info",("sp_cache: inserting: %*s", sp->m_qname.length,
sp->m_qname.str));
c->insert(sp);
if (*cp == NULL)