ISSUES-2482 fix crash when on cluster

This commit is contained in:
zhang2014 2018-08-27 19:03:22 +08:00
parent 3be0b6ca6d
commit f8d7cf17a7
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