1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Part#1 MCOL-495 Make string comparison not case sensitive

Fixing field='str' for long (Dict) string data types.
This commit is contained in:
Alexander Barkov
2020-12-01 10:48:59 +04:00
parent a53f93df43
commit 0ff6a6ec20
7 changed files with 96 additions and 14 deletions

View File

@ -186,11 +186,11 @@ void PrimitiveProcessor::p_TokenByScan(const TokenByScanRequestHeader* h,
if (eqFilter)
{
// MCOL-1246 Trim whitespace before match
// TODO MCOL-3536 use CHARSET_INFO* cs for collation
// cs->hash_sort(hash_sort(const uchar *key, size_t len, ulong *nr1, ulong *nr2))
if (cs != & eqFilter->getCharset())
{
//throw runtime_error("Collations mismatch: TokenByScanRequestHeader and DicEqualityFilter");
}
string strData(sig, siglen);
boost::trim_right_if(strData, boost::is_any_of(" "));
bool gotIt = eqFilter->find(strData) != eqFilter->end();
if ((h->COP1 == COMPARE_EQ && gotIt) || (h->COP1 == COMPARE_NE &&

View File

@ -102,7 +102,28 @@ public:
typedef std::tr1::unordered_set<int64_t, pcfHasher, pcfEqual> prestored_set_t;
typedef std::tr1::unordered_set<int128_t, pcfHasher128, pcfEqual128> prestored_set_t_128;
typedef std::tr1::unordered_set<std::string, utils::Hasher> DictEqualityFilter;
class DictEqualityFilter: public std::tr1::unordered_set<std::string,
datatypes::CollationAwareHasher,
datatypes::CollationAwareComparator>
{
public:
DictEqualityFilter(const datatypes::Charset &cs)
:std::tr1::unordered_set<std::string,
datatypes::CollationAwareHasher,
datatypes::CollationAwareComparator>
(10,
datatypes::CollationAwareHasher(cs),
datatypes::CollationAwareComparator(cs))
{ }
CHARSET_INFO & getCharset() const
{
idbassert(& _M_h1.getCharset() == & _M_eq.getCharset());
return _M_h1.getCharset();
}
};
struct idb_regex_t
{