summaryrefslogtreecommitdiff
path: root/sql/sql_hset.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_hset.h')
-rw-r--r--sql/sql_hset.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/sql/sql_hset.h b/sql/sql_hset.h
index b3d8165f6f6..41573fb5f03 100644
--- a/sql/sql_hset.h
+++ b/sql/sql_hset.h
@@ -15,6 +15,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
+#include "my_global.h"
#include "hash.h"
@@ -28,17 +29,15 @@ class Hash_set
public:
enum { START_SIZE= 8 };
/**
- Constructs an empty hash. Does not allocate memory, it is done upon
- the first insert. Thus does not cause or return errors.
+ Constructs an empty unique hash.
*/
Hash_set(PSI_memory_key psi_key, uchar *(*K)(const T *, size_t *, my_bool),
CHARSET_INFO *cs= &my_charset_bin)
{
- my_hash_clear(&m_hash);
- m_hash.get_key= (my_hash_get_key)K;
- m_hash.charset= cs;
- m_hash.array.m_psi_key= psi_key;
+ my_hash_init(psi_key, &m_hash, cs, START_SIZE, 0, 0, (my_hash_get_key)K, 0,
+ HASH_UNIQUE);
}
+
Hash_set(PSI_memory_key psi_key, CHARSET_INFO *charset, ulong default_array_elements,
size_t key_offset, size_t key_length, my_hash_get_key get_key,
void (*free_element)(void*), uint flags)
@@ -65,8 +64,6 @@ public:
*/
bool insert(T *value)
{
- my_hash_init_opt(m_hash.array.m_psi_key, &m_hash, m_hash.charset,
- START_SIZE, 0, 0, m_hash.get_key, 0, HASH_UNIQUE);
return my_hash_insert(&m_hash, reinterpret_cast<const uchar*>(value));
}
bool remove(T *value)