diff --git a/lib/db_ido_mysql/idomysqlconnection.cpp b/lib/db_ido_mysql/idomysqlconnection.cpp index 9906de942..153b11e34 100644 --- a/lib/db_ido_mysql/idomysqlconnection.cpp +++ b/lib/db_ido_mysql/idomysqlconnection.cpp @@ -226,6 +226,7 @@ void IdoMysqlConnection::Reconnect(void) Log(LogCritical, "IdoMysqlConnection", "Schema does not provide any valid version! Verify your schema installation."); Application::RequestShutdown(EXIT_FAILURE); + return; } DiscardRows(result); @@ -238,6 +239,7 @@ void IdoMysqlConnection::Reconnect(void) << SCHEMA_VERSION << "'! Please check the upgrade documentation."; Application::RequestShutdown(EXIT_FAILURE); + return; } String instanceName = GetInstanceName(); diff --git a/lib/db_ido_pgsql/idopgsqlconnection.cpp b/lib/db_ido_pgsql/idopgsqlconnection.cpp index fa9b935cf..dcbc292c5 100644 --- a/lib/db_ido_pgsql/idopgsqlconnection.cpp +++ b/lib/db_ido_pgsql/idopgsqlconnection.cpp @@ -223,19 +223,27 @@ void IdoPgsqlConnection::Reconnect(void) Dictionary::Ptr row = FetchRow(result, 0); if (!row) { + PQfinish(m_Connection); + m_Connection = NULL; + Log(LogCritical, "IdoPgsqlConnection", "Schema does not provide any valid version! Verify your schema installation."); Application::RequestShutdown(EXIT_FAILURE); + return; } String version = row->Get("version"); if (Utility::CompareVersion(SCHEMA_VERSION, version) < 0) { + PQfinish(m_Connection); + m_Connection = NULL; + Log(LogCritical, "IdoPgsqlConnection") << "Schema version '" << version << "' does not match the required version '" << SCHEMA_VERSION << "'! Please check the upgrade documentation."; Application::RequestShutdown(EXIT_FAILURE); + return; } String instanceName = GetInstanceName();