mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-30 05:30:51 +00:00
Fix order of resource destruction in SettingQuotaAndLimitsStep.
This commit is contained in:
parent
f9bf1e3406
commit
5bbae0953a
@ -30,20 +30,18 @@ SettingQuotaAndLimitsStep::SettingQuotaAndLimitsStep(
|
||||
std::shared_ptr<const EnabledQuota> quota_,
|
||||
std::shared_ptr<Context> context_)
|
||||
: ITransformingStep(input_stream_, input_stream_.header, getTraits())
|
||||
, context(std::move(context_))
|
||||
, storage(std::move(storage_))
|
||||
, table_lock(std::move(table_lock_))
|
||||
, limits(limits_)
|
||||
, leaf_limits(leaf_limits_)
|
||||
, quota(std::move(quota_))
|
||||
, context(std::move(context_))
|
||||
{
|
||||
}
|
||||
|
||||
void SettingQuotaAndLimitsStep::transformPipeline(QueryPipeline & pipeline)
|
||||
{
|
||||
/// Table lock is stored inside pipeline here.
|
||||
pipeline.addTableLock(table_lock);
|
||||
|
||||
pipeline.setLimits(limits);
|
||||
|
||||
/**
|
||||
@ -59,11 +57,15 @@ void SettingQuotaAndLimitsStep::transformPipeline(QueryPipeline & pipeline)
|
||||
if (quota)
|
||||
pipeline.setQuota(quota);
|
||||
|
||||
/// Order of resources below is important.
|
||||
if (context)
|
||||
pipeline.addInterpreterContext(std::move(context));
|
||||
|
||||
if (storage)
|
||||
pipeline.addStorageHolder(std::move(storage));
|
||||
|
||||
if (table_lock)
|
||||
pipeline.addTableLock(std::move(table_lock));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -33,12 +33,12 @@ public:
|
||||
void transformPipeline(QueryPipeline & pipeline) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<Context> context;
|
||||
StoragePtr storage;
|
||||
TableLockHolder table_lock;
|
||||
StreamLocalLimits limits;
|
||||
SizeLimits leaf_limits;
|
||||
std::shared_ptr<const EnabledQuota> quota;
|
||||
std::shared_ptr<Context> context;
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user