mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 18:20:50 +00:00
improve error message while using OFFSET FETCH clause without ORDER BY
This commit is contained in:
parent
e3650b865a
commit
bc6616d8be
@ -595,6 +595,7 @@
|
||||
M(625, IO_SETUP_ERROR) \
|
||||
M(626, CANNOT_SKIP_UNKNOWN_FIELD) \
|
||||
M(627, BACKUP_ENGINE_NOT_FOUND) \
|
||||
M(628, OFFSET_FETCH_WITHOUT_ORDER_BY) \
|
||||
\
|
||||
M(999, KEEPER_EXCEPTION) \
|
||||
M(1000, POCO_EXCEPTION) \
|
||||
|
@ -23,6 +23,7 @@ namespace ErrorCodes
|
||||
extern const int SYNTAX_ERROR;
|
||||
extern const int TOP_AND_LIMIT_TOGETHER;
|
||||
extern const int WITH_TIES_WITHOUT_ORDER_BY;
|
||||
extern const int OFFSET_FETCH_WITHOUT_ORDER_BY;
|
||||
}
|
||||
|
||||
|
||||
@ -323,7 +324,7 @@ bool ParserSelectQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
||||
{
|
||||
/// OFFSET FETCH clause must exists with "ORDER BY"
|
||||
if (!order_expression_list)
|
||||
return false;
|
||||
throw Exception("Can not use OFFSET FETCH clause without ORDER BY", ErrorCodes::OFFSET_FETCH_WITHOUT_ORDER_BY);
|
||||
|
||||
if (s_first.ignore(pos, expected))
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user