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

MCOL-1246 Fix string matching for whitespace

For equality string matches other engines ignore trailing whitespace
(this does not apply to LIKE matches). So we should do the same. This
patch trims whitespace for MIN/MAX extent elimination checks, fixed
width columns and dictionary columns during equality matches against
constants (SELECT * FROM t1 WHERE b = 'ABC').
This commit is contained in:
Andrew Hutchings
2018-03-07 16:56:42 +00:00
parent 55e0ab2386
commit 17e954db7d
4 changed files with 34 additions and 2 deletions

View File

@@ -21,6 +21,7 @@
#include <iostream>
#include <boost/scoped_array.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <sys/types.h>
using namespace std;
@@ -164,7 +165,10 @@ void PrimitiveProcessor::p_TokenByScan(const TokenByScanRequestHeader *h,
string arg_utf8;
if (eqFilter) {
bool gotIt = eqFilter->find(string(sig, siglen)) != eqFilter->end();
// MCOL-1246 Trim whitespace before match
string strData(sig, siglen);
boost::trim_right(strData);
bool gotIt = eqFilter->find(strData) != eqFilter->end();
if ((h->COP1 == COMPARE_EQ && gotIt) || (h->COP1 == COMPARE_NE &&
!gotIt))
goto store;