summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/sql/kernel/qsqlcachedresult.cpp5
-rw-r--r--tests/auto/qsqlquery/tst_qsqlquery.cpp10
2 files changed, 8 insertions, 7 deletions
diff --git a/src/sql/kernel/qsqlcachedresult.cpp b/src/sql/kernel/qsqlcachedresult.cpp
index 3cace06..4b094c6 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);
diff --git a/tests/auto/qsqlquery/tst_qsqlquery.cpp b/tests/auto/qsqlquery/tst_qsqlquery.cpp
index 825db6c..ed19e91 100644
--- a/tests/auto/qsqlquery/tst_qsqlquery.cpp
+++ b/tests/auto/qsqlquery/tst_qsqlquery.cpp
@@ -175,13 +175,14 @@ private slots:
void emptyTableNavigate();
#ifdef NOT_READY_YET
- void task_217003_data() { generic_data(); }
- void task_217003();
void task_229811();
void task_229811_data() { generic_data(); }
void task_234422_data() { generic_data(); }
void task_234422();
#endif
+ void task_217003_data() { generic_data(); }
+ void task_217003();
+
void task_250026_data() { generic_data("QODBC"); }
void task_250026();
void task_205701_data() { generic_data("QMYSQL"); }
@@ -299,9 +300,8 @@ void tst_QSqlQuery::dropTestTables( QSqlDatabase db )
tablenames << qTableName( "qtest_lockedtable" );
-#ifdef NOT_READY_YET
tablenames << qTableName( "Planet" );
-#endif
+
tablenames << qTableName( "task_250026" );
tst_Databases::safeDropTables( db, tablenames );
@@ -2658,7 +2658,6 @@ void tst_QSqlQuery::emptyTableNavigate()
}
}
-#ifdef NOT_READY_YET
void tst_QSqlQuery::task_217003()
{
QFETCH( QString, dbName );
@@ -2685,7 +2684,6 @@ void tst_QSqlQuery::task_217003()
QVERIFY_SQL( q, seek( 1 ) );
QCOMPARE( q.value( 0 ).toString(), QString( "Venus" ) );
}
-#endif
void tst_QSqlQuery::task_250026()
{