From b1224cff0cfeee4b6e2005be89fd5e1d797ed9ce Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Wed, 16 May 2018 10:50:34 +0200 Subject: [PATCH] SyncJournal: Check file existence even for open dbs #6049 With WAL mode sqlite seems to occasionally crash when the underlying filesystem goes away. --- src/common/syncjournaldb.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp index 8a41a4ac6c..9d44bf08c6 100644 --- a/src/common/syncjournaldb.cpp +++ b/src/common/syncjournaldb.cpp @@ -272,6 +272,11 @@ bool SyncJournalDb::sqlFail(const QString &log, const SqlQuery &query) bool SyncJournalDb::checkConnect() { if (_db.isOpen()) { + if (!QFile::exists(_dbFile)) { + qCWarning(lcDb) << "Database open, but file file" + _dbFile + " does not exist"; + close(); + return false; + } return true; }