Working setColumns, setConstraints, setIndices

This commit is contained in:
alesapin 2020-06-15 20:10:14 +03:00
parent af2fe2ba55
commit aa30649ce5
2 changed files with 2 additions and 5 deletions

View File

@ -82,7 +82,7 @@ public:
IStorage() = delete;
/// Storage fields should be initialized in separate methods like setColumns
/// or setTableTTLs.
explicit IStorage(StorageID storage_id_) : storage_id(std::move(storage_id_)) {} //-V730
explicit IStorage(StorageID storage_id_) : storage_id(std::move(storage_id_)), metadata(std::make_shared<StorageInMemoryMetadata>()) {} //-V730
virtual ~IStorage() = default;
IStorage(const IStorage &) = delete;

View File

@ -142,9 +142,8 @@ MergeTreeData::MergeTreeData(
if (relative_data_path.empty())
throw Exception("MergeTree storages require data path", ErrorCodes::INCORRECT_FILE_NAME);
setSettingsChanges(metadata_.settings_changes);
const auto settings = getSettings();
setProperties(metadata_, attach);
const auto settings = getSettings();
/// NOTE: using the same columns list as is read when performing actual merges.
merging_params.check(getColumns().getAllPhysical());
@ -385,8 +384,6 @@ void MergeTreeData::checkProperties(const StorageInMemoryMetadata & new_metadata
void MergeTreeData::setProperties(const StorageInMemoryMetadata & new_metadata, bool attach)
{
checkProperties(new_metadata, attach);
/// Other parts of metadata initialized is separate methods
setInMemoryMetadata(new_metadata);
}