This commit is contained in:
Martin Rotter 2016-03-16 08:54:26 +01:00
parent a6479b2603
commit 7d4fc503a1
2 changed files with 14 additions and 3 deletions

View File

@ -13,6 +13,7 @@ Added:
Fixed:
▪ Better detection of MySQL server status. (bug #169)
▪ Ordering of messages is now done on SQL server (stands for both MySQL and SQLite). (bug #172)
▪ Now title of the RSS/ATOM message is taken into account when deciding message "uniqueness". (bug #171)
▪ MySQL scripts improved. (bug #170)

View File

@ -106,9 +106,19 @@ DatabaseFactory::MySQLError DatabaseFactory::mysqlTestConnection(const QString &
database.setDatabaseName(w_database);
if (database.open() && !database.lastError().isValid()) {
// Connection succeeded, clean up the mess and return OK status.
database.close();
return MySQLOk;
QSqlQuery query(QSL("SELECT version();"), database);
if (!query.lastError().isValid() && query.next()) {
qDebug("Checked MySQL database, version is '%s'.", qPrintable(query.value(0).toString()));
// Connection succeeded, clean up the mess and return OK status.
database.close();
return MySQLOk;
}
else {
database.close();
return MySQLUnknownError;
}
}
else if (database.lastError().isValid()) {
// Connection failed, do cleanup and return specific error code.