You've already forked mariadb-columnstore-engine
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:
@@ -167,7 +167,7 @@ void PrimitiveProcessor::p_TokenByScan(const TokenByScanRequestHeader *h,
|
|||||||
if (eqFilter) {
|
if (eqFilter) {
|
||||||
// MCOL-1246 Trim whitespace before match
|
// MCOL-1246 Trim whitespace before match
|
||||||
string strData(sig, siglen);
|
string strData(sig, siglen);
|
||||||
boost::trim_right(strData);
|
boost::trim_right_if(strData, boost::is_any_if(" "));
|
||||||
bool gotIt = eqFilter->find(strData) != eqFilter->end();
|
bool gotIt = eqFilter->find(strData) != eqFilter->end();
|
||||||
if ((h->COP1 == COMPARE_EQ && gotIt) || (h->COP1 == COMPARE_NE &&
|
if ((h->COP1 == COMPARE_EQ && gotIt) || (h->COP1 == COMPARE_NE &&
|
||||||
!gotIt))
|
!gotIt))
|
||||||
@@ -775,7 +775,7 @@ void PrimitiveProcessor::p_Dictionary(const DictInput *in, vector<uint8_t> *out,
|
|||||||
if (eqFilter) {
|
if (eqFilter) {
|
||||||
// MCOL-1246 Trim whitespace before match
|
// MCOL-1246 Trim whitespace before match
|
||||||
string strData((char*)sigptr.data, sigptr.len);
|
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();
|
bool gotIt = eqFilter->find(strData) != eqFilter->end();
|
||||||
if ((gotIt && eqOp == COMPARE_EQ) || (!gotIt && eqOp == COMPARE_NE))
|
if ((gotIt && eqOp == COMPARE_EQ) || (!gotIt && eqOp == COMPARE_NE))
|
||||||
goto store;
|
goto store;
|
||||||
|
@@ -559,7 +559,7 @@ inline void DataConvert::trimWhitespace(int64_t &charData)
|
|||||||
char *ch_data = (char*) &charData;
|
char *ch_data = (char*) &charData;
|
||||||
for (int8_t i = 7; i > 0; i--)
|
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';
|
ch_data[i] = '\0';
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user