1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

merge with mysql-5.5.21

This commit is contained in:
Sergei Golubchik
2012-03-09 08:06:59 +01:00
127 changed files with 3500 additions and 1546 deletions

View File

@ -57,6 +57,20 @@ public:
{
my_hash_delete(&m_hashtable, (uchar *)sp);
}
/**
Remove all elements from a stored routine cache if the current
number of elements exceeds the argument value.
@param[in] upper_limit_for_elements Soft upper limit of elements that
can be stored in the cache.
*/
void enforce_limit(ulong upper_limit_for_elements)
{
if (m_hashtable.records > upper_limit_for_elements)
my_hash_reset(&m_hashtable);
}
private:
void init();
void cleanup();
@ -234,6 +248,21 @@ ulong sp_cache_version()
}
/**
Enforce that the current number of elements in the cache don't exceed
the argument value by flushing the cache if necessary.
@param[in] c Cache to check
@param[in] upper_limit_for_elements Soft upper limit for number of sp_head
objects that can be stored in the cache.
*/
void
sp_cache_enforce_limit(sp_cache *c, ulong upper_limit_for_elements)
{
if (c)
c->enforce_limit(upper_limit_for_elements);
}
/*************************************************************************
Internal functions
*************************************************************************/