Skip to content

Commit

Permalink
Merge pull request #492 from Altinity/QueryAnalysisPass-typo
Browse files Browse the repository at this point in the history
24.3 Fix test integration/test_user_defined_object_persistence/test.py::test_persistence
  • Loading branch information
Enmk authored Oct 8, 2024
2 parents 70f597c + 925f5a2 commit d48e781
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/Analyzer/Passes/QueryAnalysisPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5105,7 +5105,7 @@ ProjectionName QueryAnalyzer::resolveWindow(QueryTreeNodePtr & node, IdentifierR
auto window_node_it = scope_window_name_to_window_node.find(parent_window_name);
if (window_node_it == scope_window_name_to_window_node.end())
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"Window '{}' does not exists. In scope {}",
"Window '{}' does not exist. In scope {}",
parent_window_name,
nearest_query_scope->scope_node->formatASTForErrorMessage());

Expand Down Expand Up @@ -5880,7 +5880,7 @@ ProjectionNames QueryAnalyzer::resolveFunction(QueryTreeNodePtr & node, Identifi
{
if (!AggregateFunctionFactory::instance().isAggregateFunctionName(function_name))
{
throw Exception(ErrorCodes::UNKNOWN_AGGREGATE_FUNCTION, "Aggregate function with name '{}' does not exists. In scope {}{}",
throw Exception(ErrorCodes::UNKNOWN_AGGREGATE_FUNCTION, "Aggregate function with name '{}' does not exist. In scope {}{}",
function_name, scope.scope_node->formatASTForErrorMessage(),
getHintsErrorMessageSuffix(AggregateFunctionFactory::instance().getHints(function_name)));
}
Expand Down Expand Up @@ -5962,7 +5962,7 @@ ProjectionNames QueryAnalyzer::resolveFunction(QueryTreeNodePtr & node, Identifi
auto hints = name_prompter.getHints(function_name, possible_function_names);

throw Exception(ErrorCodes::UNKNOWN_FUNCTION,
"Function with name '{}' does not exists. In scope {}{}",
"Function with name '{}' does not exist. In scope {}{}",
function_name,
scope.scope_node->formatASTForErrorMessage(),
getHintsErrorMessageSuffix(hints));
Expand Down Expand Up @@ -8083,7 +8083,7 @@ void QueryAnalyzer::resolveQuery(const QueryTreeNodePtr & query_node, Identifier
auto window_node_it = scope.window_name_to_window_node.find(parent_window_name);
if (window_node_it == scope.window_name_to_window_node.end())
throw Exception(ErrorCodes::BAD_ARGUMENTS,
"Window '{}' does not exists. In scope {}",
"Window '{}' does not exist. In scope {}",
parent_window_name,
scope.scope_node->formatASTForErrorMessage());

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/test_access_for_functions/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def test_access_rights_for_function():
function_resolution_error = instance.query_and_get_error("SELECT MySum(1, 2)")
assert (
"Unknown function MySum" in function_resolution_error
or "Function with name 'MySum' does not exists." in function_resolution_error
or "Function with name 'MySum' does not exist." in function_resolution_error
)

instance.query("REVOKE CREATE FUNCTION ON *.* FROM A")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def check_function_does_not_exist(node: ClickHouseInstance):
error_message = node.query_and_get_error("SELECT test_function(1);")
assert (
"Unknown function test_function" in error_message
or "Function with name 'test_function' does not exists. In scope SELECT test_function(1)"
or "Function with name 'test_function' does not exist. In scope SELECT test_function(1)"
in error_message
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ def test_persistence():
error_message = instance.query_and_get_error("SELECT MySum1(1, 2)")
assert (
"Unknown function MySum1" in error_message
or "Function with name 'MySum1' does not exists. In scope SELECT MySum1(1, 2)"
or "Function with name 'MySum1' does not exist. In scope SELECT MySum1(1, 2)"
in error_message
)

error_message = instance.query_and_get_error("SELECT MySum2(1, 2)")
assert (
"Unknown function MySum2" in error_message
or "Function with name 'MySum2' does not exists. In scope SELECT MySum2(1, 2)"
or "Function with name 'MySum2' does not exist. In scope SELECT MySum2(1, 2)"
in error_message
)

Expand Down

0 comments on commit d48e781

Please sign in to comment.