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
MCOL-3903 10.5 allows engines to process LIMIT and OFFSET on their own.
This commit is contained in:
@ -6617,7 +6617,6 @@ int processLimitAndOffset(
|
|||||||
if (select_lex.join)
|
if (select_lex.join)
|
||||||
{
|
{
|
||||||
JOIN* join = select_lex.join;
|
JOIN* join = select_lex.join;
|
||||||
#if MYSQL_VERSION_ID >= 50172
|
|
||||||
|
|
||||||
// @bug5729. After upgrade, join->unit sometimes is uninitialized pointer
|
// @bug5729. After upgrade, join->unit sometimes is uninitialized pointer
|
||||||
// (not null though) and will cause seg fault. Prefer checking
|
// (not null though) and will cause seg fault. Prefer checking
|
||||||
@ -6633,14 +6632,9 @@ int processLimitAndOffset(
|
|||||||
}
|
}
|
||||||
else if (join->unit)
|
else if (join->unit)
|
||||||
{
|
{
|
||||||
limitOffset = join->unit->offset_limit_cnt;
|
limitOffset = join->unit->lim.get_offset_limit();
|
||||||
limitNum = join->unit->select_limit_cnt - limitOffset;
|
limitNum = join->unit->lim.get_select_limit() - limitOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
|
||||||
limitOffset = (join->unit)->offset_limit_cnt;
|
|
||||||
limitNum = (join->unit)->select_limit_cnt - (join->unit)->offset_limit_cnt;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -6675,23 +6669,6 @@ int processLimitAndOffset(
|
|||||||
return ER_CHECK_NOT_IMPLEMENTED;
|
return ER_CHECK_NOT_IMPLEMENTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// MDB applies OFFSET on its own for SH processing.
|
|
||||||
// See related MDEV-16327 for details.
|
|
||||||
if (isSelectHandlerTop && csep->limitStart())
|
|
||||||
{
|
|
||||||
if (std::numeric_limits<uint64_t>::max()-csep->limitStart()
|
|
||||||
< csep->limitNum())
|
|
||||||
{
|
|
||||||
csep->limitNum(std::numeric_limits<uint64_t>::max());
|
|
||||||
csep->limitStart(0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
csep->limitNum(csep->limitNum()+csep->limitStart());
|
|
||||||
csep->limitStart(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user