1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +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

@ -27,6 +27,7 @@
#include "calpontsystemcatalog.h"
#include "brm.h"
#include "brmtypes.h"
#include "dataconvert.h"
#define IS_VERBOSE (fDebug >= 4)
#define IS_DETAIL (fDebug >= 3)
@ -653,7 +654,14 @@ bool LBIDList::CasualPartitionPredicate(const int64_t Min,
if (bIsChar && 1 < ct.colWidth)
{
scan = compareVal(order_swap(Min), order_swap(Max), order_swap(value),
// MCOL-1246 Trim trailing whitespace for matching so that we have
// the same as InnoDB behaviour
int64_t tMin = Min;
int64_t tMax = Max;
dataconvert::DataConvert::trimWhitespace(tMin);
dataconvert::DataConvert::trimWhitespace(tMax);
scan = compareVal(order_swap(tMin), order_swap(tMax), order_swap(value),
op, lcf);
// cout << "scan=" << (uint32_t) scan << endl;
}