summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqlcachedresult.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/kernel/qsqlcachedresult.cpp')
-rw-r--r--src/sql/kernel/qsqlcachedresult.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sql/kernel/qsqlcachedresult.cpp b/src/sql/kernel/qsqlcachedresult.cpp
index ca51dc0..13e6d82 100644
--- a/src/sql/kernel/qsqlcachedresult.cpp
+++ b/src/sql/kernel/qsqlcachedresult.cpp
@@ -184,8 +184,11 @@ bool QSqlCachedResult::fetch(int i)
if (d->rowCacheEnd > 0)
setAt(d->cacheCount());
while (at() < i + 1) {
- if (!cacheNext())
+ if (!cacheNext()) {
+ if (d->canSeek(i))
+ break;
return false;
+ }
}
setAt(i);