提交 8ba7ad40 authored 作者: Thomas Mueller's avatar Thomas Mueller

The functions isBeforeFirst() and isAfterLast() were not compliant to the JDBC spec.

上级 7ce04a6f
...@@ -426,14 +426,14 @@ public class TestUpdatableResultSet extends TestBase { ...@@ -426,14 +426,14 @@ public class TestUpdatableResultSet extends TestBase {
ResultSet rs = stat.executeQuery("SELECT * FROM TEST"); ResultSet rs = stat.executeQuery("SELECT * FROM TEST");
assertEquals(type, rs.getType()); assertEquals(type, rs.getType());
assertState(rs, true, false, false, rows == 0); assertState(rs, rows > 0, false, false, false);
for (int i = 0; i < rows; i++) { for (int i = 0; i < rows; i++) {
rs.next(); rs.next();
assertState(rs, rows == 0, i == 0, i == rows - 1, rows == 0 || i == rows); assertState(rs, rows == 0, i == 0, i == rows - 1, rows == 0 || i == rows);
} }
try { try {
rs.beforeFirst(); rs.beforeFirst();
assertState(rs, true, false, false, rows == 0); assertState(rs, rows > 0, false, false, false);
} catch (SQLException e) { } catch (SQLException e) {
if (!error) { if (!error) {
throw e; throw e;
...@@ -441,7 +441,7 @@ public class TestUpdatableResultSet extends TestBase { ...@@ -441,7 +441,7 @@ public class TestUpdatableResultSet extends TestBase {
} }
try { try {
rs.afterLast(); rs.afterLast();
assertState(rs, false, false, false, true); assertState(rs, false, false, false, rows > 0);
} catch (SQLException e) { } catch (SQLException e) {
if (!error) { if (!error) {
throw e; throw e;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论