diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-11 05:47:02 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-11 05:47:02 (GMT) |
commit | 9417c6cf7eba29fd7ee4bb7adffd2722729af633 (patch) | |
tree | 98f789486ad1488fb96b142e0273d86423563ae2 | |
parent | e32bb8f0e79232419b9516fa8273eadbaa8aad9e (diff) | |
parent | 8d76de98d93421395306941e59d136f1e7395d15 (diff) | |
download | Qt-9417c6cf7eba29fd7ee4bb7adffd2722729af633.zip Qt-9417c6cf7eba29fd7ee4bb7adffd2722729af633.tar.gz Qt-9417c6cf7eba29fd7ee4bb7adffd2722729af633.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
(Sqlite2) Fix for QTBUG-6421
-rw-r--r-- | src/sql/drivers/sqlite2/qsql_sqlite2.cpp | 16 |
1 files 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<QVariant> 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;i<firstRow.count(); i++) + values[i] = firstRow[i]; return skippedStatus; } skipRow = initialFetch; @@ -209,6 +212,11 @@ bool QSQLite2ResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int #endif } + if(initialFetch) { + firstRow.clear(); + firstRow.resize(colNum); + } + switch(res) { case SQLITE_ROW: // check to see if should fill out columns @@ -299,7 +307,7 @@ bool QSQLite2Result::reset (const QString& query) } // we have to fetch one row to find out about // the structure of the result set - d->skippedStatus = d->fetchNext(cache(), 0, true); + d->skippedStatus = d->fetchNext(d->firstRow, 0, true); if (lastError().isValid()) { setSelect(false); setActive(false); |