diff options
author | pem@mysql.comhem.se <> | 2003-10-21 18:13:14 +0200 |
---|---|---|
committer | pem@mysql.comhem.se <> | 2003-10-21 18:13:14 +0200 |
commit | 70ea50366231ac471a894ab4e91f2322cdacb796 (patch) | |
tree | a3a87b6322217cf5bb7b269594bbf65f2bff8b8b /sql/sp_cache.h | |
parent | e42a724fa74a199c791e5d0d30ae208c94746d5a (diff) | |
download | mariadb-git-70ea50366231ac471a894ab4e91f2322cdacb796.tar.gz |
Bugfix of previous WL#1265 commit.
Need a sp_cache_remove() function with implicit name lookup to make the WL task
to work. It's a cleaner and more convenient interface anyway...
Diffstat (limited to 'sql/sp_cache.h')
-rw-r--r-- | sql/sp_cache.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sql/sp_cache.h b/sql/sp_cache.h index f5b330f6755..3d38d6f1d1f 100644 --- a/sql/sp_cache.h +++ b/sql/sp_cache.h @@ -38,7 +38,7 @@ void sp_cache_insert(sp_cache **cp, sp_head *sp); sp_head *sp_cache_lookup(sp_cache **cp, char *name, uint namelen); /* Remove an SP from cache */ -void sp_cache_remove(sp_cache **cp, sp_head *sp); +sp_head *sp_cache_remove(sp_cache **cp, char *name, uint namelen); /* @@ -75,10 +75,14 @@ public: return (sp_head *)hash_search(&m_hashtable, (const byte *)name, namelen); } - inline void - remove(sp_head *sp) + inline sp_head * + remove(char *name, uint namelen) { - hash_delete(&m_hashtable, (byte *)sp); + sp_head *sp= lookup(name, namelen); + + if (sp) + hash_delete(&m_hashtable, (byte *)sp); + return sp; } inline void |