A little bit better.

This commit is contained in:
Nikolai Kochetov 2022-03-14 11:31:24 +00:00
parent cdc529fa2a
commit ff09076524

View File

@ -1200,9 +1200,9 @@ bool InterpreterCreateQuery::doCreateTable(ASTCreateQuery & create,
if (!create.attach && getContext()->getSettingsRef().database_replicated_allow_only_replicated_engine)
{
bool is_replicated_storage = typeid_cast<const StorageReplicatedMergeTree *>(res.get()) != nullptr;
if (!is_replicated_storage && database && database->getEngineName() != "Replicated")
if (!is_replicated_storage && res->storesDataOnDisk() && database && database->getEngineName() != "Replicated")
throw Exception(ErrorCodes::UNKNOWN_STORAGE,
"Only Replicated tables are allowed in database engine is Replicated");
"Only table with Replicated engine or tables which does not store data on disk are allowed in Replicated database");
}
if (from_path && !res->storesDataOnDisk())