Disable suggestions

This commit is contained in:
Robert Schulze 2023-09-25 21:50:24 +00:00
parent d30137b1b6
commit 805924d9f4
No known key found for this signature in database
GPG Key ID: 26703B55FB13728A
2 changed files with 8 additions and 2 deletions

View File

@ -586,7 +586,8 @@ void LocalServer::processConfig()
print_stack_trace = config().getBool("stacktrace", false);
const std::string clickhouse_dialect{"clickhouse"};
load_suggestions = false;
load_suggestions = (is_interactive || delayed_interactive) && !config().getBool("disable_suggestion", false)
&& config().getString("dialect", clickhouse_dialect) == clickhouse_dialect;
auto logging = (config().has("logger.console")
|| config().has("logger.level")

View File

@ -53,4 +53,9 @@ expect eof
EOF
}
run "$CLICKHOUSE_LOCAL"
run "$CLICKHOUSE_LOCAL --disable_suggestion"
# Suggestions are off because the suggestion feature initializes itself by reading all available function
# names from "system.functions". Getting the value for field "is_obsolete" occasionally throws (e.g. for
# certain dictionary functions when dictionaries are not set up yet). Exceptions are properly handled, but
# they exist for a short time. This, in combination with CLICKHOUSE_TERMINATE_ON_ANY_EXCEPTION, terminates
# clickhouse-local and clickhouse-client when run in interactive mode *with* suggestions.