diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-11-07 23:30:52 +0200 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-11-09 15:31:34 +0200 |
commit | 65f3ba11f7adc62e301b463a3c9355d0ba7bb617 (patch) | |
tree | 83fbcd109e07f342ea084248d1da65a78c434e8c | |
parent | cec7d12e37e61cad8c631a97f4d0a52eeba81a7b (diff) | |
download | qtlocation-mapboxgl-65f3ba11f7adc62e301b463a3c9355d0ba7bb617.tar.gz |
[Qt] Qt SQLite driver has no setForwardOnly support
-rw-r--r-- | platform/qt/src/sqlite3.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp index 7d47ae552b..f5454e0170 100644 --- a/platform/qt/src/sqlite3.cpp +++ b/platform/qt/src/sqlite3.cpp @@ -102,7 +102,6 @@ public: class StatementImpl { public: StatementImpl(const QString& sql, const QSqlDatabase& db) : query(db) { - query.setForwardOnly(true); if (!query.prepare(sql)) { checkQueryError(query); } @@ -170,8 +169,8 @@ void Database::exec(const std::string &sql) { statement.append(';'); } QSqlQuery query(*impl->db); - query.setForwardOnly(true); query.prepare(statement); + if (!query.exec()) { checkQueryError(query); } @@ -296,12 +295,11 @@ void Statement::bindBlob(int offset, const std::vector<uint8_t>& value, bool ret bool Statement::run() { assert(impl); + if (impl->query.isValid()) { return impl->query.next(); } - assert(!impl->query.isActive()); - impl->query.setForwardOnly(true); if (!impl->query.exec()) { checkQueryError(impl->query); } |