optimize limit 1,0 and test.

This commit is contained in:
root 2019-09-18 02:55:59 +08:00
parent 110568f980
commit f4b7cae998
3 changed files with 2 additions and 1 deletions

View File

@ -790,7 +790,7 @@ static std::pair<UInt64, UInt64> getLimitLengthAndOffset(const ASTSelectQuery &
if (query.limitLength())
{
length = getLimitUIntValue(query.limitLength(), context);
if (query.limitOffset())
if (query.limitOffset() && length)
offset = getLimitUIntValue(query.limitOffset(), context);
}

View File

@ -0,0 +1 @@
SELECT count() FROM system.numbers LIMIT 1, 0;