Simplify lock

This commit is contained in:
alesapin 2019-08-19 14:18:58 +03:00
parent 69015f292e
commit f2a8c18c1f

View File

@ -1645,7 +1645,7 @@ void MergeTreeData::alterSettings(
const Context & context, const Context & context,
TableStructureWriteLockHolder & table_lock_holder) TableStructureWriteLockHolder & table_lock_holder)
{ {
std::unique_lock lock(settings_mutex); std::lock_guard lock(settings_mutex);
MutableMergeTreeSettingsPtr settings = std::move(*guarded_settings.getPtr()).mutate(); MutableMergeTreeSettingsPtr settings = std::move(*guarded_settings.getPtr()).mutate();
settings->updateFromChanges(new_changes); settings->updateFromChanges(new_changes);
IStorage::alterSettings(new_changes, current_database_name, current_table_name, context, table_lock_holder); IStorage::alterSettings(new_changes, current_database_name, current_table_name, context, table_lock_holder);