diff options
author | unknown <pem@mysql.com> | 2003-07-03 16:01:31 +0200 |
---|---|---|
committer | unknown <pem@mysql.com> | 2003-07-03 16:01:31 +0200 |
commit | d17a3ae1f41b00f15a06ccd6773fd602c4116932 (patch) | |
tree | d8637655d61d4c0ad82c997ffb843ea87eab7040 /sql/sp_cache.cc | |
parent | f1c754efe9b78fb8497042ebdb1b2245df392381 (diff) | |
download | mariadb-git-d17a3ae1f41b00f15a06ccd6773fd602c4116932.tar.gz |
Add the new sp cache files too (should have been in previous changeset).
Diffstat (limited to 'sql/sp_cache.cc')
-rw-r--r-- | sql/sp_cache.cc | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sql/sp_cache.cc b/sql/sp_cache.cc new file mode 100644 index 00000000000..1b8816ee0f4 --- /dev/null +++ b/sql/sp_cache.cc @@ -0,0 +1,53 @@ +/* Copyright (C) 2002 MySQL AB + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#ifdef __GNUC__ +#pragma implementation +#endif + +#include "mysql_priv.h" +#include "sp_cache.h" +#include "sp_head.h" + +static byte * +hash_get_key_for_sp_head(const byte *ptr, uint *plen, + my_bool first) +{ + return ((sp_head*)ptr)->name(plen); +} + +sp_cache::sp_cache() +{ + init(); +} + +sp_cache::~sp_cache() +{ + hash_free(&m_hashtable); +} + +void +sp_cache::init() +{ + hash_init(&m_hashtable, system_charset_info, 0, 0, 0, + hash_get_key_for_sp_head, 0, 0); +} + +void +sp_cache::cleanup() +{ + hash_free(&m_hashtable); +} |