mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Change error code for DISTINCT ON and LIMIT BY, finally
This commit is contained in:
parent
96536a9cbe
commit
b44bd174cc
@ -20,8 +20,8 @@ namespace ErrorCodes
|
||||
extern const int FIRST_AND_NEXT_TOGETHER;
|
||||
extern const int LIMIT_BY_WITH_TIES_IS_NOT_SUPPORTED;
|
||||
extern const int ROW_AND_ROWS_TOGETHER;
|
||||
extern const int SYNTAX_ERROR;
|
||||
extern const int TOP_AND_LIMIT_TOGETHER;
|
||||
extern const int UNSUPPORTED_METHOD;
|
||||
extern const int WITH_TIES_WITHOUT_ORDER_BY;
|
||||
}
|
||||
|
||||
@ -286,7 +286,7 @@ bool ParserSelectQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected)
|
||||
throw Exception("Can not use WITH TIES alongside LIMIT BY/DISTINCT ON", ErrorCodes::LIMIT_BY_WITH_TIES_IS_NOT_SUPPORTED);
|
||||
|
||||
if (distinct_on_expression_list)
|
||||
throw Exception("Can not use DISTINCT ON alongside LIMIT BY", ErrorCodes::UNSUPPORTED_METHOD);
|
||||
throw Exception("Can not use DISTINCT ON alongside LIMIT BY", ErrorCodes::SYNTAX_ERROR);
|
||||
|
||||
limit_by_length = limit_length;
|
||||
limit_by_offset = limit_offset;
|
||||
|
@ -7,7 +7,7 @@ SELECT DISTINCT ON (a, b) a, b, c FROM t1;
|
||||
SELECT DISTINCT ON (a, b) * FROM t1;
|
||||
SELECT DISTINCT ON (a) * FROM t1;
|
||||
|
||||
SELECT DISTINCT ON (a, b) a, b, c FROM t1 LIMIT 1 BY a, b; -- { clientError 1 }
|
||||
SELECT DISTINCT ON (a, b) a, b, c FROM t1 LIMIT 1 BY a, b; -- { clientError 62 }
|
||||
|
||||
SELECT DISTINCT ON a, b a, b FROM t1; -- { clientError 62 }
|
||||
SELECT DISTINCT ON a a, b FROM t1; -- { clientError 62 }
|
||||
|
Loading…
Reference in New Issue
Block a user