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

MCOL-3536 collation

This commit is contained in:
David Hall
2020-05-14 16:02:49 -05:00
parent 04fdacb927
commit 1f3d1e6fd6
41 changed files with 667 additions and 797 deletions

View File

@ -19,12 +19,18 @@
// $Id: idborderby.cpp 3932 2013-06-25 16:08:10Z xlou $
#include <mariadb.h>
#include <m_ctype.h>
#include <iostream>
#include <cassert>
#include <string>
#include <stack>
using namespace std;
#include "objectreader.h"
#include "calpontselectexecutionplan.h"
#include "rowgroup.h"
#include <boost/shared_array.hpp>
using namespace boost;
@ -45,6 +51,8 @@ using namespace rowgroup;
#include "joblisttypes.h"
// See agg_arg_charsets in sql_type.h to see conversion rules for
// items that have different char sets
namespace ordering
{
int TinyIntCompare::operator()(IdbCompare* l, Row::Pointer r1, Row::Pointer r2)
@ -294,11 +302,11 @@ int StringCompare::operator()(IdbCompare* l, Row::Pointer r1, Row::Pointer r2)
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)
// if (JPcodePoint)
{
ret = fSpec.fAsc * strncmp(s1, s2, max(len1,len2));
// ret = fSpec.fAsc * strncmp(s1, s2, max(len1,len2));
}
else
// else
{
const std::collate<char>& coll = std::use_facet<std::collate<char> >(loc);
ret = fSpec.fAsc * coll.compare(s1, s1+len1, s2, s2+len2);