summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-06-11 01:11:20 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-06-12 18:54:26 +0300
commitd6c3febee43aba928b0bc7d9681132c30ce2e744 (patch)
treebc6ecb499584a2d3e38163361c4273f72600a9fb
parentd128f34060fc05c36e61f4556edfd2eedbdbc85b (diff)
downloadqtlocation-mapboxgl-d6c3febee43aba928b0bc7d9681132c30ce2e744.tar.gz
[core] Fix bug of auto_vacuum not working
-rw-r--r--platform/default/src/mbgl/storage/offline_database.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/platform/default/src/mbgl/storage/offline_database.cpp b/platform/default/src/mbgl/storage/offline_database.cpp
index b60828d3a7..8c16ebf078 100644
--- a/platform/default/src/mbgl/storage/offline_database.cpp
+++ b/platform/default/src/mbgl/storage/offline_database.cpp
@@ -129,7 +129,6 @@ void OfflineDatabase::removeOldCacheTable() {
void OfflineDatabase::createSchema() {
assert(db);
- db->exec("PRAGMA auto_vacuum = INCREMENTAL");
db->exec("PRAGMA journal_mode = DELETE");
db->exec("PRAGMA synchronous = FULL");
mapbox::sqlite::Transaction transaction(*db);
@@ -140,7 +139,6 @@ void OfflineDatabase::createSchema() {
void OfflineDatabase::migrateToVersion3() {
assert(db);
- db->exec("PRAGMA auto_vacuum = INCREMENTAL");
db->exec("VACUUM");
db->exec("PRAGMA user_version = 3");
}
@@ -636,7 +634,7 @@ std::exception_ptr OfflineDatabase::clearTileCache() try {
query.run();
- db->exec("PRAGMA incremental_vacuum");
+ db->exec("VACUUM");
return nullptr;
} catch (const mapbox::sqlite::Exception& ex) {
@@ -811,7 +809,7 @@ std::exception_ptr OfflineDatabase::deleteRegion(OfflineRegion&& region) try {
evict(0);
assert(db);
- db->exec("PRAGMA incremental_vacuum");
+ db->exec("VACUUM");
// Ensure that the cached offlineTileCount value is recalculated.
offlineMapboxTileCount = {};
@@ -1070,11 +1068,11 @@ T OfflineDatabase::getPragma(const char* sql) {
// less than the maximum cache size. Returns false if this condition cannot be
// satisfied.
//
-// SQLite database never shrinks in size unless we call VACCUM. We here
+// SQLite database never shrinks in size unless we call VACUUM. We here
// are monitoring the soft limit (i.e. number of free pages in the file)
// and as it approaches to the hard limit (i.e. the actual file size) we
// delete an arbitrary number of old cache entries. The free pages approach saves
-// us from calling VACCUM or keeping a running total, which can be costly.
+// us from calling VACUUM or keeping a running total, which can be costly.
bool OfflineDatabase::evict(uint64_t neededFreeSize) {
uint64_t pageSize = getPragma<int64_t>("PRAGMA page_size");
uint64_t pageCount = getPragma<int64_t>("PRAGMA page_count");