1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-1246 Make matching SQL-92 compliant(ish)

SQL-92 basically specifies for a NOPAD collation that only space should
be ignored for matches. Tabs and other whitespace are handled
differently. We don't fully support collations yet so we assume the
defaults.
This commit is contained in:
Andrew Hutchings
2018-03-09 13:08:09 +00:00
parent 905ce2ce8b
commit fa3574b6b1
2 changed files with 3 additions and 3 deletions

View File

@@ -167,7 +167,7 @@ void PrimitiveProcessor::p_TokenByScan(const TokenByScanRequestHeader *h,
if (eqFilter) {
// MCOL-1246 Trim whitespace before match
string strData(sig, siglen);
boost::trim_right(strData);
boost::trim_right_if(strData, boost::is_any_if(" "));
bool gotIt = eqFilter->find(strData) != eqFilter->end();
if ((h->COP1 == COMPARE_EQ && gotIt) || (h->COP1 == COMPARE_NE &&
!gotIt))
@@ -775,7 +775,7 @@ void PrimitiveProcessor::p_Dictionary(const DictInput *in, vector<uint8_t> *out,
if (eqFilter) {
// MCOL-1246 Trim whitespace before match
string strData((char*)sigptr.data, sigptr.len);
boost::trim_right(strData);
boost::trim_right_if(strData, boost::is_any_of(" "));
bool gotIt = eqFilter->find(strData) != eqFilter->end();
if ((gotIt && eqOp == COMPARE_EQ) || (!gotIt && eqOp == COMPARE_NE))
goto store;

View File

@@ -559,7 +559,7 @@ inline void DataConvert::trimWhitespace(int64_t &charData)
char *ch_data = (char*) &charData;
for (int8_t i = 7; i > 0; i--)
{
if (isspace(ch_data[i]) || ch_data[i] == '\0')
if (ch_data[i] == ' ' || ch_data[i] == '\0')
ch_data[i] = '\0';
else
break;