Fixed #55.
This commit is contained in:
parent
c20bf626f4
commit
b465901118
3 changed files with 29 additions and 2 deletions
|
|
@ -1,4 +1,19 @@
|
||||||
<body>
|
<body>
|
||||||
|
<center><h2>2.0.0.2</h2></center>
|
||||||
|
|
||||||
|
Fixed:
|
||||||
|
<ul>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
Added:
|
||||||
|
<ul>
|
||||||
|
<li>MySQL backend now alows to defragment/optimize RSS Guard database.</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
Changed:
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
<center><h2>2.0.0.1</h2></center>
|
<center><h2>2.0.0.1</h2></center>
|
||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
|
|
|
||||||
|
|
@ -428,8 +428,8 @@ QSqlDatabase DatabaseFactory::mysqlInitializeDatabase(const QString &connection_
|
||||||
query_db.exec(statement);
|
query_db.exec(statement);
|
||||||
|
|
||||||
if (query_db.lastError().isValid()) {
|
if (query_db.lastError().isValid()) {
|
||||||
qFatal("MySQL database initialization failed. Initialization script '%s' is not correct.",
|
qFatal("MySQL database initialization failed. Initialization script '%s' is not correct. Error : '%s'.",
|
||||||
APP_DB_MYSQL_INIT);
|
APP_DB_MYSQL_INIT, qPrintable(query_db.lastError().databaseText()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -453,6 +453,13 @@ QSqlDatabase DatabaseFactory::mysqlInitializeDatabase(const QString &connection_
|
||||||
return database;
|
return database;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DatabaseFactory::mysqlVacuumDatabase() {
|
||||||
|
QSqlDatabase database = mysqlConnection(objectName());
|
||||||
|
QSqlQuery query_vacuum(database);
|
||||||
|
|
||||||
|
return query_vacuum.exec("OPTIMIZE TABLE rssguard.feeds;") && query_vacuum.exec("OPTIMIZE TABLE rssguard.messages;");
|
||||||
|
}
|
||||||
|
|
||||||
QSqlDatabase DatabaseFactory::sqliteConnection(const QString &connection_name,
|
QSqlDatabase DatabaseFactory::sqliteConnection(const QString &connection_name,
|
||||||
DatabaseFactory::DesiredType desired_type) {
|
DatabaseFactory::DesiredType desired_type) {
|
||||||
if (desired_type == DatabaseFactory::StrictlyInMemory ||
|
if (desired_type == DatabaseFactory::StrictlyInMemory ||
|
||||||
|
|
@ -548,6 +555,8 @@ bool DatabaseFactory::vacuumDatabase() {
|
||||||
return sqliteVacuumDatabase();
|
return sqliteVacuumDatabase();
|
||||||
|
|
||||||
case MYSQL:
|
case MYSQL:
|
||||||
|
return mysqlVacuumDatabase();
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,9 @@ class DatabaseFactory : public QObject {
|
||||||
// Initializes MySQL database.
|
// Initializes MySQL database.
|
||||||
QSqlDatabase mysqlInitializeDatabase(const QString &connection_name);
|
QSqlDatabase mysqlInitializeDatabase(const QString &connection_name);
|
||||||
|
|
||||||
|
// Runs "VACUUM" on the database.
|
||||||
|
bool mysqlVacuumDatabase();
|
||||||
|
|
||||||
// True if MySQL database is fully initialized for use,
|
// True if MySQL database is fully initialized for use,
|
||||||
// otherwise false.
|
// otherwise false.
|
||||||
bool m_mysqlDatabaseInitialized;
|
bool m_mysqlDatabaseInitialized;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue