Skip to content

Commit

Permalink
Merge pull request #39 from special/master
Browse files Browse the repository at this point in the history
[qmf] Fix unscoped SQL query causing transaction failures
  • Loading branch information
special committed Jun 4, 2014
2 parents 6318326 + bb36451 commit 0e55361
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions qmf/src/libraries/qmfclient/qmailstore_p.cpp
Expand Up @@ -3177,12 +3177,14 @@ bool QMailStorePrivate::initStore()
}

#if defined(Q_USE_SQLITE)
QSqlQuery query( *database() );
query.exec(QLatin1String("PRAGMA journal_mode=WAL;")); // enable write ahead logging
if (query.next() && query.value(0).toString().toLower() != "wal") {
qWarning() << "res" << query.value(0).toString().toLower();
qWarning() << "INCORRECT DATABASE FORMAT!!! EXPECT SLOW DATABASE PERFORMANCE!!!";
qWarning() << "WAL mode disabled. Please delete $QMF_DATA directory, and/or update sqlite to >= 3.7.";
{
QSqlQuery query( *database() );
query.exec(QLatin1String("PRAGMA journal_mode=WAL;")); // enable write ahead logging
if (query.next() && query.value(0).toString().toLower() != "wal") {
qWarning() << "res" << query.value(0).toString().toLower();
qWarning() << "INCORRECT DATABASE FORMAT!!! EXPECT SLOW DATABASE PERFORMANCE!!!";
qWarning() << "WAL mode disabled. Please delete $QMF_DATA directory, and/or update sqlite to >= 3.7.";
}
}
{
// Reduce page cache from 2MB (2000 pages) to 1MB
Expand Down
2 changes: 1 addition & 1 deletion rpm/qmf-qt5.spec
Expand Up @@ -163,7 +163,7 @@ This package contains the documentation for Qt Messaging Framework (QMF).
DEFINES+=MESSAGESERVER_PLUGINS \
CONFIG+=syslog

make %{?jobs:-j%jobs}
make %{?_smp_mflags}

# >> build post
# << build post
Expand Down
2 changes: 1 addition & 1 deletion rpm/qmf.spec
Expand Up @@ -164,7 +164,7 @@ This package contains the documentation for Qt Messaging Framework (QMF).
DEFINES+=MESSAGESERVER_PLUGINS \
CONFIG+=syslog

make %{?jobs:-j%jobs}
make %{?_smp_mflags}

# >> build post
# << build post
Expand Down

0 comments on commit 0e55361

Please sign in to comment.