Fixed #169.
This commit is contained in:
parent
a6479b2603
commit
7d4fc503a1
2 changed files with 14 additions and 3 deletions
|
@ -13,6 +13,7 @@ Added:
|
||||||
|
|
||||||
Fixed:
|
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)
|
▪ 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)
|
▪ Now title of the RSS/ATOM message is taken into account when deciding message "uniqueness". (bug #171)
|
||||||
▪ MySQL scripts improved. (bug #170)
|
▪ MySQL scripts improved. (bug #170)
|
||||||
|
|
|
@ -106,10 +106,20 @@ DatabaseFactory::MySQLError DatabaseFactory::mysqlTestConnection(const QString &
|
||||||
database.setDatabaseName(w_database);
|
database.setDatabaseName(w_database);
|
||||||
|
|
||||||
if (database.open() && !database.lastError().isValid()) {
|
if (database.open() && !database.lastError().isValid()) {
|
||||||
|
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.
|
// Connection succeeded, clean up the mess and return OK status.
|
||||||
database.close();
|
database.close();
|
||||||
return MySQLOk;
|
return MySQLOk;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
database.close();
|
||||||
|
return MySQLUnknownError;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (database.lastError().isValid()) {
|
else if (database.lastError().isValid()) {
|
||||||
// Connection failed, do cleanup and return specific error code.
|
// Connection failed, do cleanup and return specific error code.
|
||||||
return static_cast<MySQLError>(database.lastError().number());
|
return static_cast<MySQLError>(database.lastError().number());
|
||||||
|
|
Loading…
Add table
Reference in a new issue