From 8d76de98d93421395306941e59d136f1e7395d15 Mon Sep 17 00:00:00 2001 From: Bill King Date: Mon, 11 Jan 2010 14:15:56 +1000 Subject: (Sqlite2) Fix for QTBUG-6421 Forgot to port the fix over to sqlite2 which seems to also be affected by the setForwardOnly caching bug as well. Task-number: QTBUG-6421 Reviewed-by: Justin McPherson --- src/sql/drivers/sqlite2/qsql_sqlite2.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp index 1c1a411..20cb01b 100644 --- a/src/sql/drivers/sqlite2/qsql_sqlite2.cpp +++ b/src/sql/drivers/sqlite2/qsql_sqlite2.cpp @@ -110,10 +110,11 @@ public: const char *currentTail; sqlite_vm *currentMachine; - uint skippedStatus: 1; // the status of the fetchNext() that's skipped - uint skipRow: 1; // skip the next fetchNext()? - uint utf8: 1; + bool skippedStatus; // the status of the fetchNext() that's skipped + bool skipRow; // skip the next fetchNext()? + bool utf8; QSqlRecord rInf; + QVector firstRow; }; static const uint initial_cache_size = 128; @@ -192,6 +193,8 @@ bool QSQLite2ResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int // already fetched Q_ASSERT(!initialFetch); skipRow = false; + for(int i=0;iskippedStatus = d->fetchNext(cache(), 0, true); + d->skippedStatus = d->fetchNext(d->firstRow, 0, true); if (lastError().isValid()) { setSelect(false); setActive(false); -- cgit v0.12