Merge pull request #2960 from zhang2014/fix/on_cluster_crash

ISSUES-2482 fix crash when on cluster
This commit is contained in:
alexey-milovidov 2018-08-27 16:25:26 +03:00 committed by GitHub
commit 806316511f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -517,9 +517,9 @@ bool DDLWorker::tryExecuteQuery(const String & query, const DDLTask & task, Exec
try
{
Context local_context(context);
local_context.setCurrentQueryId(""); // generate random query_id
executeQuery(istr, ostr, false, local_context, nullptr);
current_context = std::make_unique<Context>(context);
current_context->setCurrentQueryId(""); // generate random query_id
executeQuery(istr, ostr, false, *current_context, nullptr);
}
catch (...)
{

View File

@ -70,6 +70,7 @@ private:
private:
Context & context;
Logger * log;
std::unique_ptr<Context> current_context;
std::string host_fqdn; /// current host domain name
std::string host_fqdn_id; /// host_name:port