mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
Merge pull request #55994 from Avogar/fix-bad-logs-level-in-local
Fix clickhouse-local exit on bad send_logs_level setting
This commit is contained in:
commit
413c3d1ee3
@ -1797,7 +1797,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>())
|
||||
|
15
tests/queries/0_stateless/02910_bad_logs_level_in_local.sh
Executable file
15
tests/queries/0_stateless/02910_bad_logs_level_in_local.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/expect -f
|
||||
|
||||
log_user 0
|
||||
set timeout 60
|
||||
match_max 100000
|
||||
|
||||
spawn bash -c "clickhouse-local"
|
||||
|
||||
expect ":) "
|
||||
send -- "SET send_logs_level = 't'\r"
|
||||
expect "Exception on client:"
|
||||
expect ":) "
|
||||
send -- "exit\r"
|
||||
expect eof
|
||||
|
Loading…
Reference in New Issue
Block a user