You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-3536 trim shouldn't look for MY_CS_BINSORT
This commit is contained in:
@ -76,12 +76,10 @@ std::string Func_rtrim::getStrVal(rowgroup::Row& row,
|
|||||||
if (strTLen == 0 || strTLen > strLen)
|
if (strTLen == 0 || strTLen > strLen)
|
||||||
return src;
|
return src;
|
||||||
|
|
||||||
bool binaryCmp = (cs->state & MY_CS_BINSORT) || !cs->use_mb();
|
|
||||||
|
|
||||||
if (binTLen == 1)
|
if (binTLen == 1)
|
||||||
{
|
{
|
||||||
const char* ptr = pos;
|
const char* ptr = pos;
|
||||||
if (!binaryCmp) // This is a multi-byte charset
|
if (cs->use_mb()) // This is a multi-byte charset
|
||||||
{
|
{
|
||||||
const char* p = pos;
|
const char* p = pos;
|
||||||
uint32 l;
|
uint32 l;
|
||||||
@ -112,7 +110,7 @@ std::string Func_rtrim::getStrVal(rowgroup::Row& row,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// An uncommon case where the space character is > 1 byte
|
// An uncommon case where the space character is > 1 byte
|
||||||
if (binaryCmp) // This is a multi-byte charset
|
if (cs->use_mb()) // This is a multi-byte charset
|
||||||
{
|
{
|
||||||
// The problem is that the byte pattern at the end could
|
// The problem is that the byte pattern at the end could
|
||||||
// match memcmp, but not be correct since the first byte compared
|
// match memcmp, but not be correct since the first byte compared
|
||||||
|
@ -75,8 +75,6 @@ std::string Func_trim::getStrVal(rowgroup::Row& row,
|
|||||||
if (strTLen == 0 || strTLen > strLen)
|
if (strTLen == 0 || strTLen > strLen)
|
||||||
return src;
|
return src;
|
||||||
|
|
||||||
bool binaryCmp = (cs->state & MY_CS_BINSORT) || !cs->use_mb();
|
|
||||||
|
|
||||||
if (binTLen == 1)
|
if (binTLen == 1)
|
||||||
{
|
{
|
||||||
// If the trim string is 1 byte, don't waste cpu for memcmp
|
// If the trim string is 1 byte, don't waste cpu for memcmp
|
||||||
@ -88,7 +86,7 @@ std::string Func_trim::getStrVal(rowgroup::Row& row,
|
|||||||
}
|
}
|
||||||
// Trim trailing
|
// Trim trailing
|
||||||
const char* ptr = pos;
|
const char* ptr = pos;
|
||||||
if (!binaryCmp) // This is a multi-byte charset
|
if (cs->use_mb()) // This is a multi-byte charset
|
||||||
{
|
{
|
||||||
const char* p = pos;
|
const char* p = pos;
|
||||||
uint32 l;
|
uint32 l;
|
||||||
@ -126,7 +124,7 @@ std::string Func_trim::getStrVal(rowgroup::Row& row,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Trim trailing
|
// Trim trailing
|
||||||
if (!binaryCmp) // This is a multi-byte charset
|
if (cs->use_mb()) // This is a multi-byte charset
|
||||||
{
|
{
|
||||||
// The problem is that the byte pattern at the end could
|
// The problem is that the byte pattern at the end could
|
||||||
// match memcmp, but not be correct since the first byte compared
|
// match memcmp, but not be correct since the first byte compared
|
||||||
|
Reference in New Issue
Block a user