mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-23 10:10:50 +00:00
add getSessionContext() const
This commit is contained in:
parent
51cf368e1f
commit
631d9ea0a0
@ -204,7 +204,9 @@ public:
|
||||
/// Для методов ниже может быть необходимо захватывать блокировку самостоятельно.
|
||||
std::unique_lock<Poco::Mutex> getLock() const;
|
||||
|
||||
const Context & getSessionContext() const;
|
||||
Context & getSessionContext();
|
||||
|
||||
const Context & getGlobalContext() const;
|
||||
Context & getGlobalContext();
|
||||
|
||||
|
@ -725,6 +725,12 @@ void Context::setMacros(Macros && macros)
|
||||
shared->macros = macros;
|
||||
}
|
||||
|
||||
const Context & Context::getSessionContext() const
|
||||
{
|
||||
if (!session_context)
|
||||
throw Exception("There is no session", ErrorCodes::THERE_IS_NO_SESSION);
|
||||
return *session_context;
|
||||
}
|
||||
|
||||
Context & Context::getSessionContext()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user