1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

1. For BETWEEN/IN functions in the SELECT clause, build a function column

2. CASE function should return false when it evaluates to NULL (e.g. due to absense of ELSE clause)

3. Set the operation type of IN function to varchar if all parameters are char/varchar/text
This commit is contained in:
Gagan Goel
2019-08-18 21:18:15 -04:00
parent 489c09c4dc
commit f5af10a0c4
4 changed files with 20 additions and 26 deletions

View File

@ -315,7 +315,6 @@ CalpontSystemCatalog::ColType Func_in::operationType( FunctionParm& fp, CalpontS
ct = fp[0]->data()->resultType();
bool allString = true;
bool allNonToken = true;
for (uint32_t i = 0; i < fp.size(); i++)
{
@ -328,31 +327,14 @@ CalpontSystemCatalog::ColType Func_in::operationType( FunctionParm& fp, CalpontS
op.setOpType(ct, fp[i]->data()->resultType());
ct = op.operationType();
}
else
{
if ((fp[i]->data()->resultType().colDataType == CalpontSystemCatalog::CHAR &&
fp[i]->data()->resultType().colWidth > 8) ||
(fp[i]->data()->resultType().colDataType == CalpontSystemCatalog::VARCHAR &&
fp[i]->data()->resultType().colWidth >= 8) ||
(fp[i]->data()->resultType().colDataType == CalpontSystemCatalog::TEXT &&
fp[i]->data()->resultType().colWidth >= 8))
allNonToken = false;
}
}
if (allString && !allNonToken)
if (allString)
{
ct.colDataType = CalpontSystemCatalog::VARCHAR;
ct.colWidth = 255;
}
else if (allString && allNonToken)
{
ct.colDataType = CalpontSystemCatalog::BIGINT;
ct.colWidth = 8;
}
// convert date const value according to the compare type here.
if (op.operationType().colDataType == CalpontSystemCatalog::DATE)
{