Fix clickhouse-local exit on bad send_logs_level setting

This commit is contained in:
avogar 2023-10-24 20:46:44 +00:00
parent 0703c88381
commit 2516c2ea28

View File

@ -1810,7 +1810,12 @@ void ClientBase::processParsedSingleQuery(const String & full_query, const Strin
{
const auto * logs_level_field = set_query->changes.tryGet(std::string_view{"send_logs_level"});
if (logs_level_field)
updateLoggerLevel(logs_level_field->safeGet<String>());
{
auto logs_level = logs_level_field->safeGet<String>();
/// Check that setting value is correct before updating logger level.
SettingFieldLogsLevelTraits::fromString(logs_level);
updateLoggerLevel(logs_level);
}
}
if (const auto * create_user_query = parsed_query->as<ASTCreateUserQuery>())