From 959451af5dad7acc4dab3d5f16c8cdc15d8c8e71 Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Mon, 13 Oct 2014 13:07:21 +0000 Subject: [PATCH] sqlite plugin - disable shared cache for sqlite prior to 3.7.15 --- plugins/input/sqlite/sqlite_connection.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/input/sqlite/sqlite_connection.hpp b/plugins/input/sqlite/sqlite_connection.hpp index 176a56d9a..966402f41 100644 --- a/plugins/input/sqlite/sqlite_connection.hpp +++ b/plugins/input/sqlite/sqlite_connection.hpp @@ -57,7 +57,12 @@ public: int mode = SQLITE_OPEN_READWRITE; #if SQLITE_VERSION_NUMBER >= 3006018 // shared cache flag not available until >= 3.6.18 - mode |= SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_SHAREDCACHE; + // Don't use shared cache in SQLite prior to 3.7.15. + // https://github.com/mapnik/mapnik/issues/2483 + if (sqlite3_libversion_number() >= 3007015) + { + mode |= SQLITE_OPEN_NOMUTEX | SQLITE_OPEN_SHAREDCACHE; + } #endif const int rc = sqlite3_open_v2 (file_.c_str(), &db_, mode, 0); #else