You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
Merge branch 'master' of https://github.com/mariadb-corporation/mariadb-columnstore-engine
This commit is contained in:
@@ -1606,7 +1606,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
|
|||||||
// outer join inner table filter can not be moved in
|
// outer join inner table filter can not be moved in
|
||||||
// MariaDB 10.1: cached_table is never available for derived tables.
|
// MariaDB 10.1: cached_table is never available for derived tables.
|
||||||
// Find the uncached object in table_list
|
// Find the uncached object in table_list
|
||||||
TABLE_LIST* tblList = ifp->context->table_list;
|
TABLE_LIST* tblList = ifp->context ? ifp->context->table_list : NULL;
|
||||||
while (tblList)
|
while (tblList)
|
||||||
{
|
{
|
||||||
if (strcasecmp(tblList->alias, ifp->table_name) == 0)
|
if (strcasecmp(tblList->alias, ifp->table_name) == 0)
|
||||||
|
@@ -95,11 +95,14 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row,
|
|||||||
if (parm[0]->data()->resultType().colDataType ==
|
if (parm[0]->data()->resultType().colDataType ==
|
||||||
execplan::CalpontSystemCatalog::DATETIME)
|
execplan::CalpontSystemCatalog::DATETIME)
|
||||||
{
|
{
|
||||||
// If we're comparing to a datetime field, promote.
|
// NULLIF arg0 is DATETIME, arg1 is DATE,
|
||||||
exp2 = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
// Upgrade arg1 to datetime
|
||||||
|
exp2 = parm[1]->data()->getDatetimeIntVal(row, isNull);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// NULLIF arg0 is not DATETIME (might be date), arg1 is not DATE
|
||||||
|
// Use arg1 as DATE
|
||||||
exp2 = parm[1]->data()->getDateIntVal(row, isNull);
|
exp2 = parm[1]->data()->getDateIntVal(row, isNull);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,6 +120,8 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row,
|
|||||||
if (parm[0]->data()->resultType().colDataType ==
|
if (parm[0]->data()->resultType().colDataType ==
|
||||||
execplan::CalpontSystemCatalog::DATE)
|
execplan::CalpontSystemCatalog::DATE)
|
||||||
{
|
{
|
||||||
|
// NULLIF arg0 is DATE, arg1 is DATETIME,
|
||||||
|
// Upgrade arg1 to datetime
|
||||||
// When comparing exp1 as a Date, we can't simply promote. We have
|
// When comparing exp1 as a Date, we can't simply promote. We have
|
||||||
// to be careful of the return value in case of not null return.
|
// to be careful of the return value in case of not null return.
|
||||||
int64_t exp1 = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
int64_t exp1 = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||||
|
Reference in New Issue
Block a user