diff --git a/src/Formats/MySQLSource.cpp b/src/Formats/MySQLSource.cpp index 2d305a29df6..e6cb9f5ff11 100644 --- a/src/Formats/MySQLSource.cpp +++ b/src/Formats/MySQLSource.cpp @@ -100,12 +100,12 @@ void MySQLWithFailoverSource::onStart() catch (const mysqlxx::ConnectionLost & ecl) /// There are two retriable failures: CR_SERVER_GONE_ERROR, CR_SERVER_LOST { LOG_WARNING(log, "Failed connection ({}/{}). Trying to reconnect... (Info: {})", count_connect_attempts, settings->default_num_tries_on_connection_loss, ecl.displayText()); - } - if (++count_connect_attempts > settings->default_num_tries_on_connection_loss) - { - LOG_ERROR(log, "Failed to create connection to MySQL. ({}/{})", count_connect_attempts, settings->default_num_tries_on_connection_loss); - throw; + if (++count_connect_attempts > settings->default_num_tries_on_connection_loss) + { + LOG_ERROR(log, "Failed to create connection to MySQL. ({}/{})", count_connect_attempts, settings->default_num_tries_on_connection_loss); + throw; + } } }