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

MCOL-4453 Fix SELECT ... LIMIT 0, now it returns an empty set as expected

This commit is contained in:
Alexey Antipovsky
2020-12-16 18:50:21 +03:00
parent 5d4d7c100c
commit 45c34553db

View File

@ -429,6 +429,13 @@ void TupleAnnexStep::executeNoOrderBy()
continue;
}
if (UNLIKELY(fRowsReturned >= fLimitCount))
{
fLimitHit = true;
fJobList->abortOnLimit((JobStep*) this);
continue;
}
if (fConstant)
fConstant->fillInConstants(fRowIn, fRowOut);
else
@ -441,11 +448,6 @@ void TupleAnnexStep::executeNoOrderBy()
fRowOut.nextRow();
fRowIn.nextRow();
}
else
{
fLimitHit = true;
fJobList->abortOnLimit((JobStep*) this);
}
}
if (fRowGroupOut.getRowCount() > 0)
@ -523,15 +525,17 @@ void TupleAnnexStep::executeNoOrderByWithDistinct()
if (inserted.second)
{
fRowGroupOut.incRowCount();
fRowOut.nextRow();
if (UNLIKELY(++fRowsReturned >= fLimitCount))
if (UNLIKELY(fRowsReturned >= fLimitCount))
{
fLimitHit = true;
fJobList->abortOnLimit((JobStep*) this);
continue;
}
++fRowsReturned;
fRowGroupOut.incRowCount();
fRowOut.nextRow();
if (UNLIKELY(fRowGroupOut.getRowCount() >= rowgroup::rgCommonSize))
{
dataVec.push_back(rgDataOut);