This commit is contained in:
Alexander Tokmakov 2020-09-17 21:19:02 +03:00
parent 41e99cf261
commit 1c37ac7c9d
2 changed files with 13 additions and 2 deletions

View File

@ -23,6 +23,7 @@ namespace DB
namespace ErrorCodes
{
extern const int NOT_IMPLEMENTED;
extern const int LOGICAL_ERROR;
}
template<>
@ -56,7 +57,17 @@ void DatabaseMaterializeMySQL<Base>::rethrowExceptionIfNeed() const
if (!settings->allows_query_when_mysql_lost && exception)
{
std::rethrow_exception(exception);
try
{
std::rethrow_exception(exception);
}
catch (Exception & ex)
{
/// This method can be called from multiple threads
/// and Exception can be modified concurrently by calling addMessage(...),
/// so we rethrow a copy.
throw Exception(ex);
}
}
}

View File

@ -161,7 +161,7 @@ BlockIO InterpreterCreateQuery::createDatabase(ASTCreateQuery & create)
if (create_from_user)
{
auto & default_engine = context.getSettingsRef().default_database_engine.value;
const auto & default_engine = context.getSettingsRef().default_database_engine.value;
if (create.uuid == UUIDHelpers::Nil && default_engine == DefaultDatabaseEngine::Atomic)
create.uuid = UUIDHelpers::generateV4(); /// Will enable Atomic engine for nested database
}