mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
Fix custom settings
This commit is contained in:
parent
bc267d4427
commit
96a961583c
@ -841,7 +841,8 @@ void Connection::sendQuery(
|
||||
modified_settings.emplace(*settings);
|
||||
for (const SettingChange & change : settings_from_server)
|
||||
{
|
||||
if (settings->get(change.name) == change.value)
|
||||
Field value;
|
||||
if (settings->tryGet(change.name, value) && value == change.value)
|
||||
{
|
||||
// Mark as unchanged so it's not sent.
|
||||
modified_settings->setDefaultValue(change.name);
|
||||
|
@ -339,7 +339,13 @@ void BaseSettings<TTraits>::resetToDefault(std::string_view name)
|
||||
name = TTraits::resolveName(name);
|
||||
const auto & accessor = Traits::Accessor::instance();
|
||||
if (size_t index = accessor.find(name); index != static_cast<size_t>(-1))
|
||||
{
|
||||
accessor.resetValueToDefault(*this, index);
|
||||
return;
|
||||
}
|
||||
|
||||
if constexpr (Traits::allow_custom_settings)
|
||||
custom_settings_map.erase(name);
|
||||
}
|
||||
|
||||
template <typename TTraits>
|
||||
|
Loading…
Reference in New Issue
Block a user