Removed support for constant expressions in TOP because they cannot work

This commit is contained in:
Alexey Milovidov 2019-02-10 21:19:26 +03:00
parent d9ab923a2a
commit 2c7cf23f3f
2 changed files with 5 additions and 3 deletions

View File

@ -71,16 +71,18 @@ bool ParserSelectQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
if (s_top.ignore(pos, expected))
{
ParserNumber num;
if (open_bracket.ignore(pos, expected))
{
if (!exp_elem.parse(pos, select_query->limit_length, expected))
if (!num.parse(pos, select_query->limit_length, expected))
return false;
if (!close_bracket.ignore(pos, expected))
return false;
}
else
{
if (!exp_elem.parse(pos, select_query->limit_length, expected))
if (!num.parse(pos, select_query->limit_length, expected))
return false;
}
}

View File

@ -16,7 +16,7 @@ SELECT count() <= 1 FROM (SELECT number FROM numbers(10) LIMIT randConstant() %
SELECT number FROM numbers(10) LIMIT 0 + 1 BY number;
SELECT number FROM numbers(10) LIMIT 0 BY number;
SELECT TOP(3 + 2) number FROM numbers(10);
SELECT TOP 5 * FROM numbers(10);
SELECT * FROM numbers(10) LIMIT 0.33 / 0.165 - 0.33 + 0.67; -- { serverError 440 }
SELECT * FROM numbers(10) LIMIT LENGTH('NNN') + COS(0), toDate('0000-00-02'); -- { serverError 440 }