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

Merge pull request #540 from drrtuy/MCOL-1637

MCOL-1637 Return limit value comparision to fix the regression.
This commit is contained in:
David.Hall
2018-08-20 09:38:52 -05:00
committed by GitHub
3 changed files with 8 additions and 3 deletions

View File

@@ -756,8 +756,8 @@ int doFromSubquery(CalpontExecutionPlan* ep, const string& alias, const string&
void addOrderByAndLimit(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo) void addOrderByAndLimit(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
{ {
// make sure there is a LIMIT // make sure there is a LIMIT
// if (csep->orderByCols().size() > 0 csep->limitNum() == (uint64_t) - 1) if (csep->orderByCols().size() > 0 && csep->limitNum() == (uint64_t) - 1)
// return; return;
jobInfo.limitStart = csep->limitStart(); jobInfo.limitStart = csep->limitStart();
jobInfo.limitCount = csep->limitNum(); jobInfo.limitCount = csep->limitNum();

View File

@@ -1843,7 +1843,7 @@ void makeVtableModeSteps(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo,
JobStepVector& querySteps, JobStepVector& projectSteps, DeliveredTableMap& deliverySteps) JobStepVector& querySteps, JobStepVector& projectSteps, DeliveredTableMap& deliverySteps)
{ {
// @bug4848, enhance and unify limit handling. // @bug4848, enhance and unify limit handling.
// if (csep->limitNum() != (uint64_t) - 1) if (csep->limitNum() != (uint64_t) - 1)
{ {
// special case for outer query order by limit -- return all // special case for outer query order by limit -- return all
if (jobInfo.subId == 0 && csep->hasOrderBy()) if (jobInfo.subId == 0 && csep->hasOrderBy())

View File

@@ -10118,6 +10118,11 @@ int getGroupPlan(gp_walk_info& gwi, SELECT_LEX& select_lex, SCSEP& csep, cal_gro
{ {
csep->limitNum(((Item_int*)gi.groupByTables->select_lex->select_limit)->val_int()); csep->limitNum(((Item_int*)gi.groupByTables->select_lex->select_limit)->val_int());
} }
else
{
if (csep->hasOrderBy())
csep->limitNum((uint64_t) - 2);
}
if (gi.groupByTables->select_lex->offset_limit) if (gi.groupByTables->select_lex->offset_limit)
{ {