mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-19 22:22:00 +00:00
Fix error
This commit is contained in:
parent
f554ff9d99
commit
f15623141e
@ -104,15 +104,24 @@ public:
|
|||||||
|
|
||||||
class ScopedAttach : private boost::noncopyable
|
class ScopedAttach : private boost::noncopyable
|
||||||
{
|
{
|
||||||
|
private:
|
||||||
|
bool attached = false;
|
||||||
public:
|
public:
|
||||||
explicit ScopedAttach(const ThreadGroupStatusPtr & thread_group)
|
explicit ScopedAttach(const ThreadGroupStatusPtr & thread_group)
|
||||||
{
|
{
|
||||||
CurrentThread::attachTo(thread_group);
|
if (!CurrentThread::getGroup())
|
||||||
|
{
|
||||||
|
CurrentThread::attachToIfDetached(thread_group);
|
||||||
|
attached = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~ScopedAttach()
|
~ScopedAttach()
|
||||||
{
|
{
|
||||||
CurrentThread::detachQuery();
|
if (attached)
|
||||||
|
{
|
||||||
|
CurrentThread::detachQuery();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user