1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-3536 Collation

This commit is contained in:
David Hall
2020-05-28 14:19:17 -05:00
parent 06e50e0926
commit 2e66b1f1e8
11 changed files with 258 additions and 250 deletions

View File

@ -301,16 +301,11 @@ int StringCompare::operator()(IdbCompare* l, Row::Pointer r1, Row::Pointer r2)
int len2 = l->row2().getStringLength(fSpec.fIndex);
const char* s1 = (const char*)l->row1().getStringPointer(fSpec.fIndex);
const char* s2 = (const char*)l->row2().getStringPointer(fSpec.fIndex);
// For Japanese, coll.compare() may not be as correct as strncmp
// if (JPcodePoint)
{
// ret = fSpec.fAsc * strncmp(s1, s2, max(len1,len2));
}
// else
{
const std::collate<char>& coll = std::use_facet<std::collate<char> >(loc);
ret = fSpec.fAsc * coll.compare(s1, s1+len1, s2, s2+len2);
}
if (!cs)
cs = l->rowGroup()->getCharset(fSpec.fIndex);
ret = fSpec.fAsc * cs->strnncollsp(s1, len1, s2, len2);
}
return ret;