mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 00:52:02 +00:00
Fix build.
This commit is contained in:
parent
d6db27e372
commit
025093d354
@ -228,7 +228,7 @@ int Server::main(const std::vector<std::string> & /*args*/)
|
||||
* settings, available functions, data types, aggregate functions, databases...
|
||||
*/
|
||||
auto shared_context = Context::createShared();
|
||||
global_context = std::make_unique<Context>(Context::createGlobal(shared_context.get()));
|
||||
global_context = std::make_unique<Context>(Context::createGlobal(shared_context.shared.get()));
|
||||
global_context->makeGlobalContext();
|
||||
global_context->setApplicationType(Context::ApplicationType::SERVER);
|
||||
|
||||
|
@ -441,6 +441,9 @@ Context::Context() = default;
|
||||
Context::Context(const Context &) = default;
|
||||
Context & Context::operator=(const Context &) = default;
|
||||
|
||||
SharedContextHolder::SharedContextHolder() = default;
|
||||
SharedContextHolder::SharedContextHolder(SharedContextHolder &&) = default;
|
||||
SharedContextHolder::~SharedContextHolder() = default;
|
||||
|
||||
Context Context::createGlobal()
|
||||
{
|
||||
@ -457,9 +460,11 @@ Context Context::createGlobal(ContextShared * shared)
|
||||
return res;
|
||||
}
|
||||
|
||||
std::unique_ptr<ContextShared> Context::createShared()
|
||||
SharedContextHolder Context::createShared()
|
||||
{
|
||||
return std::make_unique<ContextShared>();
|
||||
SharedContextHolder holder;
|
||||
holder.shared = std::make_unique<ContextShared>();
|
||||
return holder;
|
||||
}
|
||||
|
||||
Context::~Context() = default;
|
||||
|
@ -128,6 +128,14 @@ struct IHostContext
|
||||
|
||||
using IHostContextPtr = std::shared_ptr<IHostContext>;
|
||||
|
||||
struct SharedContextHolder
|
||||
{
|
||||
std::unique_ptr<ContextShared> shared;
|
||||
~SharedContextHolder();
|
||||
SharedContextHolder();
|
||||
SharedContextHolder(SharedContextHolder &&);
|
||||
};
|
||||
|
||||
/** A set of known objects that can be used in the query.
|
||||
* Consists of a shared part (always common to all sessions and queries)
|
||||
* and copied part (which can be its own for each session or query).
|
||||
@ -193,7 +201,7 @@ public:
|
||||
/// Create initial Context with ContextShared and etc.
|
||||
static Context createGlobal();
|
||||
static Context createGlobal(ContextShared * shared);
|
||||
static std::unique_ptr<ContextShared> createShared();
|
||||
static SharedContextHolder createShared();
|
||||
|
||||
Context(const Context &);
|
||||
Context & operator=(const Context &);
|
||||
|
Loading…
Reference in New Issue
Block a user