You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
Merge branch 'develop-1.2' into MCOL-1822-c
This commit is contained in:
@ -77,8 +77,6 @@ void LimitedOrderBy::initialize(const RowGroup& rg, const JobInfo& jobInfo)
|
|||||||
map<uint32_t, uint32_t>::iterator j = keyToIndexMap.find(i->first);
|
map<uint32_t, uint32_t>::iterator j = keyToIndexMap.find(i->first);
|
||||||
idbassert(j != keyToIndexMap.end());
|
idbassert(j != keyToIndexMap.end());
|
||||||
|
|
||||||
// TODO Ordering direction in CSEP differs from
|
|
||||||
// internal direction representation. This behavior should be fixed
|
|
||||||
fOrderByCond.push_back(IdbSortSpec(j->second, i->second));
|
fOrderByCond.push_back(IdbSortSpec(j->second, i->second));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,16 +84,14 @@ void LimitedOrderBy::initialize(const RowGroup& rg, const JobInfo& jobInfo)
|
|||||||
fStart = jobInfo.limitStart;
|
fStart = jobInfo.limitStart;
|
||||||
fCount = jobInfo.limitCount;
|
fCount = jobInfo.limitCount;
|
||||||
|
|
||||||
// fMemSize = (fStart + fCount) * rg.getRowSize();
|
|
||||||
|
|
||||||
IdbOrderBy::initialize(rg);
|
IdbOrderBy::initialize(rg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This must return a proper number of key columns and
|
||||||
|
// not just a column count.
|
||||||
uint64_t LimitedOrderBy::getKeyLength() const
|
uint64_t LimitedOrderBy::getKeyLength() const
|
||||||
{
|
{
|
||||||
//return (fRow0.getSize() - 2);
|
return fOrderByCond.size();
|
||||||
return fRow0.getColumnCount();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1190,7 +1190,7 @@ void check_walk(const Item* item, void* arg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Item::EXPR_CACHE_ITEM: // IN + correlated subquery
|
case Item::EXPR_CACHE_ITEM: // IN + correlated subquery
|
||||||
{
|
{
|
||||||
const Item_cache_wrapper* icw = static_cast<const Item_cache_wrapper*>(item);
|
const Item_cache_wrapper* icw = static_cast<const Item_cache_wrapper*>(item);
|
||||||
if ( icw->get_orig_item()->type() == Item::FUNC_ITEM )
|
if ( icw->get_orig_item()->type() == Item::FUNC_ITEM )
|
||||||
@ -1231,11 +1231,14 @@ void check_walk(const Item* item, void* arg)
|
|||||||
* logical OR in the filter predicates
|
* logical OR in the filter predicates
|
||||||
* Impossible WHERE
|
* Impossible WHERE
|
||||||
* Impossible HAVING
|
* Impossible HAVING
|
||||||
* Valid queries with the last two crashes the server if processed.
|
* and there is either GROUP BY or aggregation function
|
||||||
|
* exists at the top level.
|
||||||
|
* Valid queries with the last two crashes the server if
|
||||||
|
* processed.
|
||||||
* Details are in server/sql/group_by_handler.h
|
* Details are in server/sql/group_by_handler.h
|
||||||
* PARAMETERS:
|
* PARAMETERS:
|
||||||
* thd - THD pointer.
|
* thd - THD pointer
|
||||||
* query - Query structure, that describes the pushdowned query.
|
* query - Query structure LFM in group_by_handler.h
|
||||||
* RETURN:
|
* RETURN:
|
||||||
* group_by_handler if success
|
* group_by_handler if success
|
||||||
* NULL in other case
|
* NULL in other case
|
||||||
@ -1254,29 +1257,48 @@ create_calpont_group_by_handler(THD* thd, Query* query)
|
|||||||
&& ( query->group_by || select_lex->with_sum_func ) )
|
&& ( query->group_by || select_lex->with_sum_func ) )
|
||||||
{
|
{
|
||||||
bool unsupported_feature = false;
|
bool unsupported_feature = false;
|
||||||
// Impossible HAVING or WHERE
|
// revisit SELECT_LEX for all units
|
||||||
if ( ( query->having && select_lex->having_value == Item::COND_FALSE )
|
for(TABLE_LIST* tl = query->from; !unsupported_feature && tl; tl = tl->next_global)
|
||||||
|| ( select_lex->cond_count > 0
|
|
||||||
&& select_lex->cond_value == Item::COND_FALSE ) )
|
|
||||||
{
|
{
|
||||||
unsupported_feature = true;
|
select_lex = tl->select_lex;
|
||||||
}
|
// Correlation subquery. Comming soon so fail on this yet.
|
||||||
|
unsupported_feature = select_lex->is_correlated;
|
||||||
|
|
||||||
// Unsupported conditions check.
|
// Impossible HAVING or WHERE
|
||||||
if ( !unsupported_feature )
|
if ( ( !unsupported_feature && query->having && select_lex->having_value == Item::COND_FALSE )
|
||||||
{
|
|| ( select_lex->cond_count > 0
|
||||||
JOIN *join = select_lex->join;
|
&& select_lex->cond_value == Item::COND_FALSE ) )
|
||||||
Item_cond *icp = 0;
|
|
||||||
|
|
||||||
if (join != 0)
|
|
||||||
icp = reinterpret_cast<Item_cond*>(join->conds);
|
|
||||||
|
|
||||||
if ( unsupported_feature == false
|
|
||||||
&& icp )
|
|
||||||
{
|
{
|
||||||
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX);
|
unsupported_feature = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
// Unsupported JOIN conditions
|
||||||
|
if ( !unsupported_feature )
|
||||||
|
{
|
||||||
|
JOIN *join = select_lex->join;
|
||||||
|
Item_cond *icp = 0;
|
||||||
|
|
||||||
|
if (join != 0)
|
||||||
|
icp = reinterpret_cast<Item_cond*>(join->conds);
|
||||||
|
|
||||||
|
if ( unsupported_feature == false
|
||||||
|
&& icp )
|
||||||
|
{
|
||||||
|
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Optimizer could move some join conditions into where
|
||||||
|
if (select_lex->where != 0)
|
||||||
|
icp = reinterpret_cast<Item_cond*>(select_lex->where);
|
||||||
|
|
||||||
|
if ( unsupported_feature == false
|
||||||
|
&& icp )
|
||||||
|
{
|
||||||
|
icp->traverse_cond(check_walk, &unsupported_feature, Item::POSTFIX);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} // unsupported features check ends here
|
||||||
|
|
||||||
if ( !unsupported_feature )
|
if ( !unsupported_feature )
|
||||||
{
|
{
|
||||||
|
@ -5404,7 +5404,14 @@ int processCommand(string* arguments)
|
|||||||
|
|
||||||
for ( ; pt1 != (*pt).hostConfigList.end() ; pt1++)
|
for ( ; pt1 != (*pt).hostConfigList.end() ; pt1++)
|
||||||
{
|
{
|
||||||
string ipAddr = (*pt1).IPAddr;
|
/* MCOL-1607. IPAddr may be a host name here b/c it is read straight
|
||||||
|
from the config file. */
|
||||||
|
string tmphost = oam.getIPAddress(pt1->IPAddr);
|
||||||
|
string ipAddr;
|
||||||
|
if (tmphost.empty())
|
||||||
|
ipAddr = pt1->IPAddr;
|
||||||
|
else
|
||||||
|
ipAddr = tmphost;
|
||||||
string hostname = (*pt1).HostName;
|
string hostname = (*pt1).HostName;
|
||||||
string nicID = oam.itoa((*pt1).NicID);
|
string nicID = oam.itoa((*pt1).NicID);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (C) 2014 InfiniDB, Inc.
|
/* Copyright (C) 2014 InfiniDB, Inc.
|
||||||
Copyright (c) 2019 MariaDB Corporation
|
Copyright (C) 2019 MariaDB Corporation
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
//#define NDEBUG
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
@ -507,7 +506,6 @@ uint64_t IdbOrderBy::Hasher::operator()(const Row::Pointer& p) const
|
|||||||
row.setPointer(p);
|
row.setPointer(p);
|
||||||
// MCOL-1829 Row::h uses colcount as an array idx down a callstack.
|
// MCOL-1829 Row::h uses colcount as an array idx down a callstack.
|
||||||
uint64_t ret = row.hash();
|
uint64_t ret = row.hash();
|
||||||
//cout << "hash(): returning " << ret << " for row: " << row.toString() << endl;
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,11 +514,8 @@ bool IdbOrderBy::Eq::operator()(const Row::Pointer& d1, const Row::Pointer& d2)
|
|||||||
Row& r1 = ts->row1, &r2 = ts->row2;
|
Row& r1 = ts->row1, &r2 = ts->row2;
|
||||||
r1.setPointer(d1);
|
r1.setPointer(d1);
|
||||||
r2.setPointer(d2);
|
r2.setPointer(d2);
|
||||||
// MCOL-1829 Row::equals uses 2nd argument as container size boundary
|
// MCOL-1829 Row::equals uses 2nd argument as key columns container size boundary
|
||||||
// so it must be column count - 1.
|
bool ret = r1.equals(r2, colCount);
|
||||||
bool ret = r1.equals(r2, colCount - 1);
|
|
||||||
//cout << "equals(): returning " << (int) ret << " for r1: " << r1.toString() << " r2: " << r2.toString()
|
|
||||||
// << endl;
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user