mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-15 19:02:04 +00:00
37 lines
716 B
C++
37 lines
716 B
C++
#include <Storages/MemorySettings.h>
|
|
#include <Parsers/ASTCreateQuery.h>
|
|
#include <Parsers/ASTSetQuery.h>
|
|
#include <Parsers/ASTFunction.h>
|
|
#include <Common/Exception.h>
|
|
|
|
|
|
namespace DB
|
|
{
|
|
|
|
namespace ErrorCodes
|
|
{
|
|
extern const int UNKNOWN_SETTING;
|
|
}
|
|
|
|
IMPLEMENT_SETTINGS_TRAITS(memorySettingsTraits, MEMORY_SETTINGS)
|
|
|
|
void MemorySettings::loadFromQuery(ASTStorage & storage_def)
|
|
{
|
|
if (storage_def.settings)
|
|
{
|
|
try
|
|
{
|
|
applyChanges(storage_def.settings->changes);
|
|
}
|
|
catch (Exception & e)
|
|
{
|
|
if (e.code() == ErrorCodes::UNKNOWN_SETTING)
|
|
e.addMessage("for storage " + storage_def.engine->name);
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|