Merge pull request #6963 from nicelulu/issue_6616

optimize limit 1,0 and test.
This commit is contained in:
alexey-milovidov 2019-09-19 02:23:56 +03:00 committed by GitHub
commit 9c675e50bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;