From 46218b68ff47e079d5636be63f99a1deb5ad180b Mon Sep 17 00:00:00 2001 From: Vitaly Baranov Date: Sat, 27 Jul 2024 06:32:26 +0200 Subject: [PATCH] Initialize the client_context after quota_key in clickhouse-client. --- programs/client/Client.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/programs/client/Client.cpp b/programs/client/Client.cpp index f2919db0308..3e613532f3a 100644 --- a/programs/client/Client.cpp +++ b/programs/client/Client.cpp @@ -1069,11 +1069,6 @@ void Client::processOptions(const OptionsDescription & options_description, global_context->makeGlobalContext(); global_context->setApplicationType(Context::ApplicationType::CLIENT); - /// In case of clickhouse-client the `client_context` can be just an alias for the `global_context`. - /// (There is no need to copy the context because clickhouse-client has no background tasks so it won't use that context in parallel.) - client_context = global_context; - initClientContext(); - global_context->setSettings(cmd_settings); /// Copy settings-related program options to config. @@ -1168,6 +1163,11 @@ void Client::processOptions(const OptionsDescription & options_description, if (options.count("opentelemetry-tracestate")) global_context->getClientTraceContext().tracestate = options["opentelemetry-tracestate"].as(); + + /// In case of clickhouse-client the `client_context` can be just an alias for the `global_context`. + /// (There is no need to copy the context because clickhouse-client has no background tasks so it won't use that context in parallel.) + client_context = global_context; + initClientContext(); }