1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-27653 long uniques don't work with unicode collations

This commit is contained in:
Alexander Barkov
2022-10-28 13:43:51 +04:00
parent 9924466b3b
commit 284ac6f2b7
27 changed files with 668 additions and 66 deletions

View File

@ -110,6 +110,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;
}
};
/*
A helper class to store column attributes that are inherited
by columns (from the table level) when not specified explicitly.