mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
Merge pull request #70371 from ClickHouse/backport/24.8/70338
Backport #70338 to 24.8: Fix crash when using WITH FILL incorrectly
This commit is contained in:
commit
66bf2a0bf6
@ -3992,9 +3992,10 @@ ProjectionNames QueryAnalyzer::resolveSortNodeList(QueryTreeNodePtr & sort_node_
|
||||
|
||||
const auto * constant_node = sort_node.getFillTo()->as<ConstantNode>();
|
||||
if (!constant_node || !isColumnedAsNumber(constant_node->getResultType()))
|
||||
throw Exception(ErrorCodes::INVALID_WITH_FILL_EXPRESSION,
|
||||
throw Exception(
|
||||
ErrorCodes::INVALID_WITH_FILL_EXPRESSION,
|
||||
"Sort FILL TO expression must be constant with numeric type. Actual {}. In scope {}",
|
||||
sort_node.getFillFrom()->formatASTForErrorMessage(),
|
||||
sort_node.getFillTo()->formatASTForErrorMessage(),
|
||||
scope.scope_node->formatASTForErrorMessage());
|
||||
|
||||
size_t fill_to_expression_projection_names_size = fill_to_expression_projection_names.size();
|
||||
|
@ -0,0 +1,7 @@
|
||||
CREATE TABLE users (date DateTime, name String, age Int16) ENGINE=MergeTree() ORDER BY date;
|
||||
|
||||
INSERT INTO users VALUES ('2024-01-01', 'John', 33),
|
||||
('2024-02-01', 'Ksenia', 48),
|
||||
('2024-02-15', 'Alice', 50);
|
||||
|
||||
SELECT * FROM users ORDER BY date WITH FILL TO '2024-02-17' STEP toIntervalHour(1); -- { serverError INVALID_WITH_FILL_EXPRESSION }
|
Loading…
Reference in New Issue
Block a user