Merge pull request #8892 from PerformanceVision/select_constants

DB::Exception: Parameters are out of bound when we have a constant on the SELECT clause
This commit is contained in:
Anton Popov 2020-02-07 14:05:16 +03:00 committed by GitHub
commit 3e8179108b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 2 deletions

View File

@ -141,8 +141,6 @@ void sortBlock(Block & block, const SortDescription & description, UInt64 limit)
{
if (!is_column_const)
block.getByPosition(i).column = block.getByPosition(i).column->permute(perm, limit);
else if (limit != 0) // LIMIT exists
block.getByPosition(i).column = block.getByPosition(i).column->cut(0, limit);
}
}
else

View File

@ -0,0 +1 @@
SELECT 42 AS foo ORDER BY foo LIMIT 2