From 9190a883d3f2a4152dc7e1f52520494bf814d88a Mon Sep 17 00:00:00 2001 From: Stig Bakken Date: Tue, 16 Nov 2021 14:59:11 +0100 Subject: [PATCH] Print CREATE, not ATTACH --- src/Databases/DatabaseFactory.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Databases/DatabaseFactory.cpp b/src/Databases/DatabaseFactory.cpp index 7f41010f8cf..264807534b3 100644 --- a/src/Databases/DatabaseFactory.cpp +++ b/src/Databases/DatabaseFactory.cpp @@ -214,13 +214,17 @@ DatabasePtr DatabaseFactory::getImpl(const ASTCreateQuery & create, const String materialize_mode_settings->loadFromQuery(*engine_define); if (uuid == UUIDHelpers::Nil) + { + auto print_create_ast = create.clone(); + print_create_ast->as()->attach = false; throw Exception( fmt::format( "The MaterializedMySQL database engine no longer supports Ordinary databases. To re-create the database, delete " "the old one by executing \"rm -rf {}{{,.sql}}\", then re-create the database with the following query: {}", metadata_path, - queryToString(create)), + queryToString(print_create_ast)), ErrorCodes::NOT_IMPLEMENTED); + } return std::make_shared( context, database_name, metadata_path, uuid, configuration.database, std::move(mysql_pool),