Merge pull request #58520 from tomahawk28/master

Enable ordinary databases while restoration
This commit is contained in:
Alexander Tokmakov 2024-01-05 15:31:25 +01:00 committed by GitHub
commit 97481bf0a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -573,11 +573,12 @@ void RestorerFromBackup::createDatabase(const String & database_name) const
create_database_query->if_not_exists = (restore_settings.create_table == RestoreTableCreationMode::kCreateIfNotExists);
LOG_TRACE(log, "Creating database {}: {}", backQuoteIfNeed(database_name), serializeAST(*create_database_query));
auto query_context = Context::createCopy(context);
query_context->setSetting("allow_deprecated_database_ordinary", 1);
try
{
/// Execute CREATE DATABASE query.
InterpreterCreateQuery interpreter{create_database_query, context};
InterpreterCreateQuery interpreter{create_database_query, query_context};
interpreter.setInternal(true);
interpreter.execute();
}