diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2017-01-25 22:08:37 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2017-03-16 02:46:01 +0000 |
commit | 44f406ce95c340b24604ee6e61d9f8428b5c2cb4 (patch) | |
tree | 8686b2c6cfc9fb3f9472697bdd37a5c4a7bb8efb /src/plugins | |
parent | 7f1a220ee423a72e802452bb11f34f11e37a74d1 (diff) |
Stop using sqlite3_enable_shared_cache: deprecated on macOS
qsql_sqlite.cpp:643:5: warning: 'sqlite3_enable_shared_cache' is deprecated: first deprecated in macOS 10.7 [-Wdeprecated-declarations]
https://www.sqlite.org/c3ref/enable_shared_cache.html says to use the
flag to sqlite3_open_v2()
Change-Id: Ib499cebaa4c4489b90b9fffd149d3d5bf9434ae5
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp index b42fd74b3e..c2feaeea56 100644 --- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp +++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp @@ -696,11 +696,10 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c } int openMode = (openReadOnlyOption ? SQLITE_OPEN_READONLY : (SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); + openMode |= (sharedCache ? SQLITE_OPEN_SHAREDCACHE : SQLITE_OPEN_PRIVATECACHE); if (openUriOption) openMode |= SQLITE_OPEN_URI; - sqlite3_enable_shared_cache(sharedCache); - if (sqlite3_open_v2(db.toUtf8().constData(), &d->access, openMode, NULL) == SQLITE_OK) { sqlite3_busy_timeout(d->access, timeOut); setOpen(true); |