some fixes

This commit is contained in:
Nikita Vasilev 2018-12-25 22:37:39 +03:00
parent fcd49afc2a
commit 36083e1036
2 changed files with 4 additions and 2 deletions

View File

@ -103,7 +103,8 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create)
const ASTStorage & storage = *create.storage;
const ASTFunction & engine = *storage.engine;
/// Currently, there are no database engines, that support any arguments.
if (engine.arguments || engine.parameters || storage.partition_by || storage.primary_key || storage.order_by || storage.sample_by || storage.settings)
if (engine.arguments || engine.parameters || storage.partition_by || storage.primary_key
|| storage.order_by || storage.sample_by || !storage.indexes.empty() || storage.settings)
{
std::stringstream ostr;
formatAST(storage, ostr, false, false);

View File

@ -94,7 +94,8 @@ StoragePtr StorageFactory::get(
ErrorCodes::BAD_ARGUMENTS);
}
if ((storage_def->partition_by || storage_def->primary_key || storage_def->order_by || storage_def->sample_by)
if ((storage_def->partition_by || storage_def->primary_key || storage_def->order_by
|| storage_def->sample_by || !storage_def->indexes.empty())
&& !endsWith(name, "MergeTree"))
{
throw Exception(