mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-19 16:20:50 +00:00
Merge b4f19faad8
into b94a7167a8
This commit is contained in:
commit
6c9956b6ba
@ -50,6 +50,7 @@ namespace ErrorCodes
|
||||
extern const int UNEXPECTED_AST_STRUCTURE;
|
||||
extern const int CANNOT_CREATE_DATABASE;
|
||||
extern const int BAD_ARGUMENTS;
|
||||
extern const int CANNOT_GET_CREATE_TABLE_QUERY;
|
||||
}
|
||||
|
||||
constexpr static const auto suffix = ".remove_flag";
|
||||
@ -142,7 +143,23 @@ ASTPtr DatabaseMySQL::getCreateTableQueryImpl(const String & table_name, Context
|
||||
{
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
fetchTablesIntoLocalCache(local_context);
|
||||
try
|
||||
{
|
||||
/// This function can throw mysql exception, we don't have enough context to handle it
|
||||
/// So we just catch and re-throw as known exception if needed.
|
||||
fetchTablesIntoLocalCache(local_context);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
if (throw_on_error)
|
||||
{
|
||||
throw Exception(ErrorCodes::CANNOT_GET_CREATE_TABLE_QUERY,
|
||||
"Received error while fetching table structure for table {} from MySQL: {}",
|
||||
backQuote(table_name), getCurrentExceptionMessage(true));
|
||||
}
|
||||
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
}
|
||||
|
||||
if (local_tables_cache.find(table_name) == local_tables_cache.end())
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user