diff options
author | Bill King <bill.king@nokia.com> | 2009-12-04 00:48:37 (GMT) |
---|---|---|
committer | Bill King <bill.king@nokia.com> | 2009-12-04 00:48:37 (GMT) |
commit | 1d6be599f5c12e9ce23bbdf081a103aa62618e15 (patch) | |
tree | da6a7d84b59a3ed9b2f090c5356ba6106ea70ff5 /src/sql | |
parent | a2eda737c58434ee2604b6466dcf3212a35b604f (diff) | |
download | Qt-1d6be599f5c12e9ce23bbdf081a103aa62618e15.zip Qt-1d6be599f5c12e9ce23bbdf081a103aa62618e15.tar.gz Qt-1d6be599f5c12e9ce23bbdf081a103aa62618e15.tar.bz2 |
Fixes: QOCI setForwardOnly(true) accumulating values.
readPiecewise() is assuming an empty valueCache when reading a new row.
setForwardOnly(true) means that only one row is used/re-used. The value
cache wasn't being cleared out when moving to a new row, so the above
assumption was invalid.
Task-number: QTBUG-6421
Reviewed-by: Justin McPherson
Diffstat (limited to 'src/sql')
-rw-r--r-- | src/sql/kernel/qsqlcachedresult.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/sql/kernel/qsqlcachedresult.cpp b/src/sql/kernel/qsqlcachedresult.cpp index b4a9241..2e4d19e 100644 --- a/src/sql/kernel/qsqlcachedresult.cpp +++ b/src/sql/kernel/qsqlcachedresult.cpp @@ -278,6 +278,11 @@ bool QSqlCachedResult::cacheNext() if (d->atEnd) return false; + if(isForwardOnly()) { + d->cache.clear(); + d->cache.resize(d->colCount); + } + if (!gotoNext(d->cache, d->nextIndex())) { d->revertLast(); d->atEnd = true; |