diff options
Diffstat (limited to 'platform/qt/src/sqlite3.cpp')
-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); } |