1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-07 03:22:57 +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

@@ -39,6 +39,7 @@ using namespace boost;
#include "we_type.h"
#include "stats.h"
#include "primproc.h"
#include "dataconvert.h"
using namespace logging;
using namespace dbbc;
using namespace primitives;
@@ -527,7 +528,13 @@ inline bool colCompare(int64_t val1, int64_t val2, uint8_t COP, uint8_t rf, int
type == CalpontSystemCatalog::TEXT) && !isNull )
{
if (!regex.used && !rf)
{
// MCOL-1246 Trim trailing whitespace for matching, but not for
// regex
dataconvert::DataConvert::trimWhitespace(val1);
dataconvert::DataConvert::trimWhitespace(val2);
return colCompare_(order_swap(val1), order_swap(val2), COP);
}
else
return colStrCompare_(order_swap(val1), order_swap(val2), COP, rf, &regex);
}