summaryrefslogtreecommitdiff
path: root/sql/sql_type.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_type.h')
-rw-r--r--sql/sql_type.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/sql/sql_type.h b/sql/sql_type.h
index dcdf6438fd9..07dabb9ecb4 100644
--- a/sql/sql_type.h
+++ b/sql/sql_type.h
@@ -124,6 +124,32 @@ enum scalar_comparison_op
};
+class Hasher
+{
+ ulong m_nr1;
+ ulong m_nr2;
+public:
+ Hasher(): m_nr1(1), m_nr2(4)
+ { }
+ void add_null()
+ {
+ m_nr1^= (m_nr1 << 1) | 1;
+ }
+ void add(CHARSET_INFO *cs, const uchar *str, size_t length)
+ {
+ cs->coll->hash_sort(cs, str, length, &m_nr1, &m_nr2);
+ }
+ void add(CHARSET_INFO *cs, const char *str, size_t length)
+ {
+ add(cs, (const uchar *) str, length);
+ }
+ uint32 finalize() const
+ {
+ return (uint32) m_nr1;
+ }
+};
+
+
enum partition_value_print_mode_t
{
PARTITION_VALUE_PRINT_MODE_SHOW= 0,