Skip to content

Commit

Permalink
Merge pull request ClickHouse#58520 from tomahawk28/master
Browse files Browse the repository at this point in the history
Enable ordinary databases while restoration
  • Loading branch information
tavplubix authored Jan 5, 2024
2 parents 7c867a0 + 491df7b commit 97481bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Backups/RestorerFromBackup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 97481bf

Please sign in to comment.