summaryrefslogtreecommitdiffstats
path: root/src/sql
diff options
context:
space:
mode:
authorBill King <bill.king@nokia.com>2009-12-04 00:48:37 (GMT)
committerBill King <bill.king@nokia.com>2009-12-04 00:48:37 (GMT)
commit1d6be599f5c12e9ce23bbdf081a103aa62618e15 (patch)
treeda6a7d84b59a3ed9b2f090c5356ba6106ea70ff5 /src/sql
parenta2eda737c58434ee2604b6466dcf3212a35b604f (diff)
downloadQt-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.cpp5
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;