Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
1.4.6
-
None
-
Oracle Java 1.8u92
MariaDB 10
Connector/J 1.4.6 (reproducible with 1.4.5 too)
Description
I wrote a Unit-Test to demonstrate exception
@Test
|
public void scrollScrollableResultTest() throws SQLException { |
insertRows(2); |
PreparedStatement stmt = sharedConnection.prepareStatement("SELECT * FROM result_set_test", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); |
stmt.setFetchSize(2); |
ResultSet rs = stmt.executeQuery();
|
try { |
rs.beforeFirst();
|
assertTrue(true); |
} catch(SQLException sqle) { |
fail("beforeFirst() should work on a TYPE_SCROLL_INSENSITIVE result set"); |
} finally { |
stmt.close();
|
rs.close();
|
}
|
}
|
This test will fail.
Our ERP application failed with the maria driver but worked with the mysql driver and it took us a while figuring out why.
Reading through the code I found that mariaDb driver ignores the scroll-type, since it's always "SCROLL_INSENSITIVE".
This is fine, however other parts of the driver do make the distinction.
a unit-test and "workaround" hack has been written and will create a pull-request for discussion.
It is a hack, better would be to implement the scroll-type information.