diff options
author | David Boddie <dboddie@trolltech.com> | 2009-12-14 18:55:43 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-12-14 18:55:43 (GMT) |
commit | a068f6dd6115b2f950892e5228efe10b7de57a00 (patch) | |
tree | c55c44b2e1b452838a7443d85ca2463ca1ec15bd /src/sql/drivers/sqlite/qsql_sqlite.cpp | |
parent | ad4ca2152c161f7023e5febcf9e90c0652b8e57d (diff) | |
parent | adba8e01f0069d240bf0b97175f54e38271acd19 (diff) | |
download | Qt-a068f6dd6115b2f950892e5228efe10b7de57a00.zip Qt-a068f6dd6115b2f950892e5228efe10b7de57a00.tar.gz Qt-a068f6dd6115b2f950892e5228efe10b7de57a00.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/sql/drivers/sqlite/qsql_sqlite.cpp')
-rw-r--r-- | src/sql/drivers/sqlite/qsql_sqlite.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/sql/drivers/sqlite/qsql_sqlite.cpp b/src/sql/drivers/sqlite/qsql_sqlite.cpp index 8355de2..c62f15c 100644 --- a/src/sql/drivers/sqlite/qsql_sqlite.cpp +++ b/src/sql/drivers/sqlite/qsql_sqlite.cpp @@ -122,14 +122,14 @@ public: sqlite3_stmt *stmt; - 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()? QSqlRecord rInf; + QVector<QVariant> firstRow; }; QSQLiteResultPrivate::QSQLiteResultPrivate(QSQLiteResult* res) : q(res), access(0), - stmt(0), skippedStatus(false), skipRow(false), utf8(false) + stmt(0), skippedStatus(false), skipRow(false) { } @@ -189,10 +189,17 @@ bool QSQLiteResultPrivate::fetchNext(QSqlCachedResult::ValueCache &values, int i // already fetched Q_ASSERT(!initialFetch); skipRow = false; + for(int i=0;i<firstRow.count();i++) + values[i]=firstRow[i]; return skippedStatus; } skipRow = initialFetch; + if(initialFetch) { + firstRow.clear(); + firstRow.resize(sqlite3_column_count(stmt)); + } + if (!stmt) { q->setLastError(QSqlError(QCoreApplication::translate("QSQLiteResult", "Unable to fetch row"), QCoreApplication::translate("QSQLiteResult", "No query"), QSqlError::ConnectionError)); @@ -399,7 +406,7 @@ bool QSQLiteResult::exec() "Parameter count mismatch"), QString(), QSqlError::StatementError)); return false; } - d->skippedStatus = d->fetchNext(cache(), 0, true); + d->skippedStatus = d->fetchNext(d->firstRow, 0, true); if (lastError().isValid()) { setSelect(false); setActive(false); |