diff options
author | sergefp@mysql.com <> | 2005-08-10 21:17:02 +0000 |
---|---|---|
committer | sergefp@mysql.com <> | 2005-08-10 21:17:02 +0000 |
commit | fbab5fc5685076a43f52f55a1633207709ef953c (patch) | |
tree | 5dab1a0ca73f1e4942bf33d79a0b027bc008ab28 /sql/sp_cache.cc | |
parent | b7474403d64ac63b5d677f604a0c0deae6e4e24d (diff) | |
download | mariadb-git-fbab5fc5685076a43f52f55a1633207709ef953c.tar.gz |
BUG#12228: Post review fixes: Added test case, code cleanup.
Diffstat (limited to 'sql/sp_cache.cc')
-rw-r--r-- | sql/sp_cache.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc index 1763432f2bc..68e8dbb3252 100644 --- a/sql/sp_cache.cc +++ b/sql/sp_cache.cc @@ -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) |