1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-13 23:02:14 +03:00

MCOL-656 Fix LIKE on non-dict CHAR/VARCHAR

The LIKE part of the query for non-dict CHAR/VARCHAR was converted to an
INT based on the length of the column. So on a 2 byte CHAR a LIKE of
'%05%' was truncated to '%0' which is a very different query. We should
not cast this to INT because we could use a LIKE of > 8 bytes on a
non-dict column. This patch turns LIKE into an expressionStep which
cater for longer strings rather than a simpleFilter.
This commit is contained in:
Andrew Hutchings
2017-05-09 10:23:20 +01:00
parent ad1c6e49f0
commit 122dbdcbb1

View File

@@ -1663,10 +1663,7 @@ const JobStepVector doSimpleFilter(SimpleFilter* sf, JobInfo& jobInfo)
jsv.push_back(sjstep);
}
}
else if ( CalpontSystemCatalog::CHAR != ct.colDataType &&
CalpontSystemCatalog::VARCHAR != ct.colDataType &&
CalpontSystemCatalog::VARBINARY != ct.colDataType &&
ConstantColumn::NULLDATA != cc->type() &&
else if ( ConstantColumn::NULLDATA != cc->type() &&
(cop & COMPARE_LIKE) ) // both like and not like
{
return doExpressionFilter(sf, jobInfo);