Another fix for tests. Better handling of MV.

This commit is contained in:
Maxim Akhmedov 2020-01-27 21:28:27 +03:00
parent 675d0f549f
commit 2e9538f768

View File

@ -111,8 +111,6 @@ StoragePtr StorageFactory::get(
"Direct creation of tables with ENGINE LiveView is not supported, use CREATE LIVE VIEW statement", "Direct creation of tables with ENGINE LiveView is not supported, use CREATE LIVE VIEW statement",
ErrorCodes::INCORRECT_QUERY); ErrorCodes::INCORRECT_QUERY);
} }
}
}
auto it = storages.find(name); auto it = storages.find(name);
if (it == storages.end()) if (it == storages.end())
@ -124,7 +122,6 @@ StoragePtr StorageFactory::get(
throw Exception("Unknown table engine " + name, ErrorCodes::UNKNOWN_STORAGE); throw Exception("Unknown table engine " + name, ErrorCodes::UNKNOWN_STORAGE);
} }
auto checkFeature = [&](String feature_description, FeatureMatcherFn feature_matcher_fn) auto checkFeature = [&](String feature_description, FeatureMatcherFn feature_matcher_fn)
{ {
if (!feature_matcher_fn(it->second.features)) if (!feature_matcher_fn(it->second.features))
@ -143,8 +140,6 @@ StoragePtr StorageFactory::get(
} }
}; };
if (storage_def)
{
if (storage_def->settings) if (storage_def->settings)
checkFeature( checkFeature(
"SETTINGS clause", "SETTINGS clause",
@ -159,12 +154,13 @@ StoragePtr StorageFactory::get(
checkFeature( checkFeature(
"TTL clause", "TTL clause",
[](StorageFeatures features) { return features.supports_ttl; }); [](StorageFeatures features) { return features.supports_ttl; });
}
if (query.columns_list && query.columns_list->indices && !query.columns_list->indices->children.empty()) if (query.columns_list && query.columns_list->indices && !query.columns_list->indices->children.empty())
checkFeature( checkFeature(
"skipping indices", "skipping indices",
[](StorageFeatures features) { return features.supports_skipping_indices; }); [](StorageFeatures features) { return features.supports_skipping_indices; });
}
}
Arguments arguments Arguments arguments
{ {
@ -182,7 +178,7 @@ StoragePtr StorageFactory::get(
.has_force_restore_data_flag = has_force_restore_data_flag .has_force_restore_data_flag = has_force_restore_data_flag
}; };
return it->second.creator_fn(arguments); return storages.at(name).creator_fn(arguments);
} }
StorageFactory & StorageFactory::instance() StorageFactory & StorageFactory::instance()