1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

1. Execution plan now sets limitNum and limitOffset for all cases if an explicit limit is supplied in the query.

2. Fallback to using sql_select_limit system variable value if an explicit limit is not supplied.
3. Remove checks that did not allow (2^64 - 1) as a valid limit value.
This commit is contained in:
Gagan Goel
2019-09-01 23:22:10 -04:00
parent c3458eaeea
commit af988635d4
3 changed files with 20 additions and 42 deletions

View File

@ -7842,26 +7842,13 @@ int getSelectPlan(gp_walk_info& gwi, SELECT_LEX& select_lex,
}
}
// relate to bug4848. let mysql drive limit when limit session variable set.
// do not set in csep. @bug5096. ignore session limit setting for dml
if (gwi.thd->variables.select_limit == (uint64_t) - 1 &&
!csep->hasOrderBy())
{
csep->limitStart(limitOffset);
csep->limitNum(limitNum);
}
// Pushdown queries w ORDER BY and LIMIT
else if (isPushdownHand && csep->hasOrderBy())
{
csep->limitStart(limitOffset);
csep->limitNum(limitNum);
}
csep->limitStart(limitOffset);
csep->limitNum(limitNum);
}
// Pushdown queries with ORDER BY w/o explicit limit
else if (isPushdownHand && csep->hasOrderBy())
// If an explicit limit is not specified, use the system variable value
else
{
// We must set this to activate LimitedOrderBy in ExeMgr
csep->limitNum((uint64_t) - 2);
csep->limitNum(gwi.thd->variables.select_limit);
}
// We don't currently support limit with correlated subquery