summaryrefslogtreecommitdiff
path: root/plugins/Dbx_sqlite
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2022-02-11 18:39:41 +0300
committerGeorge Hazan <ghazan@miranda.im>2022-02-11 18:39:41 +0300
commitc9a014304af901c2266e1170b030956e8601e293 (patch)
treeb5eb80f6a3fcb912c70ec5814afbd6a1e987aaee /plugins/Dbx_sqlite
parentd4f245126bfb584d7026b15bb449184daec3e2fb (diff)
fixes #2958 Dbx_sqlite: VACUUM doesn't worl)
Diffstat (limited to 'plugins/Dbx_sqlite')
-rwxr-xr-xplugins/Dbx_sqlite/src/dbintf.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/Dbx_sqlite/src/dbintf.cpp b/plugins/Dbx_sqlite/src/dbintf.cpp
index d8b6d83712..16d7ca8783 100755
--- a/plugins/Dbx_sqlite/src/dbintf.cpp
+++ b/plugins/Dbx_sqlite/src/dbintf.cpp
@@ -186,11 +186,18 @@ BOOL CDbxSQLite::Backup(LPCWSTR profile)
BOOL CDbxSQLite::Compact()
{
+ mir_cslock lck(m_csDbAccess);
int rc = sqlite3_exec(m_db, "pragma optimize;", nullptr, nullptr, nullptr);
logError(rc, __FILE__, __LINE__);
+ rc = sqlite3_exec(m_db, "commit;", nullptr, nullptr, nullptr);
+ logError(rc, __FILE__, __LINE__);
+
rc = sqlite3_exec(m_db, "vacuum;", nullptr, nullptr, nullptr);
logError(rc, __FILE__, __LINE__);
+
+ rc = sqlite3_exec(m_db, "begin transaction;", nullptr, nullptr, nullptr);
+ logError(rc, __FILE__, __LINE__);
return 0;
}