From 36083e103609566318ee80a16862aa67e6a220b9 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Tue, 25 Dec 2018 22:37:39 +0300 Subject: [PATCH] some fixes --- dbms/src/Interpreters/InterpreterCreateQuery.cpp | 3 ++- dbms/src/Storages/StorageFactory.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dbms/src/Interpreters/InterpreterCreateQuery.cpp b/dbms/src/Interpreters/InterpreterCreateQuery.cpp index 66ce6bb3fb1..0f5f421c984 100644 --- a/dbms/src/Interpreters/InterpreterCreateQuery.cpp +++ b/dbms/src/Interpreters/InterpreterCreateQuery.cpp @@ -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); diff --git a/dbms/src/Storages/StorageFactory.cpp b/dbms/src/Storages/StorageFactory.cpp index 333933d449f..b1072eb0b36 100644 --- a/dbms/src/Storages/StorageFactory.cpp +++ b/dbms/src/Storages/StorageFactory.cpp @@ -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(