You've already forked mariadb-columnstore-engine
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:
@ -3576,7 +3576,8 @@ ReturnedColumn* buildFunctionColumn(
|
||||
Item_func* ifp,
|
||||
gp_walk_info& gwi,
|
||||
bool& nonSupport,
|
||||
bool pushdownHand)
|
||||
bool pushdownHand,
|
||||
bool selectBetweenIn)
|
||||
{
|
||||
if (get_fe_conn_info_ptr() == NULL)
|
||||
set_fe_conn_info_ptr((void*)new cal_connection_info());
|
||||
@ -3643,9 +3644,9 @@ ReturnedColumn* buildFunctionColumn(
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ifp->arguments()[0]->type() == Item::FIELD_ITEM ||
|
||||
if (!selectBetweenIn && (ifp->arguments()[0]->type() == Item::FIELD_ITEM ||
|
||||
(ifp->arguments()[0]->type() == Item::REF_ITEM &&
|
||||
(*(((Item_ref*)ifp->arguments()[0])->ref))->type() == Item::FIELD_ITEM))
|
||||
(*(((Item_ref*)ifp->arguments()[0])->ref))->type() == Item::FIELD_ITEM)))
|
||||
{
|
||||
bool fe = false;
|
||||
|
||||
@ -6642,7 +6643,18 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
|
||||
return ER_CHECK_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
ReturnedColumn* rc = buildFunctionColumn(ifp, gwi, hasNonSupportItem);
|
||||
// if "IN" or "BETWEEN" are in the SELECT clause, build function column
|
||||
string funcName = ifp->func_name();
|
||||
ReturnedColumn* rc;
|
||||
if (funcName == "in" || funcName == " IN " || funcName == "between")
|
||||
{
|
||||
rc = buildFunctionColumn(ifp, gwi, hasNonSupportItem, false, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
rc = buildFunctionColumn(ifp, gwi, hasNonSupportItem);
|
||||
}
|
||||
|
||||
SRCP srcp(rc);
|
||||
|
||||
if (rc)
|
||||
|
Reference in New Issue
Block a user