summaryrefslogtreecommitdiff
path: root/sql/sp_cache.cc
diff options
context:
space:
mode:
authorKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 16:18:01 +0100
committerKristofer Pettersson <kristofer.pettersson@sun.com>2009-11-20 16:18:01 +0100
commit0a686030589dae2fe6bf99f4c3d4a73d4268a491 (patch)
tree2c684f720a7791634409c9607d9ffcd82d0d1b73 /sql/sp_cache.cc
parente942adb23dfca74fa8db76dbe40d72f0ceff4818 (diff)
downloadmariadb-git-0a686030589dae2fe6bf99f4c3d4a73d4268a491.tar.gz
Bug#45613 handle failures from my_hash_insert
Not all my_hash_insert() calls are checked for return value. This patch adds appropriate checks and failure responses where needed. mysys/hash.c: * Debug hook for testing failures in my_hash_insert()
Diffstat (limited to 'sql/sp_cache.cc')
-rw-r--r--sql/sp_cache.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc
index 64898915b7e..b8209a373a2 100644
--- a/sql/sp_cache.cc
+++ b/sql/sp_cache.cc
@@ -36,10 +36,16 @@ public:
sp_cache();
~sp_cache();
- inline void insert(sp_head *sp)
+ /**
+ Inserts a sp_head object into a hash table.
+
+ @returns Success status
+ @return TRUE Failure
+ @return FALSE Success
+ */
+ inline bool insert(sp_head *sp)
{
- /* TODO: why don't we check return value? */
- my_hash_insert(&m_hashtable, (const uchar *)sp);
+ return my_hash_insert(&m_hashtable, (const uchar *)sp);
}
inline sp_head *lookup(char *name, uint namelen)